diff --git a/pkgs/applications/video/mythtv/builder.sh b/pkgs/applications/video/mythtv/builder.sh index e30fa126f3c7..d3888175bd91 100644 --- a/pkgs/applications/video/mythtv/builder.sh +++ b/pkgs/applications/video/mythtv/builder.sh @@ -1,7 +1,5 @@ . $stdenv/setup -export QTDIR=$qt3 - buildPhase=myBuilder myBuilder() { diff --git a/pkgs/development/libraries/qt-3/builder.sh b/pkgs/development/libraries/qt-3/builder.sh index 5273ca795d3d..0af2669ba9b0 100644 --- a/pkgs/development/libraries/qt-3/builder.sh +++ b/pkgs/development/libraries/qt-3/builder.sh @@ -1,4 +1,8 @@ . $stdenv/setup +. $substitute + +ensureDir $out/nix-support +substitute "$hook" "$out/nix-support/setup-hook" --subst-var out preConfigure=preConfigure @@ -9,11 +13,9 @@ preConfigure() { # will cause ./configure misdetections). for i in config.tests/unix/checkavail config.tests/*/*.test mkspecs/*/qmake.conf; do echo "patching $i..." - sed < $i > $i.tmp \ - -e 's^ /lib^ /FOO^g' \ - -e 's^/usr^/FOO^g' - if test -x $i; then chmod +x $i.tmp; fi - mv $i.tmp $i + substituteInPlace "$i" \ + --replace " /lib" " /FOO" \ + --replace "/usr" "/FOO" done } diff --git a/pkgs/development/libraries/qt-3/default.nix b/pkgs/development/libraries/qt-3/default.nix index 70c692978a61..79bfe004881e 100644 --- a/pkgs/development/libraries/qt-3/default.nix +++ b/pkgs/development/libraries/qt-3/default.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation { name = "qt-3.3.3"; builder = ./builder.sh; + substitute = ../../../build-support/substitute/substitute.sh; + hook = ./setup-hook.sh; src = fetchurl { url = http://catamaran.labs.cs.uu.nl/dist/tarballs/qt-x11-free-3.3.3.tar.bz2; md5 = "3e0a0c8429b0a974b39b5f535ddff01c"; diff --git a/pkgs/development/libraries/qt-3/setup-hook.sh b/pkgs/development/libraries/qt-3/setup-hook.sh new file mode 100644 index 000000000000..db1a2529ff54 --- /dev/null +++ b/pkgs/development/libraries/qt-3/setup-hook.sh @@ -0,0 +1 @@ +export QTDIR=@out@