kicad.base: expose binaries on darwin

This commit is contained in:
Weijia Wang 2023-01-29 08:19:58 +01:00
parent 4ed11a5c79
commit e35fa37cfc

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"
])