Merge pull request #199733 from wegank/kicad-darwin

kicad.base: expose binaries on darwin
This commit is contained in:
Weijia Wang 2023-01-29 09:07:52 +01:00 committed by GitHub
commit 14bfe4fa4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,7 +15,7 @@
, pname ? "kicad"
, stable ? true
, withOCC ? true
, withNgspice ? true
, withNgspice ? !stdenv.isDarwin
, libngspice
, withScripting ? true
, python3
@ -170,6 +170,7 @@ stdenv.mkDerivation rec {
# $out and $program_PYTHONPATH don't exist when makeWrapperArgs gets set?
installPhase =
let
bin = if stdenv.isDarwin then "*.app/Contents/MacOS" else "bin";
tools = [ "kicad" "pcbnew" "eeschema" "gerbview" "pcb_calculator" "pl_editor" "bitmap2component" ];
utils = [ "dxf2idf" "idf2vrml" "idfcyl" "idfrect" "kicad2step" ];
in
@ -181,13 +182,13 @@ stdenv.mkDerivation rec {
# wrap each of the directly usable tools
(map
(tool: "makeWrapper ${base}/bin/${tool} $out/bin/${tool} $makeWrapperArgs"
(tool: "makeWrapper ${base}/${bin}/${tool} $out/bin/${tool} $makeWrapperArgs"
+ optionalString (withScripting) " --set PYTHONPATH \"$program_PYTHONPATH\""
)
tools)
# link in the CLI utils
(map (util: "ln -s ${base}/bin/${util} $out/bin/${util}") utils)
(map (util: "ln -s ${base}/${bin}/${util} $out/bin/${util}") utils)
"runHook postInstall"
])