From 0b28198f23fab730a797e865e741d9fd8a50f1a3 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Thu, 26 Dec 2019 10:59:18 -0500 Subject: root: wrap python executables In normal use of ROOT the PYTHONPATH is intended to be set when user sources the thisroot.{,s}sh. We do that in the setupHook. This covers the case when thisroot.sh was not sourced. --- pkgs/applications/science/misc/root/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'pkgs/applications') diff --git a/pkgs/applications/science/misc/root/default.nix b/pkgs/applications/science/misc/root/default.nix index 7a03369febe..b901e40a194 100644 --- a/pkgs/applications/science/misc/root/default.nix +++ b/pkgs/applications/science/misc/root/default.nix @@ -1,5 +1,6 @@ -{ stdenv, fetchurl, cmake, gl2ps, gsl, libX11, libXpm, libXft, libXext -, libGLU, libGL, libxml2, lz4, lzma, pcre, pkgconfig, python, xxHash, zlib +{ stdenv, fetchurl, makeWrapper, cmake, gl2ps, gsl, libX11, libXpm, libXft +, libXext, libGLU, libGL, libxml2, lz4, lzma, pcre, pkgconfig, python, xxHash +, zlib , Cocoa, OpenGL, noSplash ? false }: stdenv.mkDerivation rec { @@ -11,7 +12,7 @@ stdenv.mkDerivation rec { sha256 = "196ghma6g5a7sqz52wyjkgvmh4hj4vqwppm0zwdypy33hgy8anii"; }; - nativeBuildInputs = [ cmake pkgconfig ]; + nativeBuildInputs = [ makeWrapper cmake pkgconfig ]; buildInputs = [ gl2ps pcre python zlib libxml2 lz4 lzma gsl xxHash ] ++ stdenv.lib.optionals (!stdenv.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ] ++ stdenv.lib.optionals (stdenv.isDarwin) [ Cocoa OpenGL ] @@ -73,6 +74,13 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + postInstall = '' + for prog in rootbrowse rootcp rooteventselector rootls rootmkdir rootmv rootprint rootrm rootslimtree; do + wrapProgram "$out/bin/$prog" \ + --prefix PYTHONPATH : "$out/lib" + done + ''; + setupHook = ./setup-hook.sh; meta = with stdenv.lib; { -- cgit 1.4.1