about summary refs log tree commit diff
path: root/pkgs/applications/science/electronics
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2024-02-11 23:39:17 +0100
committerGitHub <noreply@github.com>2024-02-11 23:39:17 +0100
commit4b96fcd46b05926d16c5c635e36ec85da4cbecb9 (patch)
treed00493a52abc7373da49a5516ec0ecae82364423 /pkgs/applications/science/electronics
parent72485491cc10e7359ebc71c09ee6e014e5488c5e (diff)
parentb5dfa01e6781cf907109567d5ca994a80e0be02f (diff)
downloadnixlib-4b96fcd46b05926d16c5c635e36ec85da4cbecb9.tar
nixlib-4b96fcd46b05926d16c5c635e36ec85da4cbecb9.tar.gz
nixlib-4b96fcd46b05926d16c5c635e36ec85da4cbecb9.tar.bz2
nixlib-4b96fcd46b05926d16c5c635e36ec85da4cbecb9.tar.lz
nixlib-4b96fcd46b05926d16c5c635e36ec85da4cbecb9.tar.xz
nixlib-4b96fcd46b05926d16c5c635e36ec85da4cbecb9.tar.zst
nixlib-4b96fcd46b05926d16c5c635e36ec85da4cbecb9.zip
Merge pull request #279656 from risicle/ris-degate-2.0.0
degate: init at 2.0.0
Diffstat (limited to 'pkgs/applications/science/electronics')
-rw-r--r--pkgs/applications/science/electronics/degate/default.nix75
1 files changed, 75 insertions, 0 deletions
diff --git a/pkgs/applications/science/electronics/degate/default.nix b/pkgs/applications/science/electronics/degate/default.nix
new file mode 100644
index 000000000000..2aa20aec6503
--- /dev/null
+++ b/pkgs/applications/science/electronics/degate/default.nix
@@ -0,0 +1,75 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, boost
+, qtbase
+, qtimageformats
+, qttools
+, wrapQtAppsHook
+}:
+
+let
+  boost_static = boost.override { enableStatic = true; };
+
+in stdenv.mkDerivation rec {
+  pname = "degate";
+  version = "2.0.0";
+
+  src = fetchFromGitHub {
+    owner = "DegateCommunity";
+    repo = "Degate";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-INoA3Z6ya03ZMn6E+nOCkXZLoxoo2WgPDw9v5miI09A=";
+  };
+
+  patches = [
+    # bump bundled catch2 to avoid incompatibility with modern glibc
+    (fetchpatch {
+      name = "catch2-2.13.9.patch";
+      url = "https://github.com/DegateCommunity/Degate/commit/06346dde4312cbb867854899eacf58679d6ac7e2.patch";
+      includes = [ "tests/catch2/catch.hpp" ];
+      hash = "sha256-SbSA813QI8RRVy1lvAOGMGAC2KUQKjwYR2imqX40pvU=";
+    })
+  ];
+
+  postPatch = ''
+    sed -i -E '/(_OUTPUT_DIRECTORY|DESTINATION)/s|\bout/||g' CMakeLists.txt
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    qttools
+    wrapQtAppsHook
+  ];
+
+  buildInputs = [
+    boost_static
+    qtbase
+  ];
+
+  doCheck = true;
+  checkPhase = ''
+    runHook preCheck
+
+    (
+      cd tests/out/bin
+
+      # provide qtimageformats plugin to allow tests to read tiff files
+      export QT_PLUGIN_PATH="${qtimageformats}/${qtbase.qtPluginPrefix}"
+
+      ./DegateTests
+    )
+
+    runHook postCheck
+  '';
+
+  meta = with lib; {
+    description = "A modern and open-source cross-platform software for chips reverse engineering";
+    homepage = "https://degate.readthedocs.io/";
+    license = licenses.gpl3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ris ];
+  };
+}