about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorEvils <evils.devils@protonmail.com>2020-03-28 01:39:57 +0100
committerEvils <evils.devils@protonmail.com>2020-05-07 01:54:50 +0200
commit95e4e33bdfd03adce366f09b5cd7db4ee9e86a91 (patch)
treeb5cdd3d416abf62e48d73ea28d51f5379d13969c /pkgs/applications
parent18a1b153ac9039b3cad1b69b5b437ffd56478b30 (diff)
downloadnixlib-95e4e33bdfd03adce366f09b5cd7db4ee9e86a91.tar
nixlib-95e4e33bdfd03adce366f09b5cd7db4ee9e86a91.tar.gz
nixlib-95e4e33bdfd03adce366f09b5cd7db4ee9e86a91.tar.bz2
nixlib-95e4e33bdfd03adce366f09b5cd7db4ee9e86a91.tar.lz
nixlib-95e4e33bdfd03adce366f09b5cd7db4ee9e86a91.tar.xz
nixlib-95e4e33bdfd03adce366f09b5cd7db4ee9e86a91.tar.zst
nixlib-95e4e33bdfd03adce366f09b5cd7db4ee9e86a91.zip
kicad-unstable-small: init to make kicad-unstable
the -small packages depend on all hydra buildable dependencies
the non-small ones depend on packages3d which exceeds hydra's limit

set platforms to all (kicad is cross-platform)
clarify package differences in the description

set maintainers on just the top level derivation

switch -unstable to not save debug symbols

indicate patch in version string

note broken dependencies
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/science/electronics/kicad/base.nix7
-rw-r--r--pkgs/applications/science/electronics/kicad/default.nix33
-rw-r--r--pkgs/applications/science/electronics/kicad/libraries.nix39
3 files changed, 49 insertions, 30 deletions
diff --git a/pkgs/applications/science/electronics/kicad/base.nix b/pkgs/applications/science/electronics/kicad/base.nix
index b3e4bf92f7b8..9fc1111c7b95 100644
--- a/pkgs/applications/science/electronics/kicad/base.nix
+++ b/pkgs/applications/science/electronics/kicad/base.nix
@@ -56,9 +56,11 @@ stdenv.mkDerivation rec {
   # tagged releases don't have "unknown"
   # kicad nightlies use git describe --dirty
   # nix removes .git, so its approximated here
+  # "-1" appended to indicate we're adding a patch
   postPatch = ''
     substituteInPlace CMakeModules/KiCadVersion.cmake \
-      --replace "unknown" ${builtins.substring 0 10 src.rev}
+      --replace "unknown" "${builtins.substring 0 10 src.rev}-1" \
+      --replace "${version}" "${version}-1"
   '';
 
   makeFlags = optional (debug) [ "CFLAGS+=-Og" "CFLAGS+=-ggdb" ];
@@ -123,7 +125,6 @@ stdenv.mkDerivation rec {
     '';
     homepage = "https://www.kicad-pcb.org/";
     license = licenses.agpl3;
-    maintainers = with maintainers; [ evils kiwi berce ];
-    platforms = with platforms; linux;
+    platforms = platforms.all;
   };
 }
diff --git a/pkgs/applications/science/electronics/kicad/default.nix b/pkgs/applications/science/electronics/kicad/default.nix
index 221dbaf9287d..51ec1dad8aa3 100644
--- a/pkgs/applications/science/electronics/kicad/default.nix
+++ b/pkgs/applications/science/electronics/kicad/default.nix
@@ -4,6 +4,7 @@
 , librsvg, cups
 
 , pname ? "kicad"
+, stable ? true
 , oceSupport ? false, opencascade
 , withOCCT ? true, opencascade-occt
 , ngspiceSupport ? true, libngspice
@@ -18,7 +19,6 @@ assert ngspiceSupport -> libngspice != null;
 with lib;
 let
 
-  stable = pname != "kicad-unstable";
   baseName = if (stable) then "kicad" else "kicad-unstable";
 
   versions =  import ./versions.nix;
