From 354b731b63ba1ca5fbd5faf1291c314d3d31d9cd Mon Sep 17 00:00:00 2001
From: Martin Weinelt <hexa@darmstadt.ccc.de>
Date: Wed, 11 May 2022 23:38:15 +0200
Subject: [PATCH] dump_syms: init at unstable-2022-05-05

---
 pkgs/development/tools/dump_syms/default.nix | 46 ++++++++++++++++++++
 pkgs/top-level/all-packages.nix              |  2 +
 2 files changed, 48 insertions(+)
 create mode 100644 pkgs/development/tools/dump_syms/default.nix

diff --git a/pkgs/development/tools/dump_syms/default.nix b/pkgs/development/tools/dump_syms/default.nix
new file mode 100644
index 000000000000..a8c6821f27f4
--- /dev/null
+++ b/pkgs/development/tools/dump_syms/default.nix
@@ -0,0 +1,46 @@
+{ lib
+, rustPlatform
+, fetchFromGitHub
+, pkg-config
+, openssl
+}:
+
+let
+  pname = "dump_syms";
+  version = "unstable-2022-05-05";
+in
+rustPlatform.buildRustPackage {
+  inherit pname version;
+
+  src = fetchFromGitHub {
+    owner = "mozilla";
+    repo = pname;
+    rev = "c2743d59b5aa321ade698f84b90f86b3d35a1b06";
+    hash = "sha256-hWK9KrYqbfrF8b7i33InlTa/XkoZs+h49kUsKeSaAok=";
+  };
+
+  cargoSha256 = "sha256:0vsr867nl156wpxpw01bv9fxsp6rhj9vvpz2i2yhx4kjgr1qk1kw";
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  buildInputs = [
+    openssl
+  ];
+
+  checkFlags = [
+    # Disable tests that require network access
+    # ConnectError("dns error", Custom { kind: Uncategorized, error: "failed to lookup address information: Temporary failure in name resolution" })) }', src/windows/pdb.rs:725:56
+    "--skip windows::pdb::tests::test_ntdll"
+    "--skip windows::pdb::tests::test_oleaut32"
+  ];
+
+  meta = with lib; {
+    changelog = "https://github.com/mozilla/dump_syms/releases/tag/v${version}";
+    description = "Command-line utility for parsing the debugging information the compiler provides in ELF or stand-alone PDB files";
+    license = licenses.asl20;
+    homepage = "https://github.com/mozilla/dump_syms/";
+    maintainers = with maintainers; [ hexa ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 8fe1c79cf7eb..98d943b716a9 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -5306,6 +5306,8 @@ with pkgs;
     autoreconfHook = buildPackages.autoreconfHook269;
   };
 
+  dump_syms = callPackage ../development/tools/dump_syms { };
+
   dumptorrent = callPackage ../tools/misc/dumptorrent { };
 
   duo-unix = callPackage ../tools/security/duo-unix { };