anchor.diff:      "--prefix XDG_DATA_DIRS : ${cups}/share"
       "--prefix GIO_EXTRA_MODULES : ${gnome3.dconf}/lib/gio/modules"
   
  -    "--set KISYSMOD ${kicad-libraries.footprints}/share/kicad/modules"
  -    "--set KICAD_SYMBOL_DIR ${kicad-libraries.symbols}/share/kicad/library"
  -    "--set KICAD_TEMPLATE_DIR ${kicad-libraries.templates}/share/kicad/template"
  -    "--prefix KICAD_TEMPLATE_DIR : ${kicad-libraries.symbols}/share/kicad/template"
  -    "--prefix KICAD_TEMPLATE_DIR : ${kicad-libraries.footprints}/share/kicad/template"
  +    "--set KISYSMOD ${libraries.footprints}/share/kicad/modules"
  +    "--set KICAD_SYMBOL_DIR ${libraries.symbols}/share/kicad/library"
  +    "--set KICAD_TEMPLATE_DIR ${libraries.templates}/share/kicad/template"
  +    "--prefix KICAD_TEMPLATE_DIR : ${libraries.symbols}/share/kicad/template"
  +    "--prefix KICAD_TEMPLATE_DIR : ${libraries.footprints}/share/kicad/template"
     ]
  -  ++ optionals (with3d) [ "--set KISYS3DMOD ${kicad-libraries.packages3d}/share/kicad/modules/packages3d" ]
  +  ++ optionals (with3d) [ "--set KISYS3DMOD ${libraries.packages3d}/share/kicad/modules/packages3d" ]
     ++ optionals (ngspiceSupport) [ "--prefix LD_LIBRARY_PATH : ${libngspice}/lib" ]
   
     # infinisil's workaround for #39493
  
positive.code: 
    # dunno why i have to add $makeWrapperArgs manually...
    # $out and $program_PYTHONPATH don't exist when makeWrapperArgs gets set?
    # not sure if anything has to be done with the other stuff in kicad-base/bin
    # dxf2idf, idf2vrml, idfcyl, idfrect, kicad2step, kicad-ogltest
    installPhase =
      optionalString (scriptingSupport) '' buildPythonPath "${kicad-base} $pythonPath"
      '' +
      '' makeWrapper ${kicad-base}/bin/kicad $out/bin/kicad $makeWrapperArgs ''
      + optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH"
      '' +
      '' makeWrapper ${kicad-base}/bin/pcbnew $out/bin/pcbnew $makeWrapperArgs ''
      + optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH"
      '' +
      '' makeWrapper ${kicad-base}/bin/eeschema $out/bin/eeschema $makeWrapperArgs ''
      + optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH"
      '' +
      '' makeWrapper ${kicad-base}/bin/gerbview $out/bin/gerbview $makeWrapperArgs ''
      + optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH"
      '' +
      '' makeWrapper ${kicad-base}/bin/pcb_calculator $out/bin/pcb_calculator $makeWrapperArgs ''
      + optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH"
      '' +
      '' makeWrapper ${kicad-base}/bin/pl_editor $out/bin/pl_editor $makeWrapperArgs ''
      + optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH"
      '' +
      '' makeWrapper ${kicad-base}/bin/bitmap2component $out/bin/bitmap2component $makeWrapperArgs ''
      + optionalString (scriptingSupport) '' --set PYTHONPATH "$program_PYTHONPATH"
      ''
    ;
  
negative.code:   python = python3;
    wxPython = python3Packages.wxPython_4_0;
  
    libraries = callPackages ./libraries.nix versionConfig.libVersion;
    base = callPackage ./base.nix {
      pname = baseName;
      inherit versions stable baseName;
      inherit wxGTK python wxPython;
  