@@ -122,10 +122,11 @@ stdenv.mkDerivation rec {
   # and can't git commit if this could be running in parallel with other scripts
   passthru.updateScript = [ ./update.sh "all" ];
 
-  meta = {
-    description = if (stable)
-      then "Open Source Electronics Design Automation Suite"
-      else "Open Source EDA Suite, Development Build";
+  meta = rec {
+    description = (if (stable)
+      then "Open Source Electronics Design Automation suite"
+      else "Open Source EDA suite, development build")
+      + (if (!with3d) then ", without 3D models" else "");
     homepage = "https://www.kicad-pcb.org/";
     longDescription = ''
       KiCad is an open source software suite for Electronic Design Automation.
@@ -133,12 +134,20 @@ stdenv.mkDerivation rec {
     '';
     license = licenses.agpl3;
     # berce seems inactive...
-    maintainers = with maintainers; [ evils kiwi berce ];
-    # kicad's cross-platform, not sure what to fill in here
-    platforms = with platforms; linux;
-  } // optionalAttrs with3d {
-    # We can't download the 3d models on Hydra - they are a ~1 GiB download and
-    # they occupy ~5 GiB in store.
-    hydraPlatforms = [];
+    maintainers = with stdenv.lib.maintainers; [ evils kiwi berce ];
+    # kicad is cross platform
+    platforms = stdenv.lib.platforms.all;
+    # despite that, nipkgs' wxGTK for darwin is "wxmac"
+    # and wxPython_4_0 does not account for this
+    # adjusting this package to downgrade to python2Packages.wxPython (wxPython 3),
+    # seems like more trouble than fixing wxPython_4_0 would be
+    # additionally, libngspice is marked as linux only, though it should support darwin
+
+    hydraPlatforms = if (with3d) then [ ] else platforms;
+    # We can't download the 3d models on Hydra,
+    # they are a ~1 GiB download and they occupy ~5 GiB in store.
+    # as long as the base and libraries (minus 3d) are build,
+    # this wrapper does not need to get built
+    # the kicad-*small "packages" cause this to happen
   };
 }
diff --git a/pkgs/applications/science/electronics/kicad/libraries.nix b/pkgs/applications/science/electronics/kicad/libraries.nix
index 7cdf9373e087..4dde2a0a1226 100644
--- a/pkgs/applications/science/electronics/kicad/libraries.nix
+++ b/pkgs/applications/science/electronics/kicad/libraries.nix
@@ -13,21 +13,27 @@
 with lib;
 let
   mkLib = name:
-    stdenv.mkDerivation
-      {
-        pname = "kicad-${name}";
-        version = "${version}";
-        src = fetchFromGitHub (
-          {
-            owner = "KiCad";
-            repo = "kicad-${name}";
-            rev = version;
-            inherit name;
-          } // (libSources.${name} or { })
-        );
-        nativeBuildInputs = [ cmake ];
-        meta.license = licenses.cc-by-sa-40;
+    stdenv.mkDerivation {
+      pname = "kicad-${name}";
+      version = "${version}";
+      src = fetchFromGitHub (
+        {
+          owner = "KiCad";
+          repo = "kicad-${name}";
+          rev = version;
+          inherit name;
+        } // (libSources.${name} or { })
+      );
+      nativeBuildInputs = [ cmake ];
+
+      meta = rec {
+        license = licenses.cc-by-sa-40;
+        platforms = stdenv.lib.platforms.all;
+        # the 3d models are a ~1 GiB download and occupy ~5 GiB in store.
+        # this would exceed the hydra output limit
+        hydraPlatforms = if (name == "packages3d" ) then [ ] else platforms;
       };
+    };
 in
 {
   symbols = mkLib "symbols";
@@ -56,6 +62,9 @@ in
       );
       buildInputs = [ gettext ];
       nativeBuildInputs = [ cmake ];
-      meta.license = licenses.gpl2; # https://github.com/KiCad/kicad-i18n/issues/3
+      meta = {
+        license = licenses.gpl2; # https://github.com/KiCad/kicad-i18n/issues/3
+        platforms = stdenv.lib.platforms.all;
+      };
     };
 }