about summary refs log tree commit diff
path: root/pkgs/applications/science
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-10-19 00:02:21 +0000
committerGitHub <noreply@github.com>2023-10-19 00:02:21 +0000
commit4b9cf6ff6eebded20718a58eeb06fbdda16b2521 (patch)
tree4f2c1bb17be3df919fdf53e0134b378819f1c0b5 /pkgs/applications/science
parentd8653dfb4c86329abf022f5c41d935689d7818e3 (diff)
parent1ae1ab8d01d53806bfaf96beddd86776d9cd205e (diff)
Merge master into staging-next
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r--pkgs/applications/science/electronics/horizon-eda/base.nix58
-rw-r--r--pkgs/applications/science/electronics/horizon-eda/default.nix59
2 files changed, 69 insertions, 48 deletions
diff --git a/pkgs/applications/science/electronics/horizon-eda/base.nix b/pkgs/applications/science/electronics/horizon-eda/base.nix
new file mode 100644
index 0000000000000..8ce75a6ce241b
--- /dev/null
+++ b/pkgs/applications/science/electronics/horizon-eda/base.nix
@@ -0,0 +1,58 @@
+{ lib
+, cppzmq
+, curl
+, fetchFromGitHub
+, glm
+, gtkmm3
+, libarchive
+, libepoxy
+, libgit2
+, librsvg
+, libuuid
+, opencascade-occt
+, pkg-config
+, podofo
+, sqlite
+}:
+
+# This base is used in horizon-eda and python3Packages.horizon-eda
+rec {
+  pname = "horizon-eda";
+  version = "2.5.0";
+
+  src = fetchFromGitHub {
+    owner = "horizon-eda";
+    repo = "horizon";
+    rev = "v${version}";
+    hash = "sha256-UcjbDJR6shyETpanNkRoH8LF8r6gFjsyNHVSCMHKqS8=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  buildInputs = [
+    cppzmq
+    curl
+    glm
+    gtkmm3
+    libarchive
+    libepoxy
+    libgit2
+    librsvg
+    libuuid
+    opencascade-occt
+    podofo
+    sqlite
+  ];
+
+  CASROOT = opencascade-occt;
+
+  meta = with lib; {
+    description = "A free EDA software to develop printed circuit boards";
+    homepage = "https://horizon-eda.org";
+    maintainers = with maintainers; [ guserav jue89 ];
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/science/electronics/horizon-eda/default.nix b/pkgs/applications/science/electronics/horizon-eda/default.nix
index c4c1e798dd51c..1fbc92f06115f 100644
--- a/pkgs/applications/science/electronics/horizon-eda/default.nix
+++ b/pkgs/applications/science/electronics/horizon-eda/default.nix
@@ -1,62 +1,33 @@
 { stdenv
 , boost
+, callPackage
 , coreutils
-, cppzmq
-, curl
-, libepoxy
-, fetchFromGitHub
-, glm
-, gtkmm3
-, lib
-, libarchive
-, libgit2
-, librsvg
 , libspnav
-, libuuid
-, opencascade-occt
-, pkg-config
-, podofo
 , python3
-, sqlite
 , wrapGAppsHook
 }:
 
+let
+  base = callPackage ./base.nix { };
+in
 stdenv.mkDerivation rec {
-  pname = "horizon-eda";
-  version = "2.5.0";
+  inherit (base) pname version src meta CASROOT;
 
-  src = fetchFromGitHub {
-    owner = "horizon-eda";
-    repo = "horizon";
-    rev = "v${version}";
-    sha256 = "sha256-UcjbDJR6shyETpanNkRoH8LF8r6gFjsyNHVSCMHKqS8=";
+  # provide base for python module
+  passthru = {
+    inherit base;
   };
 
-  buildInputs = [
-    cppzmq
-    curl
-    libepoxy
-    glm
-    gtkmm3
-    libarchive
-    libgit2
-    librsvg
+  buildInputs = base.buildInputs ++ [
     libspnav
-    libuuid
-    opencascade-occt
-    podofo
-    python3
-    sqlite
   ];
 
-  nativeBuildInputs = [
+  nativeBuildInputs = base.nativeBuildInputs ++ [
     boost.dev
-    pkg-config
     wrapGAppsHook
+    python3
   ];
 
-  CASROOT = opencascade-occt;
-
   installFlags = [
     "INSTALL=${coreutils}/bin/install"
     "DESTDIR=$(out)"
@@ -64,12 +35,4 @@ stdenv.mkDerivation rec {
   ];
 
   enableParallelBuilding = true;
-
-  meta = with lib; {
-    description = "A free EDA software to develop printed circuit boards";
-    homepage = "https://horizon-eda.org";
-    maintainers = with maintainers; [ guserav ];
-    license = licenses.gpl3;
-    platforms = platforms.linux;
-  };
 }