From 1aecbe43bad52c74b9bd1fd9a7a6cc7ccc5b5fe1 Mon Sep 17 00:00:00 2001 From: Juergen Fitschen Date: Sat, 7 Oct 2023 23:06:22 +0200 Subject: [PATCH 1/3] maintainers: add jue89 --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 068b1ad3d798..91a7128ca40d 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -8704,6 +8704,12 @@ githubId = 1189739; name = "Julio Borja Barra"; }; + jue89 = { + email = "me@jue.yt"; + github = "jue89"; + githubId = 6105784; + name = "Juergen Fitschen"; + }; jugendhacker = { name = "j.r"; email = "j.r@jugendhacker.de"; From f203901b4f1dd85920efdfeda801b54778186f0f Mon Sep 17 00:00:00 2001 From: Juergen Fitschen Date: Wed, 18 Oct 2023 23:23:59 +0200 Subject: [PATCH 2/3] horizon-eda: clarify package license Source: https://github.com/horizon-eda/horizon/blob/v2.5.0/org.horizon_eda.HorizonEDA.metainfo.xml#L6 --- pkgs/applications/science/electronics/horizon-eda/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/science/electronics/horizon-eda/default.nix b/pkgs/applications/science/electronics/horizon-eda/default.nix index c4c1e798dd51..486b3924d9a8 100644 --- a/pkgs/applications/science/electronics/horizon-eda/default.nix +++ b/pkgs/applications/science/electronics/horizon-eda/default.nix @@ -69,7 +69,7 @@ stdenv.mkDerivation rec { description = "A free EDA software to develop printed circuit boards"; homepage = "https://horizon-eda.org"; maintainers = with maintainers; [ guserav ]; - license = licenses.gpl3; + license = licenses.gpl3Plus; platforms = platforms.linux; }; } From 4c620881013665ce47bcc9d33573453726b035e0 Mon Sep 17 00:00:00 2001 From: Juergen Fitschen Date: Sat, 7 Oct 2023 23:06:56 +0200 Subject: [PATCH 3/3] python311Packages.horizon-eda: init at 2.5.0 --- .../science/electronics/horizon-eda/base.nix | 58 ++++++++++++++++++ .../electronics/horizon-eda/default.nix | 59 ++++--------------- .../python-modules/horizon-eda/default.nix | 46 +++++++++++++++ pkgs/top-level/python-packages.nix | 4 ++ 4 files changed, 119 insertions(+), 48 deletions(-) create mode 100644 pkgs/applications/science/electronics/horizon-eda/base.nix create mode 100644 pkgs/development/python-modules/horizon-eda/default.nix 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 000000000000..8ce75a6ce241 --- /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 486b3924d9a8..1fbc92f06115 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.gpl3Plus; - platforms = platforms.linux; - }; } diff --git a/pkgs/development/python-modules/horizon-eda/default.nix b/pkgs/development/python-modules/horizon-eda/default.nix new file mode 100644 index 000000000000..d2385e190e77 --- /dev/null +++ b/pkgs/development/python-modules/horizon-eda/default.nix @@ -0,0 +1,46 @@ +{ lib +, stdenv +, buildPythonPackage +, callPackage +, horizon-eda +, mesa +, pycairo +, python +, pythonOlder +}: + +let + base = horizon-eda.passthru.base; +in +buildPythonPackage { + inherit (base) pname version src meta CASROOT; + + pyproject = false; + + disabled = pythonOlder "3.9"; + + buildInputs = base.buildInputs ++ [ + mesa + mesa.osmesa + python + ]; + + propagatedBuildInputs = [ + pycairo + ]; + + nativeBuildInputs = base.nativeBuildInputs; + + buildFlags = ["pymodule"]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/${python.sitePackages} + cp build/horizon.so $out/${python.sitePackages} + + runHook postInstall + ''; + + enableParallelBuilding = true; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7c6c4a501771..5348fa00e646 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4993,6 +4993,10 @@ self: super: with self; { hopcroftkarp = callPackage ../development/python-modules/hopcroftkarp { }; + horizon-eda = callPackage ../development/python-modules/horizon-eda { + inherit (pkgs) horizon-eda mesa; + }; + howdoi = callPackage ../development/python-modules/howdoi { }; hpack = callPackage ../development/python-modules/hpack { };