From fd78464de91d5d64dda217397586996e0b7ff37f Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 26 Nov 2018 18:00:08 -0600 Subject: [PATCH 01/26] premake: add setup-hook Adds a configure phase for packages using premake. premakeConfigurePhase runs the correct premake version for the premake you are using (see premake_cmd). --- pkgs/development/tools/misc/premake/3.nix | 3 +++ pkgs/development/tools/misc/premake/5.nix | 3 +++ .../tools/misc/premake/default.nix | 7 +++++-- .../tools/misc/premake/setup-hook.sh | 19 +++++++++++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/tools/misc/premake/setup-hook.sh diff --git a/pkgs/development/tools/misc/premake/3.nix b/pkgs/development/tools/misc/premake/3.nix index 77f613868747..8b02bf96fd57 100644 --- a/pkgs/development/tools/misc/premake/3.nix +++ b/pkgs/development/tools/misc/premake/3.nix @@ -18,6 +18,9 @@ stdenv.mkDerivation { install -Dm755 bin/premake $out/bin/premake ''; + premake_cmd = "premake3"; + setupHook = ./setup-hook.sh; + meta = { homepage = http://industriousone.com/premake; description = "A simple build configuration and project generation tool using lua"; diff --git a/pkgs/development/tools/misc/premake/5.nix b/pkgs/development/tools/misc/premake/5.nix index 93220a02e2df..8ceb3d4a4367 100644 --- a/pkgs/development/tools/misc/premake/5.nix +++ b/pkgs/development/tools/misc/premake/5.nix @@ -31,6 +31,9 @@ stdenv.mkDerivation rec { install -Dm755 bin/release/premake5 $out/bin/premake5 ''; + premake_cmd = "premake5"; + setupHook = ./setup-hook.sh; + meta = { homepage = https://premake.github.io; description = "A simple build configuration and project generation tool using lua"; diff --git a/pkgs/development/tools/misc/premake/default.nix b/pkgs/development/tools/misc/premake/default.nix index 770c80710953..99bf8cac81fa 100644 --- a/pkgs/development/tools/misc/premake/default.nix +++ b/pkgs/development/tools/misc/premake/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation { sha256 = "1017rd0wsjfyq2jvpjjhpszaa7kmig6q1nimw76qx3cjz2868lrn"; }; - buildInputs = [ unzip ]; + nativeBuildInputs = [ unzip ]; buildPhase = '' make -C build/gmake.unix/ @@ -22,11 +22,14 @@ stdenv.mkDerivation { install -Dm755 bin/release/premake4 $out/bin/premake4 ''; + premake_cmd = "premake4"; + setupHook = ./setup-hook.sh; + meta = with stdenv.lib; { homepage = http://industriousone.com/premake; description = "A simple build configuration and project generation tool using lua"; license = stdenv.lib.licenses.bsd3; - platforms = platforms.linux; + platforms = platforms.unix; maintainers = [ maintainers.bjornfor ]; }; } diff --git a/pkgs/development/tools/misc/premake/setup-hook.sh b/pkgs/development/tools/misc/premake/setup-hook.sh new file mode 100644 index 000000000000..ba06ea2c7617 --- /dev/null +++ b/pkgs/development/tools/misc/premake/setup-hook.sh @@ -0,0 +1,19 @@ +premakeConfigurePhase() { + runHook preConfigure + + local flagsArray=( + ${premakefile:+--file=$premakefile} + $premakeFlags ${premakeFlagsArray[@]} + ${premakeBackend:-gmake} + ) + + echoCmd 'configure flags' "${flagsArray[@]}" + + @premake_cmd@ "${flagsArray[@]}" + + runHook postConfigure +} + +if [ -z "$configurePhase" ]; then + configurePhase=premakeConfigurePhase +fi From a06eb847058584480487e840a1c9b78cb7828e84 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 26 Nov 2018 18:02:16 -0600 Subject: [PATCH 02/26] bootil: cleanup installation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A few changes needed here: - We don’t want to guess what our platform is. We can patch location and targetdir to not put things in an unpredictable directory. - Make premake4 a native build input. - Set the premakefile variable. --- pkgs/development/libraries/bootil/default.nix | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pkgs/development/libraries/bootil/default.nix b/pkgs/development/libraries/bootil/default.nix index b64cdd5245fd..0ed223832b6c 100644 --- a/pkgs/development/libraries/bootil/default.nix +++ b/pkgs/development/libraries/bootil/default.nix @@ -23,21 +23,21 @@ stdenv.mkDerivation rec { url = https://github.com/garrynewman/bootil/pull/22.patch; name = "github-pull-request-22.patch"; sha256 = "1qf8wkv00pb9w1aa0dl89c8gm4rmzkxfl7hidj4gz0wpy7a24qa2"; - })]; + }) ]; - platform = - if stdenv.isLinux then "linux" - else if stdenv.isDarwin then "macosx" - else throw "unrecognized system ${stdenv.hostPlatform.system}"; + # Avoid guessing where files end up. Just use current directory. + postPatch = '' + substituteInPlace projects/premake4.lua \ + --replace 'location ( os.get() .. "/" .. _ACTION )' 'location ( ".." )' + substituteInPlace projects/bootil.lua \ + --replace 'targetdir ( "../lib/" .. os.get() .. "/" .. _ACTION )' 'targetdir ( ".." )' + ''; - buildInputs = [ premake4 ]; - - configurePhase = "premake4 --file=projects/premake4.lua gmake"; - makeFlags = "-C projects/${platform}/gmake"; + nativeBuildInputs = [ premake4 ]; + premakefile = "projects/premake4.lua"; installPhase = '' - mkdir -p $out/lib - cp lib/${platform}/gmake/libbootil_static.a $out/lib/ - cp -r include $out/ + install -D libbootil_static.a $out/lib/libbootil_static.a + cp -r include $out ''; } From e0471b6c45345f66b633d15f191680408c110ce3 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 26 Nov 2018 20:13:40 -0600 Subject: [PATCH 03/26] yojimbo: use premake build hook --- pkgs/development/libraries/yojimbo/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/yojimbo/default.nix b/pkgs/development/libraries/yojimbo/default.nix index 9a3416a368bb..557c46470a8d 100644 --- a/pkgs/development/libraries/yojimbo/default.nix +++ b/pkgs/development/libraries/yojimbo/default.nix @@ -15,9 +15,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ premake5 doxygen ]; propagatedBuildInputs = [ libsodium mbedtls ]; - buildPhase = '' - premake5 gmake - make all + postBuild = '' premake5 docs ''; @@ -28,6 +26,8 @@ stdenv.mkDerivation rec { cp -r docs/html $out/share/doc/yojimbo ''; + doCheck = true; + meta = with stdenv.lib; { description = "A network library for client/server games with dedicated servers"; longDescription = '' From 932c1ff4c89d8464208879abb33f3682386c8bcf Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 01:32:11 -0600 Subject: [PATCH 04/26] distrho: cleanup premake usage --- pkgs/applications/audio/distrho/default.nix | 37 ++++++++++++--------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/pkgs/applications/audio/distrho/default.nix b/pkgs/applications/audio/distrho/default.nix index bf79b68bc7db..1c41451b08f3 100644 --- a/pkgs/applications/audio/distrho/default.nix +++ b/pkgs/applications/audio/distrho/default.nix @@ -1,7 +1,13 @@ { stdenv, fetchFromGitHub, alsaLib, fftwSinglePrec, freetype, libjack2 -, pkgconfig, premake3, xorg, ladspa-sdk }: +, pkgconfig, ladspa-sdk, premake3 +, libX11, libXcomposite, libXcursor, libXext, libXinerama, libXrender +}: -stdenv.mkDerivation rec { +let + premakeos = if stdenv.hostPlatform.isDarwin then "osx" + else if stdenv.hostPlatform.isWindows then "mingw" + else "linux"; +in stdenv.mkDerivation rec { name = "distrho-ports-${version}"; version = "2018-04-16"; @@ -12,27 +18,26 @@ stdenv.mkDerivation rec { sha256 = "0l4zwl4mli8jzch32a1fh7c88r9q17xnkxsdw17ds5hadnxlk12v"; }; + configurePhase = '' + runHook preConfigure + + sh ./scripts/premake-update.sh ${premakeos} + + runHook postConfigure + ''; + patchPhase = '' sed -e "s#@./scripts#sh scripts#" -i Makefile ''; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = [ pkgconfig premake3 ]; buildInputs = [ - alsaLib fftwSinglePrec freetype libjack2 premake3 - xorg.libX11 xorg.libXcomposite xorg.libXcursor xorg.libXext - xorg.libXinerama xorg.libXrender ladspa-sdk + alsaLib fftwSinglePrec freetype libjack2 + libX11 libXcomposite libXcursor libXext + libXinerama libXrender ladspa-sdk ]; - buildPhase = '' - sh ./scripts/premake-update.sh linux - make lv2 - ''; - - installPhase = '' - mkdir -p $out/bin - mkdir -p $out/lib/lv2 - cp -a bin/lv2/* $out/lib/lv2/ - ''; + makeFlags = "PREFIX=$(out)"; meta = with stdenv.lib; { homepage = http://distrho.sourceforge.net; From 0984032d6ae2d87b8a032a75f783942da2279235 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 01:35:32 -0600 Subject: [PATCH 05/26] gmad: use premake setup hook --- pkgs/games/gmad/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/games/gmad/default.nix b/pkgs/games/gmad/default.nix index a15914877ccb..78936ec19499 100644 --- a/pkgs/games/gmad/default.nix +++ b/pkgs/games/gmad/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { else if stdenv.isDarwin then "gmad_osx" else "gmad"; - configurePhase = "premake4 --bootil_lib=${bootil}/lib --bootil_inc=${bootil}/include gmake"; + premakeFlags = "--bootil_lib=${bootil}/lib --bootil_inc=${bootil}/include"; installPhase = '' mkdir -p $out/bin From 9d2c6ea47a146cb6e10c4d4ec08179cf18dc26fe Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 01:42:54 -0600 Subject: [PATCH 06/26] otfcc: use premake setup hook --- pkgs/tools/misc/otfcc/default.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/misc/otfcc/default.nix b/pkgs/tools/misc/otfcc/default.nix index acf46a58a6bf..96e5e6a1d94e 100644 --- a/pkgs/tools/misc/otfcc/default.nix +++ b/pkgs/tools/misc/otfcc/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, premake5, ninja }: +{ stdenv, fetchFromGitHub, premake5 }: stdenv.mkDerivation rec { name = "otfcc-${version}"; @@ -11,15 +11,15 @@ stdenv.mkDerivation rec { sha256 = "1rnjfqqyc6d9nhlh8if9k37wk94mcwz4wf3k239v6idg48nrk10b"; }; - nativeBuildInputs = [ premake5 ninja ]; + nativeBuildInputs = [ premake5 ]; - configurePhase = '' - premake5 ninja + # Don’t guess where our makefiles will end up. Just use current + # directory. + patchPhase = '' + substituteInPlace premake5.lua \ + --replace 'location "build/gmake"' 'location "."' ''; - ninjaFlags = let x = if stdenv.hostPlatform.isi686 then "x86" else "x64"; in - [ "-C" "build/ninja" "otfccdump_release_${x}" "otfccbuild_release_${x}" ]; - installPhase = '' mkdir -p $out/bin cp bin/release-x*/otfcc* $out/bin/ From 801b375925fb212eec52f74574ad4d19f74301ef Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 16:43:32 -0600 Subject: [PATCH 07/26] tome4: use premake hook --- pkgs/games/tome4/default.nix | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/pkgs/games/tome4/default.nix b/pkgs/games/tome4/default.nix index 3f6726a17f18..ec529676463f 100644 --- a/pkgs/games/tome4/default.nix +++ b/pkgs/games/tome4/default.nix @@ -25,9 +25,10 @@ in stdenv.mkDerivation rec { sha256 = "0mc5dgh2x9nbili7gy6srjhb23ckalf08wqq2amyjr5rq392jvd7"; }; - nativeBuildInputs = [ premake4 makeWrapper unzip ]; + nativeBuildInputs = [ makeWrapper unzip premake4 ]; - # tome4 vendors quite a few libraries so someone might want to look into avoiding that... + # tome4 vendors quite a few libraries so someone might want to look + # into avoiding that... buildInputs = [ libGLU openal libpng libvorbis SDL2 SDL2_ttf SDL2_image ]; @@ -36,20 +37,11 @@ in stdenv.mkDerivation rec { enableParallelBuilding = false; NIX_CFLAGS_COMPILE = [ + "-I${SDL2.dev}/include/SDL2" "-I${SDL2_image}/include/SDL2" "-I${SDL2_ttf}/include/SDL2" ]; - postPatch = '' - substituteInPlace premake4.lua \ - --replace "/opt/SDL-2.0/include/SDL2" "${SDL2.dev}/include/SDL2" \ - --replace "/usr/include/GL" "/run/opengl-driver/include" - ''; - - preConfigure = '' - premake4 gmake - ''; - makeFlags = [ "config=release" ]; # The wrapper needs to cd into the correct directory as tome4's detection of From 613e262fc2f84d068da40ee6c45f0915c00e2193 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 19:48:07 -0600 Subject: [PATCH 08/26] imake: add setup hook --- .../x11/xorg/darwin-imake-setup-hook.sh | 1 - pkgs/servers/x11/xorg/imake-setup-hook.sh | 19 +++++++++++++++++++ pkgs/servers/x11/xorg/overrides.nix | 8 ++++---- 3 files changed, 23 insertions(+), 5 deletions(-) delete mode 100644 pkgs/servers/x11/xorg/darwin-imake-setup-hook.sh create mode 100644 pkgs/servers/x11/xorg/imake-setup-hook.sh diff --git a/pkgs/servers/x11/xorg/darwin-imake-setup-hook.sh b/pkgs/servers/x11/xorg/darwin-imake-setup-hook.sh deleted file mode 100644 index 6dbaf724092b..000000000000 --- a/pkgs/servers/x11/xorg/darwin-imake-setup-hook.sh +++ /dev/null @@ -1 +0,0 @@ -export IMAKECPP="@tradcpp@/bin/tradcpp" diff --git a/pkgs/servers/x11/xorg/imake-setup-hook.sh b/pkgs/servers/x11/xorg/imake-setup-hook.sh new file mode 100644 index 000000000000..10f54198f7fb --- /dev/null +++ b/pkgs/servers/x11/xorg/imake-setup-hook.sh @@ -0,0 +1,19 @@ +export IMAKECPP="@tradcpp@/bin/tradcpp" + +imakeConfigurePhase() { + runHook preConfigure + + echoCmd 'configuring with imake' + + if [ -z "${imakefile:-}" -a ! -e Imakefile ]; then + echo "no Imakefile, doing nothing" + else + xmkmf -a + fi + + runHook postConfigure +} + +if [ -z "$dontUseImakeConfigure" -a -z "$configurePhase" ]; then + configurePhase=imakeConfigurePhase +fi diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 8f4c251335a9..48e67ac74a80 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -63,12 +63,12 @@ self: super: inherit (self) xorgcffiles; x11BuildHook = ./imake.sh; patches = [./imake.patch ./imake-cc-wrapper-uberhack.patch]; - setupHook = if stdenv.isDarwin then ./darwin-imake-setup-hook.sh else null; - CFLAGS = [ "-DIMAKE_COMPILETIME_CPP=\\\"${if stdenv.isDarwin + setupHook = ./imake-setup-hook.sh; + CFLAGS = [ ''-DIMAKE_COMPILETIME_CPP='"${if stdenv.isDarwin then "${tradcpp}/bin/cpp" - else "gcc"}\\\"" + else "gcc"}"' '' ]; - tradcpp = if stdenv.isDarwin then tradcpp else null; + inherit tradcpp; }); mkfontdir = super.mkfontdir.overrideAttrs (attrs: { From a858113076b9012664237eb619b9289936b187a9 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 19:54:15 -0600 Subject: [PATCH 09/26] oneko: use imake setup hook Simplifies some things here. --- pkgs/applications/misc/oneko/default.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/misc/oneko/default.nix b/pkgs/applications/misc/oneko/default.nix index e1cc70e42779..311f093ba6d8 100644 --- a/pkgs/applications/misc/oneko/default.nix +++ b/pkgs/applications/misc/oneko/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, xorg, xlibsWrapper }: +{ stdenv, fetchurl, imake, gccmakedep, xlibsWrapper }: stdenv.mkDerivation rec { version = "1.2.sakura.5"; @@ -8,14 +8,11 @@ stdenv.mkDerivation rec { url = "http://www.daidouji.com/oneko/distfiles/oneko-${version}.tar.gz"; sha256 = "2c2e05f1241e9b76f54475b5577cd4fb6670de058218d04a741a04ebd4a2b22f"; }; - buildInputs = [ xorg.imake xorg.gccmakedep xlibsWrapper ]; + nativeBuildInputs = [ imake gccmakedep ]; + buildInputs = [ xlibsWrapper ]; - configurePhase = "xmkmf"; - - installPhase = '' - make install BINDIR=$out/bin - make install.man MANPATH=$out/share/man - ''; + makeFlags = [ "BINDIR=$(out)/bin" "MANPATH=$(out)/share/man" ]; + installTargets = "install install.man"; meta = with stdenv.lib; { description = "Creates a cute cat chasing around your mouse cursor"; From 3d3f87365c160f27bd6d1455ef1bd3fc4cebe915 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 19:55:08 -0600 Subject: [PATCH 10/26] xcruiser: add setup hook Cleans things up a bit here. --- pkgs/applications/misc/xcruiser/default.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/misc/xcruiser/default.nix b/pkgs/applications/misc/xcruiser/default.nix index 3a25147971a9..945072ce026e 100644 --- a/pkgs/applications/misc/xcruiser/default.nix +++ b/pkgs/applications/misc/xcruiser/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, gccmakedep, xorg }: +{ stdenv, fetchurl, gccmakedep, xorg, imake, libXt, libXaw, libXpm, libXext }: stdenv.mkDerivation { name = "xcruiser-0.30"; @@ -8,13 +8,13 @@ stdenv.mkDerivation { sha256 = "1r8whva38xizqdh7jmn6wcmfmsndc67pkw22wzfzr6rq0vf6hywi"; }; - buildInputs = with xorg; [ gccmakedep imake libXt libXaw libXpm libXext ]; + nativeBuildInputs = [ gccmakedep imake ]; + buildInputs = [ libXt libXaw libXpm libXext ]; - configurePhase = "xmkmf -a"; - - preBuild = '' - makeFlagsArray=( BINDIR=$out/bin XAPPLOADDIR=$out/etc/X11/app-defaults) - ''; + makeFlags = [ + "BINDIR=$(out)/bin" + "XAPPLOADDIR=$(out)/etc/X11/app-defaults" + ]; meta = with stdenv.lib; { description = "Filesystem visualization utility"; From f5be016c23dd4abb5b5478007484ca7341f84e1e Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 20:06:26 -0600 Subject: [PATCH 11/26] xmove: remove This package is unmaintained. https://packages.qa.debian.org/x/xmove/news/20090130T204752Z.html --- pkgs/applications/misc/xmove/default.nix | 19 ------------------- pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 21 deletions(-) delete mode 100644 pkgs/applications/misc/xmove/default.nix diff --git a/pkgs/applications/misc/xmove/default.nix b/pkgs/applications/misc/xmove/default.nix deleted file mode 100644 index e461a2c8816a..000000000000 --- a/pkgs/applications/misc/xmove/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{stdenv, fetchurl, libX11, libXi, imake, xauth, libXau}: -stdenv.mkDerivation { - name = "xmove-2.0b2"; - - src = fetchurl { - url = mirror://debian/pool/main/x/xmove/xmove_2.0beta2.orig.tar.gz; - sha256 = "0q310k3bi39vdk0kqqvsahnb1k6lx9hlx80iyxnkq59l6jxnhyhf"; - }; - - buildPhase = "cd xmove; sed -e 's/.*No address for our host.*/{hp = gethostbyname(\"localhost\");};/' -i main.c; cp ../man/man1/xmove.1 xmove.man ; xmkmf; make; cd .. ; cd xmovectrl ; cp ../man/man1/xmovectrl.1 xmovectrl.man; xmkmf; make ; cd .."; - installPhase = "cd xmove; make install install.man MANDIR=\${out}/man/man1 BINDIR=\${out}/bin; cd .. ; cd xmovectrl ; make install install.man MANDIR=\${out}/man/man1 BINDIR=\${out}/bin; cd .."; - - buildInputs = [libX11 libXi imake xauth libXau]; - - meta = { - platforms = stdenv.lib.platforms.linux; - license = stdenv.lib.licenses.mit; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6ce1afbb415a..ff7b4f9951d9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20051,8 +20051,6 @@ with pkgs; xmlcopyeditor = callPackage ../applications/editors/xmlcopyeditor { }; - xmove = callPackage ../applications/misc/xmove { }; - xmp = callPackage ../applications/audio/xmp { }; xnee = callPackage ../tools/X11/xnee { }; From cf3940ef9582d097cd7fd7c92dc80d4a86f928e6 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 20:11:15 -0600 Subject: [PATCH 12/26] xxkb: use imake setup hook --- pkgs/applications/misc/xxkb/default.nix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/misc/xxkb/default.nix b/pkgs/applications/misc/xxkb/default.nix index 90e2723a9067..56638d126c19 100644 --- a/pkgs/applications/misc/xxkb/default.nix +++ b/pkgs/applications/misc/xxkb/default.nix @@ -1,5 +1,5 @@ -{ stdenv, fetchurl, libX11, libXt, libXext, libXpm, imake -, svgSupport ? true, librsvg, glib, gdk_pixbuf, pkgconfig +{ stdenv, fetchurl, libX11, libXt, libXext, libXpm, imake, gccmakedep +, svgSupport ? false, librsvg, glib, gdk_pixbuf, pkgconfig }: assert svgSupport -> @@ -13,20 +13,21 @@ stdenv.mkDerivation rec { sha256 = "0hl1i38z9xnbgfjkaz04vv1n8xbgfg88g5z8fyzyb2hxv2z37anf"; }; + nativeBuildInputs = [ imake gccmakedep ]; buildInputs = [ - imake libX11 libXt libXext libXpm ] ++ stdenv.lib.optionals svgSupport [ librsvg glib gdk_pixbuf pkgconfig ]; outputs = [ "out" "man" ]; - configurePhase = '' - xmkmf ${stdenv.lib.optionalString svgSupport "-DWITH_SVG_SUPPORT"} - ''; + imakeFlags = stdenv.lib.optionalString svgSupport "-DWITH_SVG_SUPPORT"; - preBuild = '' - makeFlagsArray=( BINDIR=$out/bin PIXMAPDIR=$out/share/xxkb XAPPLOADDIR=$out/etc/X11/app-defaults MANDIR=$man/share/man ) - ''; + makeFlags = [ + "BINDIR=${placeholder "out"}/bin" + "PIXMAPDIR=${placeholder "out"}/share/xxkb" + "XAPPLOADDIR=${placeholder "out"}/etc/X11/app-defaults" + "MANDIR=${placeholder "man"}/share/man" + ]; installTargets = "install install.man"; From 8a4da418491fab6185ce3c7cf88f38cc1c2ba2e6 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 20:12:33 -0600 Subject: [PATCH 13/26] xearth: use imake setup hook --- .../science/astronomy/xearth/default.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/science/astronomy/xearth/default.nix b/pkgs/applications/science/astronomy/xearth/default.nix index 5f276a1b3c70..fef4ca1907fd 100644 --- a/pkgs/applications/science/astronomy/xearth/default.nix +++ b/pkgs/applications/science/astronomy/xearth/default.nix @@ -1,21 +1,20 @@ -{ stdenv, fetchurl, xorg }: +{ stdenv, fetchurl, imake, gccmakedep, libXt, libXext }: + stdenv.mkDerivation rec { name = "xearth-${version}"; version = "1.1"; - + src = fetchurl { url = "http://xearth.org/${name}.tar.gz"; sha256 = "bcb1407cc35b3f6dd3606b2c6072273b6a912cbd9ed1ae22fb2d26694541309c"; }; - buildInputs = with xorg; [ imake libXt libXext ]; - - dontAddPrefix = true; - configureScript="xmkmf"; + nativeBuildInputs = [ imake gccmakedep ]; + buildInputs = [ libXt libXext ]; installFlags=[ "DESTDIR=$(out)/" "BINDIR=bin" "MANDIR=man/man1"]; installTargets="install install.man"; - + meta = with stdenv.lib; { description = "sets the X root window to an image of the Earth"; homepage = "http://xplanet.org"; From cbf9b5610b83d86d7f831b3440dc9195b2e54766 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 20:14:03 -0600 Subject: [PATCH 14/26] larswm: use imake setup hook --- pkgs/applications/window-managers/larswm/default.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/window-managers/larswm/default.nix b/pkgs/applications/window-managers/larswm/default.nix index 21ea00d110e0..4ec1a4bcd059 100644 --- a/pkgs/applications/window-managers/larswm/default.nix +++ b/pkgs/applications/window-managers/larswm/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, imake, libX11, libXext, libXmu}: +{ stdenv, fetchurl, imake, gccmakedep, libX11, libXext, libXmu }: stdenv.mkDerivation { name = "larswm-7.5.3"; @@ -8,13 +8,11 @@ stdenv.mkDerivation { sha256 = "1xmlx9g1nhklxjrg0wvsya01s4k5b9fphnpl9zdwp29mm484ni3v"; }; - buildInputs = [ imake libX11 libXext libXmu ]; + nativeBuildInputs = [ imake gccmakedep ]; + buildInputs = [ libX11 libXext libXmu ]; - configurePhase = '' - xmkmf - makeFlags="BINDIR=$out/bin MANPATH=$out/share/man" - installTargets="install install.man" - ''; + makeFlags = [ "BINDIR=$(out)/bin" "MANPATH=$(out)/share/man" ]; + installTargets = "install install.man"; meta = { homepage = http://www.fnurt.net/larswm; From 1eab4151d411ad62aa303ddda221a8fcf9747be8 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 20:15:45 -0600 Subject: [PATCH 15/26] xsnow: use imake setup hook --- pkgs/games/xsnow/default.nix | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/pkgs/games/xsnow/default.nix b/pkgs/games/xsnow/default.nix index 47a321c99b4a..07ed50d4e7b3 100644 --- a/pkgs/games/xsnow/default.nix +++ b/pkgs/games/xsnow/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, libXt, libXpm, libXext, imake }: +{ stdenv, fetchurl, libXt, libXpm, libXext, imake, gccmakedep }: stdenv.mkDerivation rec { @@ -10,25 +10,17 @@ stdenv.mkDerivation rec { sha256 = "06jnbp88wc9i9dbmy7kggplw4hzlx2bhghxijmlhkjlizgqwimyh"; }; + nativeBuildInputs = [ imake gccmakedep ]; buildInputs = [ - libXt libXpm libXext imake + libXt libXpm libXext ]; - buildPhase = '' - xmkmf - make - ''; - - installPhase = '' - mkdir -p $out/bin $out/share/man/man1 - cp xsnow $out/bin/ - cp xsnow.1 $out/share/man/man1/ - ''; + makeFlags = [ "BINDIR=$(out)/bin" "MANPATH=$(out)/share/man" ]; meta = { description = "An X-windows application that will let it snow on the root, in between and on windows"; homepage = http://janswaal.home.xs4all.nl/Xsnow/; license = stdenv.lib.licenses.unfree; maintainers = [ stdenv.lib.maintainers.robberer ]; - }; + }; } From 92c119fb31c5d30e43bf35272396ad4559dc548d Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 20:17:05 -0600 Subject: [PATCH 16/26] xautolock: use imake setup hook --- pkgs/misc/screensavers/xautolock/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/misc/screensavers/xautolock/default.nix b/pkgs/misc/screensavers/xautolock/default.nix index 0c1446f0672f..cce4b351c577 100644 --- a/pkgs/misc/screensavers/xautolock/default.nix +++ b/pkgs/misc/screensavers/xautolock/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchurl, xlibsWrapper, imake, libXScrnSaver, scrnsaverproto }: +{ stdenv, fetchurl, xlibsWrapper +, imake, gccmakedep, libXScrnSaver, scrnsaverproto }: stdenv.mkDerivation rec { name = "xautolock-2.2"; @@ -14,10 +15,13 @@ stdenv.mkDerivation rec { }) ]; NIX_CFLAGS_COMPILE = "-DSYSV"; - makeFlags="BINDIR=\${out}/bin MANPATH=\${out}/man"; - preBuild = "xmkmf"; + makeFlags = [ + "BINDIR=$(out)/bin" + "MANPATH=$(out)/share/man" + ]; installTargets = "install install.man"; - buildInputs = [xlibsWrapper imake libXScrnSaver scrnsaverproto]; + nativeBuildInputs = [ imake gccmakedep ]; + buildInputs = [ xlibsWrapper libXScrnSaver scrnsaverproto ]; meta = with stdenv.lib; { description = "A program that launches a given program when your X session has been idle for a given time."; homepage = http://www.ibiblio.org/pub/linux/X11/screensavers; From be10bee0e48c4f3f365b947ee539d607d7b30dc7 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 21:29:40 -0600 Subject: [PATCH 17/26] x2x: use imake setup hook --- pkgs/tools/X11/x2x/default.nix | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pkgs/tools/X11/x2x/default.nix b/pkgs/tools/X11/x2x/default.nix index 24cf4f6b2e16..0c3538a0db9c 100644 --- a/pkgs/tools/X11/x2x/default.nix +++ b/pkgs/tools/X11/x2x/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, imake, libX11, libXtst, libXext}: +{ stdenv, fetchurl, imake, libX11, libXtst, libXext, gccmakedep }: stdenv.mkDerivation { name = "x2x-1.27"; @@ -8,20 +8,16 @@ stdenv.mkDerivation { sha256 = "0dha0kn1lbc4as0wixsvk6bn4innv49z9a0sm5wlx4q1v0vzqzyj"; }; - buildInputs = [ imake libX11 libXtst libXext ]; + nativeBuildInputs = [ imake gccmakedep ]; + buildInputs = [ libX11 libXtst libXext ]; hardeningDisable = [ "format" ]; - configurePhase = '' - xmkmf - makeFlags="BINDIR=$out/bin x2x" - ''; + buildFlags = [ "x2x" ]; installPhase = '' - mkdir -p $out/bin - mkdir -p $out/man/man1 - cp x2x $out/bin/ - cp x2x.1 $out/man/man1/ + install -D x2x $out/bin/x2x + install -D x2x.1 $out/man/man1/x2x.1 ''; meta = with stdenv.lib; { From 39122285ba4441be27fc7b0bbbbbf647189df557 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 21:32:14 -0600 Subject: [PATCH 18/26] xbrightness: use imake setup hook --- pkgs/tools/X11/xbrightness/default.nix | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/pkgs/tools/X11/xbrightness/default.nix b/pkgs/tools/X11/xbrightness/default.nix index f4112765e675..2857ea6c7be4 100644 --- a/pkgs/tools/X11/xbrightness/default.nix +++ b/pkgs/tools/X11/xbrightness/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchurl, xorg }: +{ stdenv, fetchurl, imake, gccmakedep +, libX11, libXaw, libXext, libXmu, libXpm, libXxf86vm }: stdenv.mkDerivation { @@ -8,22 +9,11 @@ stdenv.mkDerivation { sha256 = "2564dbd393544657cdabe4cbf535d9cfb9abe8edddb1b8cdb1ed4d12f358626e"; }; - buildInputs = [ - xorg.imake - xorg.libX11 - xorg.libXaw - xorg.libXext - xorg.libXmu - xorg.libXpm - xorg.libXxf86vm - ]; + nativeBuildInputs = [ imake gccmakedep ]; + buildInputs = [ libX11 libXaw libXext libXmu libXpm libXxf86vm ]; - configurePhase = "xmkmf"; - - installPhase = '' - make install BINDIR=$out/bin - make install.man MANPATH=$out/share/man - ''; + makeFlags = [ "BINDIR=$(out)/bin" "MANPATH=$(out)/share/man" ]; + installTargets = "install install.man"; meta = { description = "X11 brigthness and gamma software control"; From fd1a5aecabe55f141eadd4ee5b5d8bfd3196f538 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 21:37:05 -0600 Subject: [PATCH 19/26] xvkbd: use imake setup hook --- pkgs/tools/X11/xvkbd/default.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/X11/xvkbd/default.nix b/pkgs/tools/X11/xvkbd/default.nix index 06824f882a44..6ccc8a24caee 100644 --- a/pkgs/tools/X11/xvkbd/default.nix +++ b/pkgs/tools/X11/xvkbd/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchurl, imake, libXt, libXaw, libXtst, libXi, libXpm, xextproto, gccmakedep, Xaw3d }: +{ stdenv, fetchurl, imake, libXt, libXaw, libXtst +, libXi, libXpm, xextproto, gccmakedep, Xaw3d }: stdenv.mkDerivation rec { name = "xvkbd-${version}"; @@ -8,12 +9,14 @@ stdenv.mkDerivation rec { sha256 = "17csj6x5zm3g67izfwhagkal1rbqzpw09lqmmlyrjy3vzgfkf75q"; }; - buildInputs = [ imake libXt libXaw libXtst xextproto libXi Xaw3d libXpm gccmakedep ]; + nativeBuildInputs = [ imake gccmakedep ]; + buildInputs = [ libXt libXaw libXtst xextproto libXi Xaw3d libXpm ]; installTargets = [ "install" "install.man" ]; - preBuild = '' - makeFlagsArray=( BINDIR=$out/bin XAPPLOADDIR=$out/etc/X11/app-defaults MANPATH=$out/man ) - ''; - configurePhase = '' xmkmf -a ''; + makeFlags = [ + "BINDIR=$(out)/bin" + "XAPPLOADDIR=$(out)/etc/X11/app-defaults" + "MANPATH=$(out)/man" + ]; meta = with stdenv.lib; { description = "Virtual keyboard for X window system"; From c90dba094d84e5a1fa613682ef5bc2fc13ae0de7 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 21:38:50 -0600 Subject: [PATCH 20/26] xzoom: use imake setup hook --- pkgs/tools/X11/xzoom/default.nix | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/X11/xzoom/default.nix b/pkgs/tools/X11/xzoom/default.nix index 05154e282636..d1867e3b077b 100644 --- a/pkgs/tools/X11/xzoom/default.nix +++ b/pkgs/tools/X11/xzoom/default.nix @@ -1,4 +1,5 @@ -{stdenv, fetchurl, libX11, imake, libXext, libXt}: +{ stdenv, fetchurl, libX11, libXext, libXt, imake, gccmakedep}: + stdenv.mkDerivation rec { name = "${pname}-${version}.${patchlevel}"; pname = "xzoom"; @@ -16,12 +17,16 @@ stdenv.mkDerivation rec { sha256 = "0zhc06whbvaz987bzzzi2bz6h9jp6rv812qs7b71drivvd820qbh"; }) ]; - buildInputs = [libX11 imake libXext libXt]; - configurePhase = '' - xmkmf - makeFlags="$makeFlags PREFIX=$out BINDIR=$out/bin MANPATH=$out/share/man" - ''; + nativeBuildInputs = [ imake gccmakedep ]; + buildInputs = [ libX11 libXext libXt ]; + + makeFlags = [ + "PREFIX=$(out)" + "BINDIR=$(out)/bin" + "MANPATH=$(out)/share/man" + ]; + installTargets = "install install.man"; meta = { inherit version; From f0077dc7dad7bec5f2823834a6337cb5db1a2299 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 21:40:57 -0600 Subject: [PATCH 21/26] transfig: use imake setup hook --- pkgs/tools/graphics/transfig/default.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkgs/tools/graphics/transfig/default.nix b/pkgs/tools/graphics/transfig/default.nix index cb3f0edff0f8..ceee3b7674d9 100644 --- a/pkgs/tools/graphics/transfig/default.nix +++ b/pkgs/tools/graphics/transfig/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, zlib, libjpeg, libpng, imake}: +{ stdenv, fetchurl, zlib, libjpeg, libpng, imake, gccmakedep }: stdenv.mkDerivation rec { name = "transfig-3.2.4"; @@ -7,7 +7,8 @@ stdenv.mkDerivation rec { sha256 = "0429snhp5acbz61pvblwlrwv8nxr6gf12p37f9xxwrkqv4ir7dd4"; }; - buildInputs = [zlib libjpeg libpng imake]; + nativeBuildInputs = [ imake gccmakedep ]; + buildInputs = [ zlib libjpeg libpng ]; patches = [ ./patch-fig2dev-dev-Imakefile @@ -45,12 +46,7 @@ stdenv.mkDerivation rec { runHook postPatch ''; - preBuild = '' - xmkmf - make Makefiles - ''; - - makeFlags = [ "CC=cc" ]; + makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; preInstall = '' mkdir -p $out From 3f00c67ef9ec34637b007832bf0ec9d0e44a3602 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 21:44:21 -0600 Subject: [PATCH 22/26] x11-ssh-askpass: cleanup --- pkgs/tools/networking/x11-ssh-askpass/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/networking/x11-ssh-askpass/default.nix b/pkgs/tools/networking/x11-ssh-askpass/default.nix index 896a2ff4daaa..1b9d55349030 100644 --- a/pkgs/tools/networking/x11-ssh-askpass/default.nix +++ b/pkgs/tools/networking/x11-ssh-askpass/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, xlibsWrapper, imake }: +{ stdenv, fetchurl, xlibsWrapper, imake, gccmakedep }: stdenv.mkDerivation { name = "x11-ssh-askpass-1.2.4.1"; @@ -10,16 +10,16 @@ stdenv.mkDerivation { sha256 = "620de3c32ae72185a2c9aeaec03af24242b9621964e38eb625afb6cdb30b8c88"; }; - nativeBuildInputs = [ imake ]; + nativeBuildInputs = [ imake gccmakedep ]; buildInputs = [ xlibsWrapper ]; configureFlags = [ "--with-app-defaults-dir=$out/etc/X11/app-defaults" ]; - preBuild = '' - xmkmf - make includes + dontUseImakeConfigure = true; + postConfigure = '' + xmkmf -a ''; installTargets = [ "install" "install.man" ]; From 8e4b0ceeb2be26690a934bfd08a90a75d9181f40 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 27 Nov 2018 21:47:45 -0600 Subject: [PATCH 23/26] vncrec: use imake setup hook --- pkgs/tools/video/vncrec/default.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/video/vncrec/default.nix b/pkgs/tools/video/vncrec/default.nix index 7efcf6cbf83a..49a2c4d4acb0 100644 --- a/pkgs/tools/video/vncrec/default.nix +++ b/pkgs/tools/video/vncrec/default.nix @@ -12,16 +12,17 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; + nativeBuildInputs = [ imake gccmakedep ]; buildInputs = [ - libX11 xproto imake gccmakedep libXt libXmu libXaw + libX11 xproto libXt libXmu libXaw libXext xextproto libSM libICE libXpm libXp ]; - buildPhase = ''xmkmf && make World''; - - installPhase = '' - make DESTDIR=$out BINDIR=/bin MANDIR=/share/man/man1 install install.man - ''; + makeFlags = [ + "BINDIR=${placeholder "out"}/bin" + "MANDIR=${placeholder "out"}/share/man" + ]; + installTargets = "install install.man"; meta = { description = "VNC recorder"; From 5d9b3a8e8b43b8a769ea1e0f9f4b5541ed4b6108 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 28 Nov 2018 12:05:08 -0600 Subject: [PATCH 24/26] nas: use imake setup hook --- pkgs/servers/nas/default.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkgs/servers/nas/default.nix b/pkgs/servers/nas/default.nix index 9b8402ec0e08..86f75a21359d 100644 --- a/pkgs/servers/nas/default.nix +++ b/pkgs/servers/nas/default.nix @@ -16,12 +16,9 @@ in stdenv.mkDerivation { buildInputs = [ xproto libXau libXt libXext libXaw libXpm ]; - buildPhase = '' - xmkmf - make WORLDOPTS="" World - ''; + buildFlags = [ "WORLDOPTS=" "World" ]; - installFlags = "LDLIBS=-lfl DESTDIR=\${out}"; + installFlags = [ "LDLIBS=-lfl" "DESTDIR=${placeholder "out"}" ]; postInstall = '' mv $out/${xorgcffiles}/* $out From 38f1b48232347d1a6e21a2c603c516b9a7128502 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 28 Nov 2018 12:11:41 -0600 Subject: [PATCH 25/26] tightvnc: use imake setup hook --- pkgs/tools/admin/tightvnc/default.nix | 40 +++++++++++++-------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/pkgs/tools/admin/tightvnc/default.nix b/pkgs/tools/admin/tightvnc/default.nix index 4027b3d531c3..5a76b500d149 100644 --- a/pkgs/tools/admin/tightvnc/default.nix +++ b/pkgs/tools/admin/tightvnc/default.nix @@ -10,15 +10,14 @@ stdenv.mkDerivation { }; # for the builder script - inherit xauth fontDirectories perl; - gcc = stdenv.cc.cc; + inherit fontDirectories; hardeningDisable = [ "format" ]; buildInputs = [ xlibsWrapper zlib libjpeg imake gccmakedep libXmu libXaw libXpm libXp xauth openssh ]; - patchPhase = '' + postPatch = '' fontPath= for i in $fontDirectories; do for j in $(find $i -name fonts.dir); do @@ -27,37 +26,38 @@ stdenv.mkDerivation { done sed -i "s@/usr/bin/ssh@${openssh}/bin/ssh@g" vncviewer/vncviewer.h - ''; - buildPhase = '' - xmkmf - make World sed -e 's@/usr/bin/perl@${perl}/bin/perl@' \ -e 's@unix/:7100@'$fontPath'@' \ -i vncserver - cd Xvnc - sed -e 's@.* CppCmd .*@#define CppCmd '$gcc'/bin/cpp@' -i config/cf/linux.cf - sed -e 's@.* CppCmd .*@#define CppCmd '$gcc'/bin/cpp@' -i config/cf/Imake.tmpl + sed -e 's@.* CppCmd .*@#define CppCmd cpp@' -i Xvnc/config/cf/linux.cf + sed -e 's@.* CppCmd .*@#define CppCmd cpp@' -i Xvnc/config/cf/Imake.tmpl sed -i \ -e 's@"uname","xauth","Xvnc","vncpasswd"@"uname","Xvnc","vncpasswd"@g' \ -e "s@\@${xauth}/bin/xauth@g" \ - ../vncserver - ./configure - make - cd .. + vncserver + ''; + + preInstall = '' + mkdir -p $out/bin + mkdir -p $out/share/man/man1 ''; installPhase = '' - mkdir -p $out/bin - mkdir -p $out/share/man/man1 + runHook preInstall + ./vncinstall $out/bin $out/share/man + runHook postInstall + ''; + + postInstall = '' # fix HTTP client: - t=$out/share/tightvnc - mkdir -p $t - sed -i "s@/usr/local/vnc/classes@$out/vnc/classes@g" $out/bin/vncserver - cp -r classes $t + mkdir -p $out/share/tightvnc + cp -r classes $out/share/tightvnc + substituteInPlace $out/bin/vncserver \ + --replace /usr/local/vnc/classes $out/share/tightvnc/classes ''; meta = { From c0a804c747c6909c036da76472393b2fbd6413b9 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 28 Nov 2018 14:22:10 -0600 Subject: [PATCH 26/26] treewide: add dontUseImakeConfigure where needed We need to set dontUseImakeConfigure in a few places to prevent imake from overriding the default configure phase. This packages all have a configure script that needs to get run: - Xaw3d - R - tkgate - ssvnc --- pkgs/applications/networking/remote/ssvnc/default.nix | 4 +++- pkgs/applications/science/electronics/tkgate/1.x.nix | 4 +++- pkgs/applications/science/math/R/default.nix | 2 ++ pkgs/development/libraries/Xaw3d/default.nix | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/remote/ssvnc/default.nix b/pkgs/applications/networking/remote/ssvnc/default.nix index f20bb740615c..99835627f879 100644 --- a/pkgs/applications/networking/remote/ssvnc/default.nix +++ b/pkgs/applications/networking/remote/ssvnc/default.nix @@ -12,7 +12,9 @@ stdenv.mkDerivation rec { buildInputs = [ imake zlib jdk libX11 libXt libXmu libXaw libXext libXpm openjpeg openssl ]; - configurePhase = "makeFlags=PREFIX=$out"; + dontUseImakeConfigure = true; + + makeFlags = "PREFIX=$(out)"; hardeningDisable = [ "format" ]; diff --git a/pkgs/applications/science/electronics/tkgate/1.x.nix b/pkgs/applications/science/electronics/tkgate/1.x.nix index aca1f9a35898..ab2b75917b92 100644 --- a/pkgs/applications/science/electronics/tkgate/1.x.nix +++ b/pkgs/applications/science/electronics/tkgate/1.x.nix @@ -12,7 +12,9 @@ stdenv.mkDerivation rec { sha256 = "1pqywkidfpdbj18i03h97f4cimld4fb3mqfy8jjsxs12kihm18fs"; }; - buildInputs = [ tcl tk libX11 which yacc flex imake xproto gccmakedep ]; + nativeBuildInputs = [ which yacc flex imake gccmakedep ]; + buildInputs = [ tcl tk libX11 xproto ]; + dontUseImakeConfigure = true; patchPhase = '' sed -i config.h \ diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix index 2fa8f3e5d7be..5cd6bbf4bdd9 100644 --- a/pkgs/applications/science/math/R/default.nix +++ b/pkgs/applications/science/math/R/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { sha256 = "0463bff5eea0f3d93fa071f79c18d0993878fd4f2e18ae6cf22c1639d11457ed"; }; + dontUseImakeConfigure = true; + buildInputs = [ bzip2 gfortran libX11 libXmu libXt libXt libjpeg libpng libtiff ncurses pango pcre perl readline texLive xz zlib less texinfo graphviz icu diff --git a/pkgs/development/libraries/Xaw3d/default.nix b/pkgs/development/libraries/Xaw3d/default.nix index 0a7f02f17e59..3e496b7e981f 100644 --- a/pkgs/development/libraries/Xaw3d/default.nix +++ b/pkgs/development/libraries/Xaw3d/default.nix @@ -8,6 +8,7 @@ stdenv.mkDerivation { url = https://www.x.org/releases/individual/lib/libXaw3d-1.6.3.tar.bz2; sha256 = "0i653s8g25cc0mimkwid9366bqkbyhdyjhckx7bw77j20hzrkfid"; }; + dontUseImakeConfigure = true; nativeBuildInputs = [ pkgconfig bison flex imake gccmakedep ]; buildInputs = [ libXpm libXp ]; propagatedBuildInputs = [ xlibsWrapper libXmu ];