diff options
Diffstat (limited to 'pkgs/applications/science')
3 files changed, 64 insertions, 8 deletions
diff --git a/pkgs/applications/science/electronics/kicad/base.nix b/pkgs/applications/science/electronics/kicad/base.nix index 5a257e26d2627..d7250db07b491 100644 --- a/pkgs/applications/science/electronics/kicad/base.nix +++ b/pkgs/applications/science/electronics/kicad/base.nix @@ -33,6 +33,7 @@ , dbus , at-spi2-core , libXtst +, pcre2 , swig4 , python @@ -67,6 +68,11 @@ stdenv.mkDerivation rec { src = kicadSrc; + patches = [ + # upstream issue 12941 (attempted to upstream, but appreciably unacceptable) + ./writable.patch + ]; + # tagged releases don't have "unknown" # kicad nightlies use git describe --dirty # nix removes .git, so its approximated here @@ -114,6 +120,9 @@ stdenv.mkDerivation rec { ] ++ optionals (!withPCM && stable) [ "-DKICAD_PCM=OFF" + ] + ++ optionals (!stable) [ # upstream issue 12491 + "-DCMAKE_CTEST_ARGUMENTS='--exclude-regex;qa_eeschema'" ]; nativeBuildInputs = [ @@ -136,6 +145,7 @@ stdenv.mkDerivation rec { dbus at-spi2-core libXtst + pcre2 ]; buildInputs = [ @@ -162,14 +172,10 @@ stdenv.mkDerivation rec { ++ optional (withScripting) wxPython ++ optional (withNgspice) libngspice ++ optional (withOCC) opencascade-occt - ++ optional (debug) valgrind - ; - - # started becoming necessary halfway into 2022, not sure what changed to break a test... - preInstallCheck = optionals (withNgspice) [ "export LD_LIBRARY_PATH=${libngspice}/lib" ]; + ++ optional (debug) valgrind; # debug builds fail all but the python test - doInstallCheck = !(!stable || debug); + doInstallCheck = !(debug); installCheckTarget = "test"; dontStrip = debug; diff --git a/pkgs/applications/science/electronics/kicad/default.nix b/pkgs/applications/science/electronics/kicad/default.nix index 1540e3bdb6960..6aeb63d671148 100644 --- a/pkgs/applications/science/electronics/kicad/default.nix +++ b/pkgs/applications/science/electronics/kicad/default.nix @@ -138,8 +138,7 @@ stdenv.mkDerivation rec { ++ optionals (withScripting) [ python.pkgs.wrapPython ]; - # We are emulating wrapGAppsHook, along with other variables to the - # wrapper + # We are emulating wrapGAppsHook, along with other variables to the wrapper makeWrapperArgs = with passthru.libraries; [ "--prefix XDG_DATA_DIRS : ${base}/share" "--prefix XDG_DATA_DIRS : ${hicolor-icon-theme}/share" @@ -231,5 +230,7 @@ stdenv.mkDerivation rec { # 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 + + mainProgram = "kicad"; }; } diff --git a/pkgs/applications/science/electronics/kicad/writable.patch b/pkgs/applications/science/electronics/kicad/writable.patch new file mode 100644 index 0000000000000..a2969f26f43ba --- /dev/null +++ b/pkgs/applications/science/electronics/kicad/writable.patch @@ -0,0 +1,49 @@ +commit 6a72fd032405515e468797be91b5a6ebcbbb5fd8 +Author: Evils <evils.devils@protonmail.com> +Date: Wed Nov 23 19:49:13 2022 +0100 + + ensure new projects are writable + +diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp +index 7ee8090858..391514519c 100644 +--- a/kicad/kicad_manager_frame.cpp ++++ b/kicad/kicad_manager_frame.cpp +@@ -638,6 +638,12 @@ void KICAD_MANAGER_FRAME::CreateNewProject( const wxFileName& aProjectFileName, + + // wxFFile dtor will close the file + } ++ ++ if( destFileName.IsOk() && !destFileName.IsFileWritable() ) ++ { ++ destFileName.SetPermissions(0644); ++ } ++ + } + } + +diff --git a/kicad/project_template.cpp b/kicad/project_template.cpp +index bf951fcddb..2bef94326b 100644 +--- a/kicad/project_template.cpp ++++ b/kicad/project_template.cpp +@@ -282,6 +282,21 @@ bool PROJECT_TEMPLATE::CreateProject( wxFileName& aNewProjectPath, wxString* aEr + + result = false; + } ++ else if( !destFile.IsFileWritable() && !destFile.SetPermissions(0644) ) ++ { ++ if( aErrorMsg ) ++ { ++ if( !aErrorMsg->empty() ) ++ *aErrorMsg += "\n"; ++ ++ wxString msg; ++ ++ msg.Printf( _( "Cannot make file writable: '%s'." ), destFile.GetFullPath() ); ++ *aErrorMsg += msg; ++ } ++ ++ result = false; ++ } + } + + return result; |