From 69a67fc7cfc8dc12503e84f0fa490a096afe7436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Sat, 5 Mar 2011 22:27:51 +0000 Subject: [PATCH] Trying to make freecad find pyqt. This required a patch to be able to use PYTHONPATH. svn path=/nixpkgs/trunk/; revision=26169 --- .../applications/graphics/freecad/default.nix | 11 ++++++++--- .../graphics/freecad/pythonpath.patch | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 pkgs/applications/graphics/freecad/pythonpath.patch diff --git a/pkgs/applications/graphics/freecad/default.nix b/pkgs/applications/graphics/freecad/default.nix index 21a28cf1927c..e222af4f0e70 100644 --- a/pkgs/applications/graphics/freecad/default.nix +++ b/pkgs/applications/graphics/freecad/default.nix @@ -1,6 +1,6 @@ { fetchsvn, stdenv, cmake, coin3d, xercesc, ode, eigen, qt4, opencascade, gts, boost, zlib, -python, swig, gfortran, soqt, libf2c }: +python, swig, gfortran, soqt, libf2c, pyqt4, makeWrapper }: # It builds but fails to install @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { }; buildInputs = [ cmake coin3d xercesc ode eigen qt4 opencascade gts boost - zlib python swig gfortran soqt libf2c ]; + zlib python swig gfortran soqt libf2c pyqt4 makeWrapper ]; enableParallelBuilding = true; @@ -28,7 +28,12 @@ stdenv.mkDerivation rec { export NIX_LDFLAGS="-L${gfortran.gcc}/lib64 $NIX_LDFLAGS"; ''; - patches = [ ./cmakeinstall.patch ]; + postInstall = '' + wrapProgram $out/bin/FreeCAD --prefix PYTHONPATH : $PYTHONPATH \ + --set COIN_GL_NO_CURRENT_CONTEXT_CHECK 1 + ''; + + patches = [ ./cmakeinstall.patch ./pythonpath.patch ]; meta = { homepage = http://free-cad.sourceforge.net/; diff --git a/pkgs/applications/graphics/freecad/pythonpath.patch b/pkgs/applications/graphics/freecad/pythonpath.patch new file mode 100644 index 000000000000..849c778aedba --- /dev/null +++ b/pkgs/applications/graphics/freecad/pythonpath.patch @@ -0,0 +1,19 @@ +http://sourceforge.net/apps/phpbb/free-cad/viewtopic.php?f=4&t=847&p=6364 + +Index: src/Main/MainGui.cpp +=================================================================== +--- a/src/Main/MainGui.cpp (revision 4193) ++++ a/src/Main/MainGui.cpp (working copy) +@@ -149,10 +149,10 @@ + // http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559846 + putenv("LANG=C"); + putenv("LC_ALL=C"); +- putenv("PYTHONPATH="); ++ //putenv("PYTHONPATH="); + #else + setlocale(LC_NUMERIC, "C"); +- _putenv("PYTHONPATH="); ++ //_putenv("PYTHONPATH="); + #endif + + // Name and Version of the Application