Loading maintainers/maintainer-list.nix +15 −0 Original line number Diff line number Diff line Loading @@ -8295,6 +8295,15 @@ githubId = 18501; name = "Julien Langlois"; }; jfly = { name = "Jeremy Fleischman"; email = "jeremyfleischman@gmail.com"; github = "jfly"; githubId = 277474; keys = [{ fingerprint = "F1F1 3395 8E8E 9CC4 D9FC 9647 1931 9CD8 416A 642B"; }]; }; jfrankenau = { email = "johannes@frankenau.net"; github = "jfrankenau"; Loading Loading @@ -11209,6 +11218,12 @@ githubId = 11810057; name = "Matt Snider"; }; matusf = { email = "matus.ferech@gmail.com"; github = "matusf"; githubId = 18228995; name = "Matúš Ferech"; }; maurer = { email = "matthew.r.maurer+nix@gmail.com"; github = "maurer"; Loading pkgs/applications/science/electronics/kicad/addons/default.nix 0 → 100644 +5 −0 Original line number Diff line number Diff line { kicad }: { kikit = kicad.callPackage ./kikit.nix { addonName = "kikit"; }; kikit-library = kicad.callPackage ./kikit.nix { addonName = "kikit-library"; }; } pkgs/applications/science/electronics/kicad/addons/kikit.nix 0 → 100644 +52 −0 Original line number Diff line number Diff line # For building the multiple addons that are in the kikit repo. { stdenv , bc , kikit , zip , python3 , addonName , addonPath }: let # This python is only used when building the package, it's not the python # environment that will ultimately run the code packaged here. The python env defined # in KiCad will import the python code packaged here when KiCad starts up. python = python3.withPackages (ps: with ps; [ click ]); kikit-module = python3.pkgs.toPythonModule (kikit.override { inherit python3; }); # The following different addons can be built from the same source. targetSpecs = { "kikit" = { makeTarget = "pcm-kikit"; resultZip = "pcm-kikit.zip"; description = "KiCad plugin and a CLI tool to automate several tasks in a standard KiCad workflow"; }; "kikit-library" = { makeTarget = "pcm-lib"; resultZip = "pcm-kikit-lib.zip"; description = "KiKit uses these symbols and footprints to annotate your boards (e.g., to place a tab in a panel)."; }; }; targetSpec = targetSpecs.${addonName}; in stdenv.mkDerivation { name = "kicadaddon-${addonName}"; inherit (kikit-module) src version; nativeBuildInputs = [ python bc zip ]; propagatedBuildInputs = [ kikit-module ]; buildPhase = '' patchShebangs scripts/setJson.py make ${targetSpec.makeTarget} ''; installPhase = '' mkdir $out mv build/${targetSpec.resultZip} $out/${addonPath} ''; meta = kikit-module.meta // { description = targetSpec.description; }; } pkgs/applications/science/electronics/kicad/base.nix +2 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,8 @@ stdenv.mkDerivation rec { patches = [ # upstream issue 12941 (attempted to upstream, but appreciably unacceptable) ./writable.patch # https://gitlab.com/kicad/code/kicad/-/issues/15687 ./runtime_stock_data_path.patch ]; # tagged releases don't have "unknown" Loading pkgs/applications/science/electronics/kicad/default.nix +52 −1 Original line number Diff line number Diff line { lib, stdenv , runCommand , newScope , fetchFromGitLab , gnome , dconf Loading @@ -11,6 +13,8 @@ , callPackages , librsvg , cups , unzip , jq , pname ? "kicad" , stable ? true Loading @@ -18,6 +22,7 @@ , libngspice , withScripting ? true , python3 , addons ? [ ] , debug ? false , sanitizeAddress ? false , sanitizeThreads ? false Loading @@ -27,6 +32,14 @@ , symlinkJoin }: # `addons`: https://dev-docs.kicad.org/en/addons/ # # ```nix # kicad = pkgs.kicad.override { # addons = with pkgs.kicadAddons; [ kikit kikit-library ]; # }; # ``` # The `srcs` parameter can be used to override the kicad source code # and all libraries, which are otherwise inaccessible # to overlays since most of the kicad build expression has been Loading Loading @@ -106,6 +119,32 @@ let wxGTK = wxGTK32; python = python3; wxPython = python.pkgs.wxPython_4_2; addonPath = "addon.zip"; addonsDrvs = map (pkg: pkg.override { inherit addonPath python3; }) addons; addonsJoined = runCommand "addonsJoined" { inherit addonsDrvs; nativeBuildInputs = [ unzip jq ]; } '' mkdir $out for pkg in $addonsDrvs; do unzip $pkg/addon.zip -d unpacked folder_name=$(jq .identifier unpacked/metadata.json --raw-output | tr . _) for d in unpacked/*; do if [ -d "$d" ]; then dest=$out/share/kicad/scripting/$(basename $d)/$folder_name mkdir -p $(dirname $dest) mv $d $dest fi done rm -r unpacked done ''; inherit (lib) concatStringsSep flatten optionalString optionals; in Loading @@ -113,6 +152,7 @@ stdenv.mkDerivation rec { # Common libraries, referenced during runtime, via the wrapper. passthru.libraries = callPackages ./libraries.nix { inherit libSrc; }; passthru.callPackage = newScope { inherit addonPath python3; }; base = callPackage ./base.nix { inherit stable baseName; inherit kicadSrc kicadVersion; Loading @@ -131,7 +171,7 @@ stdenv.mkDerivation rec { dontFixup = true; pythonPath = optionals (withScripting) [ wxPython python.pkgs.six python.pkgs.requests ]; [ wxPython python.pkgs.six python.pkgs.requests ] ++ addonsDrvs; nativeBuildInputs = [ makeWrapper ] ++ optionals (withScripting) Loading Loading @@ -164,6 +204,17 @@ stdenv.mkDerivation rec { "--set-default KICAD7_SYMBOL_DIR ${symbols}/share/kicad/symbols" "--set-default KICAD7_TEMPLATE_DIR ${template_dir}" ] ++ optionals (addons != [ ]) ( let stockDataPath = symlinkJoin { name = "kicad_stock_data_path"; paths = [ "${base}/share/kicad" "${addonsJoined}/share/kicad" ]; }; in [ "--set-default NIX_KICAD7_STOCK_DATA_PATH ${stockDataPath}" ] ) ++ optionals (with3d) [ "--set-default KICAD7_3DMODEL_DIR ${packages3d}/share/kicad/3dmodels" Loading Loading
maintainers/maintainer-list.nix +15 −0 Original line number Diff line number Diff line Loading @@ -8295,6 +8295,15 @@ githubId = 18501; name = "Julien Langlois"; }; jfly = { name = "Jeremy Fleischman"; email = "jeremyfleischman@gmail.com"; github = "jfly"; githubId = 277474; keys = [{ fingerprint = "F1F1 3395 8E8E 9CC4 D9FC 9647 1931 9CD8 416A 642B"; }]; }; jfrankenau = { email = "johannes@frankenau.net"; github = "jfrankenau"; Loading Loading @@ -11209,6 +11218,12 @@ githubId = 11810057; name = "Matt Snider"; }; matusf = { email = "matus.ferech@gmail.com"; github = "matusf"; githubId = 18228995; name = "Matúš Ferech"; }; maurer = { email = "matthew.r.maurer+nix@gmail.com"; github = "maurer"; Loading
pkgs/applications/science/electronics/kicad/addons/default.nix 0 → 100644 +5 −0 Original line number Diff line number Diff line { kicad }: { kikit = kicad.callPackage ./kikit.nix { addonName = "kikit"; }; kikit-library = kicad.callPackage ./kikit.nix { addonName = "kikit-library"; }; }
pkgs/applications/science/electronics/kicad/addons/kikit.nix 0 → 100644 +52 −0 Original line number Diff line number Diff line # For building the multiple addons that are in the kikit repo. { stdenv , bc , kikit , zip , python3 , addonName , addonPath }: let # This python is only used when building the package, it's not the python # environment that will ultimately run the code packaged here. The python env defined # in KiCad will import the python code packaged here when KiCad starts up. python = python3.withPackages (ps: with ps; [ click ]); kikit-module = python3.pkgs.toPythonModule (kikit.override { inherit python3; }); # The following different addons can be built from the same source. targetSpecs = { "kikit" = { makeTarget = "pcm-kikit"; resultZip = "pcm-kikit.zip"; description = "KiCad plugin and a CLI tool to automate several tasks in a standard KiCad workflow"; }; "kikit-library" = { makeTarget = "pcm-lib"; resultZip = "pcm-kikit-lib.zip"; description = "KiKit uses these symbols and footprints to annotate your boards (e.g., to place a tab in a panel)."; }; }; targetSpec = targetSpecs.${addonName}; in stdenv.mkDerivation { name = "kicadaddon-${addonName}"; inherit (kikit-module) src version; nativeBuildInputs = [ python bc zip ]; propagatedBuildInputs = [ kikit-module ]; buildPhase = '' patchShebangs scripts/setJson.py make ${targetSpec.makeTarget} ''; installPhase = '' mkdir $out mv build/${targetSpec.resultZip} $out/${addonPath} ''; meta = kikit-module.meta // { description = targetSpec.description; }; }
pkgs/applications/science/electronics/kicad/base.nix +2 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,8 @@ stdenv.mkDerivation rec { patches = [ # upstream issue 12941 (attempted to upstream, but appreciably unacceptable) ./writable.patch # https://gitlab.com/kicad/code/kicad/-/issues/15687 ./runtime_stock_data_path.patch ]; # tagged releases don't have "unknown" Loading
pkgs/applications/science/electronics/kicad/default.nix +52 −1 Original line number Diff line number Diff line { lib, stdenv , runCommand , newScope , fetchFromGitLab , gnome , dconf Loading @@ -11,6 +13,8 @@ , callPackages , librsvg , cups , unzip , jq , pname ? "kicad" , stable ? true Loading @@ -18,6 +22,7 @@ , libngspice , withScripting ? true , python3 , addons ? [ ] , debug ? false , sanitizeAddress ? false , sanitizeThreads ? false Loading @@ -27,6 +32,14 @@ , symlinkJoin }: # `addons`: https://dev-docs.kicad.org/en/addons/ # # ```nix # kicad = pkgs.kicad.override { # addons = with pkgs.kicadAddons; [ kikit kikit-library ]; # }; # ``` # The `srcs` parameter can be used to override the kicad source code # and all libraries, which are otherwise inaccessible # to overlays since most of the kicad build expression has been Loading Loading @@ -106,6 +119,32 @@ let wxGTK = wxGTK32; python = python3; wxPython = python.pkgs.wxPython_4_2; addonPath = "addon.zip"; addonsDrvs = map (pkg: pkg.override { inherit addonPath python3; }) addons; addonsJoined = runCommand "addonsJoined" { inherit addonsDrvs; nativeBuildInputs = [ unzip jq ]; } '' mkdir $out for pkg in $addonsDrvs; do unzip $pkg/addon.zip -d unpacked folder_name=$(jq .identifier unpacked/metadata.json --raw-output | tr . _) for d in unpacked/*; do if [ -d "$d" ]; then dest=$out/share/kicad/scripting/$(basename $d)/$folder_name mkdir -p $(dirname $dest) mv $d $dest fi done rm -r unpacked done ''; inherit (lib) concatStringsSep flatten optionalString optionals; in Loading @@ -113,6 +152,7 @@ stdenv.mkDerivation rec { # Common libraries, referenced during runtime, via the wrapper. passthru.libraries = callPackages ./libraries.nix { inherit libSrc; }; passthru.callPackage = newScope { inherit addonPath python3; }; base = callPackage ./base.nix { inherit stable baseName; inherit kicadSrc kicadVersion; Loading @@ -131,7 +171,7 @@ stdenv.mkDerivation rec { dontFixup = true; pythonPath = optionals (withScripting) [ wxPython python.pkgs.six python.pkgs.requests ]; [ wxPython python.pkgs.six python.pkgs.requests ] ++ addonsDrvs; nativeBuildInputs = [ makeWrapper ] ++ optionals (withScripting) Loading Loading @@ -164,6 +204,17 @@ stdenv.mkDerivation rec { "--set-default KICAD7_SYMBOL_DIR ${symbols}/share/kicad/symbols" "--set-default KICAD7_TEMPLATE_DIR ${template_dir}" ] ++ optionals (addons != [ ]) ( let stockDataPath = symlinkJoin { name = "kicad_stock_data_path"; paths = [ "${base}/share/kicad" "${addonsJoined}/share/kicad" ]; }; in [ "--set-default NIX_KICAD7_STOCK_DATA_PATH ${stockDataPath}" ] ) ++ optionals (with3d) [ "--set-default KICAD7_3DMODEL_DIR ${packages3d}/share/kicad/3dmodels" Loading