forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
freecad: 0.21.2 → 1.0rc2 (NixOS#343592)
- Loading branch information
Showing
3 changed files
with
49 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,43 @@ | ||
From c4f452ef6ae083ed21095313582f6d1bd775cbf3 Mon Sep 17 00:00:00 2001 | ||
From: Andreas Rammhold <[email protected]> | ||
Date: Thu, 2 Nov 2023 17:32:07 +0100 | ||
Subject: [PATCH] NIXOS: don't ignore PYTHONPATH | ||
commit c534a831c2f7186ebabe4e17f1e1df6d11ebff89 | ||
Author: Samuel Rounce <[email protected]> | ||
Date: Thu Sep 5 22:17:21 2024 +0100 | ||
|
||
On NixOS or rather within nixpkgs we provide the runtime Python | ||
packages via the PYTHONPATH environment variable. FreeCAD tries its | ||
best to ignore Python environment variables that are being inherited | ||
from the environment. For Python versions >=3.11 it also tries to | ||
initialize the interpreter config without any environmental data. We | ||
have to initialize the configuration *with* the information from the | ||
environment for our packaging to work. | ||
|
||
Upstream has purposely isolated the environments AFAIK and thus | ||
shouldn't accept this patch (as is). What they might accept (once | ||
support for older Python versions has been dropped) is removing the | ||
PYTHONPATH specific putenv calls. | ||
[PATCH] NIXOS: don't ignore PYTHONPATH | ||
|
||
On NixOS or rather within nixpkgs we provide the runtime Python | ||
packages via the PYTHONPATH environment variable. FreeCAD tries its | ||
best to ignore Python environment variables that are being inherited | ||
from the environment. For Python versions >=3.11 it also tries to | ||
initialize the interpreter config without any environmental data. We | ||
have to initialize the configuration *with* the information from the | ||
environment for our packaging to work. | ||
|
||
Upstream has purposely isolated the environments AFAIK and thus | ||
shouldn't accept this patch (as is). What they might accept (once | ||
support for older Python versions has been dropped) is removing the | ||
PYTHONPATH specific putenv calls. | ||
--- | ||
src/Base/Interpreter.cpp | 2 +- | ||
src/Base/Interpreter.cpp | 1 + | ||
src/Main/MainGui.cpp | 3 --- | ||
2 files changed, 1 insertion(+), 4 deletions(-) | ||
2 files changed, 1 insertion(+), 3 deletions(-) | ||
|
||
diff --git a/src/Base/Interpreter.cpp b/src/Base/Interpreter.cpp | ||
index 52c47168af..9966bd0013 100644 | ||
index 2bdc54ccff..ee4f7fc070 100644 | ||
--- a/src/Base/Interpreter.cpp | ||
+++ b/src/Base/Interpreter.cpp | ||
@@ -554,7 +554,9 @@ void initInterpreter(int argc,char *argv[]) | ||
{ | ||
PyStatus status; | ||
@@ -593,6 +593,7 @@ void initInterpreter(int argc, char* argv[]) | ||
PyConfig config; | ||
PyConfig_InitIsolatedConfig(&config); | ||
+ config.isolated = 0; | ||
config.isolated = 0; | ||
+ config.use_environment = 1; | ||
config.user_site_directory = 1; | ||
|
||
status = PyConfig_SetBytesArgv(&config, argc, argv); | ||
if (PyStatus_Exception(status)) { | ||
diff --git a/src/Main/MainGui.cpp b/src/Main/MainGui.cpp | ||
index 48ae847ef4..28813df383 100644 | ||
index 36087cffd6..89d49d2cc6 100644 | ||
--- a/src/Main/MainGui.cpp | ||
+++ b/src/Main/MainGui.cpp | ||
@@ -112,17 +112,14 @@ int main( int argc, char ** argv ) | ||
@@ -114,10 +114,8 @@ int main(int argc, char** argv) | ||
// See https://forum.freecad.org/viewtopic.php?f=18&t=20600 | ||
// See Gui::Application::runApplication() | ||
putenv("LC_NUMERIC=C"); | ||
|
@@ -49,13 +48,11 @@ index 48ae847ef4..28813df383 100644 | |
#elif defined(__MINGW32__) | ||
const char* mingw_prefix = getenv("MINGW_PREFIX"); | ||
const char* py_home = getenv("PYTHONHOME"); | ||
if (!py_home && mingw_prefix) | ||
@@ -125,7 +123,6 @@ int main(int argc, char** argv) | ||
_putenv_s("PYTHONHOME", mingw_prefix); | ||
} | ||
#else | ||
- _putenv("PYTHONPATH="); | ||
// https://forum.freecad.org/viewtopic.php?f=4&t=18288 | ||
// https://forum.freecad.org/viewtopic.php?f=3&t=20515 | ||
const char* fc_py_home = getenv("FC_PYTHONHOME"); | ||
-- | ||
2.42.0 | ||
|
7 changes: 7 additions & 0 deletions
7
pkgs/by-name/fr/freecad/0002-FreeCad-OndselSolver-pkgconfig.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- a/src/3rdParty/OndselSolver/OndselSolver.pc.in | ||
+++ b/src/3rdParty/OndselSolver/OndselSolver.pc.in | ||
@@ -3,2 +3,2 @@ | ||
-libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ | ||
-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ | ||
+libdir=@CMAKE_INSTALL_LIBDIR@ | ||
+includedir=@CMAKE_INSTALL_INCLUDEDIR@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters