diff --git a/pkgs/applications/audio/cadence/default.nix b/pkgs/applications/audio/cadence/default.nix index cd1d837e1dd..52f5a6540e8 100644 --- a/pkgs/applications/audio/cadence/default.nix +++ b/pkgs/applications/audio/cadence/default.nix @@ -1,6 +1,7 @@ { stdenv , mkDerivation , lib +, fetchpatch , fetchzip , pkgconfig , qtbase @@ -17,6 +18,14 @@ sha256 = "07z8grnnpkd0nf3y3r6qjlk1jlzrbhdrp9mnhrhhmws54p1bhl20"; }; + patches = [ + # Fix installation without DESTDIR + (fetchpatch { + url = "https://github.com/falkTX/Cadence/commit/1fd3275e7daf4b75f59ef1f85a9e2e93bd5c0731.patch"; + sha256 = "0q791jsh8vmjg678dzhbp1ykq8xrrlxl1mbgs3g8if1ccj210vd8"; + }) + ]; + nativeBuildInputs = [ pkgconfig ]; @@ -26,8 +35,8 @@ ]; makeFlags = [ - "PREFIX=''" - "DESTDIR=${placeholder "out"}" + "PREFIX=${placeholder "out"}" + "SYSCONFDIR=${placeholder "out"}/etc" ]; propagatedBuildInputs = with python3Packages; [ diff --git a/pkgs/applications/audio/projectm/default.nix b/pkgs/applications/audio/projectm/default.nix index e7aace763a1..347774010ae 100644 --- a/pkgs/applications/audio/projectm/default.nix +++ b/pkgs/applications/audio/projectm/default.nix @@ -37,15 +37,15 @@ stdenv.mkDerivation { nativeBuildInputs = [ pkgconfig cmake ]; - cmakeFlags = '' - -DprojectM_FONT_MENU=${ttf_bitstream_vera}/share/fonts/truetype/VeraMono.ttf - -DprojectM_FONT_TITLE=${ttf_bitstream_vera}/share/fonts/truetype/Vera.ttf - -DINCLUDE-PROJECTM-TEST=OFF - -DINCLUDE-PROJECTM-QT=${if withQt then "ON" else "OFF"} - -DINCLUDE-PROJECTM-LIBVISUAL=${if withLibvisual then "ON" else "OFF"} - -DINCLUDE-PROJECTM-JACK=${if withJack then "ON" else "OFF"} - -DINCLUDE-PROJECTM-PULSEAUDIO=${if withPulseAudio then "ON" else "OFF"} - ''; + cmakeFlags = [ + "-DprojectM_FONT_MENU=${ttf_bitstream_vera}/share/fonts/truetype/VeraMono.ttf" + "-DprojectM_FONT_TITLE=${ttf_bitstream_vera}/share/fonts/truetype/Vera.ttf" + "-DINCLUDE-PROJECTM-TEST=OFF" + "-DINCLUDE-PROJECTM-QT=${if withQt then "ON" else "OFF"}" + "-DINCLUDE-PROJECTM-LIBVISUAL=${if withLibvisual then "ON" else "OFF"}" + "-DINCLUDE-PROJECTM-JACK=${if withJack then "ON" else "OFF"}" + "-DINCLUDE-PROJECTM-PULSEAUDIO=${if withPulseAudio then "ON" else "OFF"}" + ]; buildInputs = with stdenv.lib; [ glew ftgl ] diff --git a/pkgs/applications/editors/emacs/default.nix b/pkgs/applications/editors/emacs/default.nix index 2862ba7184f..98653517b5e 100644 --- a/pkgs/applications/editors/emacs/default.nix +++ b/pkgs/applications/editors/emacs/default.nix @@ -97,7 +97,7 @@ stdenv.mkDerivation rec { done ''; - installTargets = "tags install"; + installTargets = [ "tags" "install" ]; postInstall = '' mkdir -p $out/share/emacs/site-lisp diff --git a/pkgs/applications/misc/osm2xmap/default.nix b/pkgs/applications/misc/osm2xmap/default.nix index 8ffc8ec69fe..1c19238541c 100644 --- a/pkgs/applications/misc/osm2xmap/default.nix +++ b/pkgs/applications/misc/osm2xmap/default.nix @@ -12,18 +12,15 @@ stdenv.mkDerivation rec { }; makeFlags = [ - "GIT_VERSION=$(version)" + "GIT_VERSION=${version}" "GIT_TIMESTAMP=" - "SHAREDIR=$(out)/share/" - "INSTALL_BINDIR=$(out)/bin" - "INSTALL_MANDIR=$(out)/share/man/man1" - "INSTALL_SHAREDIR=$(out)/share/" + "SHAREDIR=${placeholder ''out''}/share/osm2xmap" + "INSTALL_BINDIR=${placeholder ''out''}/bin" + "INSTALL_MANDIR=${placeholder ''out''}/share/man/man1" ]; NIX_CFLAGS_COMPILE = [ "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" ]; - installFlags = [ "DESTDIR=$(out)" ]; - buildInputs = [ libroxml proj libyamlcpp boost ]; meta = with stdenv.lib; { diff --git a/pkgs/applications/networking/mailreaders/lumail/default.nix b/pkgs/applications/networking/mailreaders/lumail/default.nix index 0a670b2b9a6..44b97fb3793 100644 --- a/pkgs/applications/networking/mailreaders/lumail/default.nix +++ b/pkgs/applications/networking/mailreaders/lumail/default.nix @@ -52,7 +52,7 @@ stdenv.mkDerivation { sed -e "s|^#\!\(.*/perl.*\)$|#\!\1$perlFlags|" -i perl.d/imap-proxy ''; - buildFlags = if debugBuild then "lumail2-debug" else ""; + buildFlags = stdenv.lib.optional debugBuild "lumail2-debug"; installPhase = '' mkdir -p $out/bin || true diff --git a/pkgs/applications/networking/p2p/eiskaltdcpp/default.nix b/pkgs/applications/networking/p2p/eiskaltdcpp/default.nix index 77aee30d38b..2692e5360ce 100644 --- a/pkgs/applications/networking/p2p/eiskaltdcpp/default.nix +++ b/pkgs/applications/networking/p2p/eiskaltdcpp/default.nix @@ -39,20 +39,20 @@ stdenv.mkDerivation rec { }) ]; - cmakeFlags = '' - -DUSE_ASPELL=ON - -DUSE_QT_QML=ON - -DFREE_SPACE_BAR_C=ON - -DUSE_MINIUPNP=ON - -DLOCAL_MINIUPNP=ON - -DDBUS_NOTIFY=ON - -DUSE_JS=ON - -DPERL_REGEX=ON - -DUSE_CLI_XMLRPC=ON - -DWITH_SOUNDS=ON - -DLUA_SCRIPT=ON - -DWITH_LUASCRIPTS=ON - ''; + cmakeFlags = [ + "-DUSE_ASPELL=ON" + "-DUSE_QT_QML=ON" + "-DFREE_SPACE_BAR_C=ON" + "-DUSE_MINIUPNP=ON" + "-DLOCAL_MINIUPNP=ON" + "-DDBUS_NOTIFY=ON" + "-DUSE_JS=ON" + "-DPERL_REGEX=ON" + "-DUSE_CLI_XMLRPC=ON" + "-DWITH_SOUNDS=ON" + "-DLUA_SCRIPT=ON" + "-DWITH_LUASCRIPTS=ON" + ]; enableParallelBuilding = true; diff --git a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix index d720f5ea078..4dc6f038ce7 100644 --- a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix +++ b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix @@ -1,4 +1,6 @@ -{ stdenv, fetchurl, cmake +{ stdenv +, fetchurl +, cmake , singlePrec ? true , mpiEnabled ? false , fftw @@ -6,7 +8,6 @@ , perl }: - stdenv.mkDerivation { name = "gromacs-2019.4"; @@ -19,18 +20,27 @@ stdenv.mkDerivation { buildInputs = [ fftw perl ] ++ (stdenv.lib.optionals mpiEnabled [ openmpi ]); - cmakeFlags = '' - ${if singlePrec then "-DGMX_DOUBLE=OFF" else "-DGMX_DOUBLE=ON -DGMX_DEFAULT_SUFFIX=OFF"} - ${if mpiEnabled then "-DGMX_MPI:BOOL=TRUE - -DGMX_CPU_ACCELERATION:STRING=SSE4.1 - -DGMX_OPENMP:BOOL=TRUE - -DGMX_THREAD_MPI:BOOL=FALSE" - else "-DGMX_MPI:BOOL=FALSE" } - ''; + cmakeFlags = ( + if singlePrec then [ + "-DGMX_DOUBLE=OFF" + ] else [ + "-DGMX_DOUBLE=ON" + "-DGMX_DEFAULT_SUFFIX=OFF" + ] + ) ++ ( + if mpiEnabled then [ + "-DGMX_MPI:BOOL=TRUE" + "-DGMX_CPU_ACCELERATION:STRING=SSE4.1" + "-DGMX_OPENMP:BOOL=TRUE" + "-DGMX_THREAD_MPI:BOOL=FALSE" + ] else [ + "-DGMX_MPI:BOOL=FALSE" + ] + ); meta = with stdenv.lib; { - homepage = "http://www.gromacs.org"; - license = licenses.gpl2; + homepage = "http://www.gromacs.org"; + license = licenses.gpl2; description = "Molecular dynamics software package"; longDescription = '' GROMACS is a versatile package to perform molecular dynamics, diff --git a/pkgs/applications/video/xawtv/default.nix b/pkgs/applications/video/xawtv/default.nix index db9a5ce7850..676c218776c 100644 --- a/pkgs/applications/video/xawtv/default.nix +++ b/pkgs/applications/video/xawtv/default.nix @@ -1,25 +1,54 @@ -{stdenv, fetchurl, ncurses, libjpeg, libX11, libXt, alsaLib, aalib, libXft, xorgproto, libv4l -, libFS, libXaw, libXpm, libXext, libSM, libICE, perl, linux}: +{ stdenv +, fetchurl +, ncurses +, libjpeg +, libX11 +, libXt +, alsaLib +, aalib +, libXft +, xorgproto +, libv4l +, libFS +, libXaw +, libXpm +, libXext +, libSM +, libICE +, perl +}: stdenv.mkDerivation rec { name = "xawtv-3.106"; + src = fetchurl { url = "https://linuxtv.org/downloads/xawtv/${name}.tar.bz2"; sha256 = "174wd36rk0k23mgx9nlnpc398yd1f0wiv060963axg6sz0v4rksp"; }; - preConfigure = '' - export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${linux}/lib/modules/${linux.modDirVersion}/build" - ''; + buildInputs = [ + ncurses + libjpeg + libX11 + libXt + libXft + xorgproto + libFS + perl + alsaLib + aalib + libXaw + libXpm + libXext + libSM + libICE + libv4l + ]; - configureFlags= [ "--prefix=" ]; - - NIX_LDFLAGS = "-lgcc_s"; - - makeFlags = "SUID_ROOT= DESTDIR=\$(out) PREFIX="; - - buildInputs = [ncurses libjpeg libX11 libXt libXft xorgproto libFS perl alsaLib aalib - libXaw libXpm libXext libSM libICE libv4l]; + makeFlags = [ + "SUID_ROOT=" # do not try to setuid + "resdir=${placeholder ''out''}/share/X11" + ]; meta = { description = "TV application for Linux with apps and tools such as a teletext browser"; @@ -28,5 +57,4 @@ stdenv.mkDerivation rec { maintainers = with stdenv.lib.maintainers; [ domenkozar ]; platforms = stdenv.lib.platforms.linux; }; - } diff --git a/pkgs/applications/virtualization/runc/default.nix b/pkgs/applications/virtualization/runc/default.nix index c850a18c867..48bd81f383a 100644 --- a/pkgs/applications/virtualization/runc/default.nix +++ b/pkgs/applications/virtualization/runc/default.nix @@ -22,14 +22,14 @@ buildGoPackage rec { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ go-md2man libseccomp libapparmor apparmor-parser which ]; - makeFlags = ''BUILDTAGS+=seccomp BUILDTAGS+=apparmor''; + makeFlags = [ "BUILDTAGS+=seccomp" "BUILDTAGS+=apparmor" ]; buildPhase = '' cd go/src/${goPackagePath} patchShebangs . substituteInPlace libcontainer/apparmor/apparmor.go \ --replace /sbin/apparmor_parser ${apparmor-parser}/bin/apparmor_parser - make ${makeFlags} runc + make ${toString makeFlags} runc ''; installPhase = '' diff --git a/pkgs/build-support/agda/default.nix b/pkgs/build-support/agda/default.nix index 3e5d8e6c384..0d054eaa546 100644 --- a/pkgs/build-support/agda/default.nix +++ b/pkgs/build-support/agda/default.nix @@ -47,9 +47,9 @@ let includeDirs = self.buildDependsAgdaShareAgda ++ self.sourceDirectories ++ self.topSourceDirectories ++ [ "." ]; - buildFlags = concatStringsSep " " (map (x: "-i " + x) self.includeDirs); + buildFlags = stdenv.lib.concatMap (x: ["-i" x]) self.includeDirs; - agdaWithArgs = "${Agda}/bin/agda ${self.buildFlags}"; + agdaWithArgs = "${Agda}/bin/agda ${toString self.buildFlags}"; buildPhase = '' runHook preBuild diff --git a/pkgs/data/misc/media-player-info/default.nix b/pkgs/data/misc/media-player-info/default.nix index 6d00f34e978..0ac5dc51d6b 100644 --- a/pkgs/data/misc/media-player-info/default.nix +++ b/pkgs/data/misc/media-player-info/default.nix @@ -19,9 +19,7 @@ in patchShebangs ./tools ''; - preConfigure = '' - configureFlags="$configureFlags --with-udevdir=$out/lib/udev" - ''; + configureFlags = [ "--with-udevdir=${placeholder "out"}/lib/udev" ]; meta = with stdenv.lib; { description = "A repository of data files describing media player capabilities"; diff --git a/pkgs/development/coq-modules/mathcomp/default.nix b/pkgs/development/coq-modules/mathcomp/default.nix index 3c0a9632c95..647a13afa8f 100644 --- a/pkgs/development/coq-modules/mathcomp/default.nix +++ b/pkgs/development/coq-modules/mathcomp/default.nix @@ -92,7 +92,7 @@ let attrValues (mkMathcompGenFrom overrides (mathcomp-deps mathcomp-pkg) mathcomp-version); enableParallelBuilding = true; - buildFlags = optionalString withDoc "doc"; + buildFlags = optional withDoc "doc"; COQBIN = "${coq}/bin/"; diff --git a/pkgs/development/guile-modules/guile-sdl/default.nix b/pkgs/development/guile-modules/guile-sdl/default.nix index 41bfb2ef62a..eff4c699625 100644 --- a/pkgs/development/guile-modules/guile-sdl/default.nix +++ b/pkgs/development/guile-modules/guile-sdl/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { name = "sdl-env"; paths = buildInputs; }; - in "SDLMINUSI=-I${sdl}/include/SDL"; + in [ "SDLMINUSI=-I${sdl}/include/SDL" ]; meta = with stdenv.lib; { description = "Guile bindings for SDL"; diff --git a/pkgs/development/interpreters/elixir/generic-builder.nix b/pkgs/development/interpreters/elixir/generic-builder.nix index b7e98af2109..a1186557101 100644 --- a/pkgs/development/interpreters/elixir/generic-builder.nix +++ b/pkgs/development/interpreters/elixir/generic-builder.nix @@ -10,7 +10,7 @@ } @ args: let - inherit (stdenv.lib) getVersion versionAtLeast; + inherit (stdenv.lib) getVersion versionAtLeast optional; in assert versionAtLeast (getVersion erlang) minimumOTPVersion; @@ -29,9 +29,7 @@ in inherit debugInfo; - buildFlags = if debugInfo - then "ERL_COMPILER_OPTIONS=debug_info" - else ""; + buildFlags = optional debugInfo "ERL_COMPILER_OPTIONS=debug_info"; preBuild = '' # The build process uses ./rebar. Link it to the nixpkgs rebar diff --git a/pkgs/development/libraries/gdcm/default.nix b/pkgs/development/libraries/gdcm/default.nix index c3f62a5df94..0b5e0af84ba 100644 --- a/pkgs/development/libraries/gdcm/default.nix +++ b/pkgs/development/libraries/gdcm/default.nix @@ -16,11 +16,11 @@ stdenv.mkDerivation rec { cd ../build ''; - cmakeFlags = '' - -DGDCM_BUILD_APPLICATIONS=ON - -DGDCM_BUILD_SHARED_LIBS=ON - -DGDCM_USE_VTK=ON - ''; + cmakeFlags = [ + "-DGDCM_BUILD_APPLICATIONS=ON" + "-DGDCM_BUILD_SHARED_LIBS=ON" + "-DGDCM_USE_VTK=ON" + ]; enableParallelBuilding = true; buildInputs = [ cmake vtk ] ++ stdenv.lib.optional stdenv.isDarwin [ darwin.apple_sdk.frameworks.ApplicationServices darwin.apple_sdk.frameworks.Cocoa ]; diff --git a/pkgs/development/libraries/libdbusmenu-qt/default.nix b/pkgs/development/libraries/libdbusmenu-qt/default.nix index 72c3ca0e2b0..6b4be0db414 100644 --- a/pkgs/development/libraries/libdbusmenu-qt/default.nix +++ b/pkgs/development/libraries/libdbusmenu-qt/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation { buildInputs = [ qt4 ]; nativeBuildInputs = [ cmake ]; - cmakeFlags = "-DWITH_DOC=OFF"; + cmakeFlags = [ "-DWITH_DOC=OFF" ]; meta = with stdenv.lib; { description = "Provides a Qt implementation of the DBusMenu spec"; diff --git a/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix b/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix index 2ae4eec99ec..279dcb6bc83 100644 --- a/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix +++ b/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { buildInputs = [ qtbase ]; nativeBuildInputs = [ cmake ]; - cmakeFlags = "-DWITH_DOC=OFF"; + cmakeFlags = [ "-DWITH_DOC=OFF" ]; meta = with stdenv.lib; { homepage = https://launchpad.net/libdbusmenu-qt; diff --git a/pkgs/development/libraries/libnabo/default.nix b/pkgs/development/libraries/libnabo/default.nix index 9414ebdcc2a..4c3ceee1e56 100644 --- a/pkgs/development/libraries/libnabo/default.nix +++ b/pkgs/development/libraries/libnabo/default.nix @@ -15,9 +15,9 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - cmakeFlags = " - -DEIGEN_INCLUDE_DIR=${eigen}/include/eigen3 - "; + cmakeFlags = [ + "-DEIGEN_INCLUDE_DIR=${eigen}/include/eigen3" + ]; doCheck = true; checkTarget = "test"; diff --git a/pkgs/development/libraries/libpointmatcher/default.nix b/pkgs/development/libraries/libpointmatcher/default.nix index cd841a9d8f8..20b2988417c 100644 --- a/pkgs/development/libraries/libpointmatcher/default.nix +++ b/pkgs/development/libraries/libpointmatcher/default.nix @@ -16,9 +16,9 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - cmakeFlags = " - -DEIGEN_INCLUDE_DIR=${eigen}/include/eigen3 - "; + cmakeFlags = [ + "-DEIGEN_INCLUDE_DIR=${eigen}/include/eigen3" + ]; doCheck = true; checkPhase = '' diff --git a/pkgs/development/libraries/libtcod/default.nix b/pkgs/development/libraries/libtcod/default.nix index 5a7fb3395eb..d81f3f82001 100644 --- a/pkgs/development/libraries/libtcod/default.nix +++ b/pkgs/development/libraries/libtcod/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation { echo 'INSTALL(DIRECTORY include DESTINATION .)' >> CMakeLists.txt ''; - cmakeFlags="-DLIBTCOD_SAMPLES=OFF"; + cmakeFlags = [ "-DLIBTCOD_SAMPLES=OFF" ]; buildInputs = [ cmake SDL libGLU libGL upx zlib ]; diff --git a/pkgs/development/libraries/phonon/backends/gstreamer.nix b/pkgs/development/libraries/phonon/backends/gstreamer.nix index d9267827e77..20723322c1d 100644 --- a/pkgs/development/libraries/phonon/backends/gstreamer.nix +++ b/pkgs/development/libraries/phonon/backends/gstreamer.nix @@ -52,10 +52,6 @@ stdenv.mkDerivation rec { qtx11extras ]; - # cleanup: the build system creates (empty) $out/$out/share/icons (double prefix) - # if DESTDIR is unset - DESTDIR="/"; - nativeBuildInputs = [ cmake pkgconfig diff --git a/pkgs/development/libraries/tbb/default.nix b/pkgs/development/libraries/tbb/default.nix index 0ec5d8ad15d..18f9e541acd 100644 --- a/pkgs/development/libraries/tbb/default.nix +++ b/pkgs/development/libraries/tbb/default.nix @@ -11,10 +11,8 @@ with stdenv.lib; stdenv.mkDerivation rec { sha256 = "1a39nflw7b2n51jfp3fdprnkpgzaspzww1dckfvaigflfli9s8rj"; }; - makeFlags = concatStringsSep " " ( - optional (compiler != null) "compiler=${compiler}" ++ - optional (stdver != null) "stdver=${stdver}" - ); + makeFlags = optional (compiler != null) "compiler=${compiler}" + ++ optional (stdver != null) "stdver=${stdver}"; patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ./glibc-struct-mallinfo.patch; diff --git a/pkgs/development/python-modules/dbf/default.nix b/pkgs/development/python-modules/dbf/default.nix index f81b7d1c8bf..a2f7b603b84 100644 --- a/pkgs/development/python-modules/dbf/default.nix +++ b/pkgs/development/python-modules/dbf/default.nix @@ -9,7 +9,7 @@ buildPythonPackage rec { sha256 = "01d71vya2x87f3kl9x0s8xp0n7wixn6ksrd054y7idq3n1mjaxzh"; }; - propagatedBuildInputs = [ aenum ] ++ stdenv.lib.optional (pythonOlder "3.4") [ enum34 ]; + propagatedBuildInputs = [ aenum ] ++ stdenv.lib.optional (pythonOlder "3.4") enum34; doCheck = !isPy3k; # tests are not yet ported. diff --git a/pkgs/development/python-modules/hypothesis/default.nix b/pkgs/development/python-modules/hypothesis/default.nix index ec9c5ecefa0..9e3b0cdc894 100644 --- a/pkgs/development/python-modules/hypothesis/default.nix +++ b/pkgs/development/python-modules/hypothesis/default.nix @@ -22,7 +22,7 @@ buildPythonPackage rec { postUnpack = "sourceRoot=$sourceRoot/hypothesis-python"; - propagatedBuildInputs = [ attrs coverage ] ++ lib.optional (!isPy3k) [ enum34 ]; + propagatedBuildInputs = [ attrs coverage ] ++ lib.optional (!isPy3k) enum34; checkInputs = [ pytest pytest_xdist flaky mock pexpect ]; inherit doCheck; diff --git a/pkgs/development/python-modules/nipype/default.nix b/pkgs/development/python-modules/nipype/default.nix index 13c35999cf9..ee3c16f01b6 100644 --- a/pkgs/development/python-modules/nipype/default.nix +++ b/pkgs/development/python-modules/nipype/default.nix @@ -79,7 +79,7 @@ buildPythonPackage rec { simplejson traits xvfbwrapper - ] ++ stdenv.lib.optional (!isPy3k) [ + ] ++ stdenv.lib.optionals (!isPy3k) [ configparser futures pathlib2 # darwin doesn't receive this transitively, but it is in install_requires diff --git a/pkgs/development/python-modules/pyside/shiboken.nix b/pkgs/development/python-modules/pyside/shiboken.nix index 42ad55ad0b9..a968935dc06 100644 --- a/pkgs/development/python-modules/pyside/shiboken.nix +++ b/pkgs/development/python-modules/pyside/shiboken.nix @@ -27,7 +27,7 @@ buildPythonPackage rec { # gcc6 patch was also sent upstream: https://github.com/pyside/Shiboken/pull/86 patches = [ ./gcc6.patch ] ++ (lib.optional (isPy35 || isPy36 || isPy37) ./shiboken_py35.patch); - cmakeFlags = if isPy3k then "-DUSE_PYTHON3=TRUE" else null; + cmakeFlags = lib.optional isPy3k "-DUSE_PYTHON3=TRUE"; meta = { description = "Plugin (front-end) for pyside-generatorrunner, that generates bindings for C++ libraries using CPython source code"; diff --git a/pkgs/development/python-modules/pytest-benchmark/default.nix b/pkgs/development/python-modules/pytest-benchmark/default.nix index b43c00e42d9..924f16694c5 100644 --- a/pkgs/development/python-modules/pytest-benchmark/default.nix +++ b/pkgs/development/python-modules/pytest-benchmark/default.nix @@ -19,7 +19,7 @@ buildPythonPackage rec { sha256 = "1hslzzinpwc1zqhbpllqh3sllmiyk69pcycl7ahr0rz3micgwczj"; }; - propagatedBuildInputs = [ pytest py-cpuinfo ] ++ lib.optional (pythonOlder "3.4") [ pathlib statistics ]; + propagatedBuildInputs = [ pytest py-cpuinfo ] ++ lib.optionals (pythonOlder "3.4") [ pathlib statistics ]; meta = { description = "Py.test fixture for benchmarking code"; diff --git a/pkgs/development/python-modules/quandl/default.nix b/pkgs/development/python-modules/quandl/default.nix index fc4c192968f..385c51bcd3b 100644 --- a/pkgs/development/python-modules/quandl/default.nix +++ b/pkgs/development/python-modules/quandl/default.nix @@ -40,7 +40,7 @@ buildPythonPackage rec { python-dateutil six more-itertools - ] ++ lib.optional (!isPy3k) [ + ] ++ lib.optionals (!isPy3k) [ pyOpenSSL ndg-httpsclient pyasn1 diff --git a/pkgs/development/python-modules/tifffile/default.nix b/pkgs/development/python-modules/tifffile/default.nix index 1fd33c5d7e4..8aafc39fc34 100644 --- a/pkgs/development/python-modules/tifffile/default.nix +++ b/pkgs/development/python-modules/tifffile/default.nix @@ -23,7 +23,7 @@ buildPythonPackage rec { ''; propagatedBuildInputs = [ numpy ] - ++ lib.optional isPy27 [ futures enum34 pathlib ]; + ++ lib.optionals isPy27 [ futures enum34 pathlib ]; meta = with lib; { description = "Read and write image data from and to TIFF files."; diff --git a/pkgs/development/tools/analysis/cppcheck/default.nix b/pkgs/development/tools/analysis/cppcheck/default.nix index 8b6eb71f90f..1b7467608be 100644 --- a/pkgs/development/tools/analysis/cppcheck/default.nix +++ b/pkgs/development/tools/analysis/cppcheck/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { buildInputs = [ pcre ]; nativeBuildInputs = [ libxslt docbook_xsl docbook_xml_dtd_45 ]; - makeFlags = ''PREFIX=$(out) CFGDIR=$(out)/cfg HAVE_RULES=yes''; + makeFlags = [ "PREFIX=$(out)" "CFGDIR=$(out)/cfg" "HAVE_RULES=yes" ]; outputs = [ "out" "man" ]; diff --git a/pkgs/development/tools/misc/universal-ctags/default.nix b/pkgs/development/tools/misc/universal-ctags/default.nix index 90605771958..c104adc78cc 100644 --- a/pkgs/development/tools/misc/universal-ctags/default.nix +++ b/pkgs/development/tools/misc/universal-ctags/default.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation { doCheck = true; - checkFlags = "units"; + checkFlags = [ "units" ]; meta = with stdenv.lib; { description = "A maintained ctags implementation"; diff --git a/pkgs/games/frotz/default.nix b/pkgs/games/frotz/default.nix index 3dbd7bd928b..788280fd820 100644 --- a/pkgs/games/frotz/default.nix +++ b/pkgs/games/frotz/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "0gjkk4gxzqmxfdirrz2lr0bms6l9fc31vkmlywigkbdlh8wxgypp"; }; - makeFlags = ''CC=cc PREFIX=$(out) CURSES=-lncurses''; + makeFlags = [ "CC=cc" "PREFIX=$(out)" "CURSES=-lncurses" ]; buildInputs = [ ncurses ]; diff --git a/pkgs/games/xbomb/default.nix b/pkgs/games/xbomb/default.nix index 946bff79f97..54d6c320f18 100644 --- a/pkgs/games/xbomb/default.nix +++ b/pkgs/games/xbomb/default.nix @@ -9,10 +9,9 @@ stdenv.mkDerivation rec { buildInputs = [ libX11 libXaw ]; - preBuild = '' - substituteInPlace Makefile \ - --replace /usr/local $out - ''; + makeFlags = [ + "INSTDIR=${placeholder ''out''}" + ]; meta = with stdenv.lib; { homepage = http://www.gedanken.org.uk/software/xbomb/; diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix index 658c8441276..7030bc0ca31 100644 --- a/pkgs/os-specific/linux/apparmor/default.nix +++ b/pkgs/os-specific/linux/apparmor/default.nix @@ -124,8 +124,8 @@ let prePatch = prePatchCommon; inherit patches; postPatch = "cd ./utils"; - makeFlags = ''LANGS=''; - installFlags = ''DESTDIR=$(out) BINDIR=$(out)/bin VIM_INSTALL_PATH=$(out)/share PYPREFIX=''; + makeFlags = [ "LANGS=" ]; + installFlags = [ "DESTDIR=$(out)" "BINDIR=$(out)/bin" "VIM_INSTALL_PATH=$(out)/share" "PYPREFIX=" ]; postInstall = '' for prog in aa-audit aa-autodep aa-cleanprof aa-complain aa-disable aa-enforce aa-genprof aa-logprof aa-mergeprof aa-status aa-unconfined ; do @@ -162,8 +162,8 @@ let prePatch = prePatchCommon; postPatch = "cd ./binutils"; - makeFlags = ''LANGS= USE_SYSTEM=1''; - installFlags = ''DESTDIR=$(out) BINDIR=$(out)/bin''; + makeFlags = [ "LANGS=" "USE_SYSTEM=1" ]; + installFlags = [ "DESTDIR=$(out)" "BINDIR=$(out)/bin" ]; inherit doCheck; @@ -187,8 +187,11 @@ let ''; inherit patches; postPatch = "cd ./parser"; - makeFlags = ''LANGS= USE_SYSTEM=1 INCLUDEDIR=${libapparmor}/include AR=${stdenv.cc.bintools.targetPrefix}ar''; - installFlags = ''DESTDIR=$(out) DISTRO=unknown''; + makeFlags = [ + "LANGS=" "USE_SYSTEM=1" "INCLUDEDIR=${libapparmor}/include" + "AR=${stdenv.cc.bintools.targetPrefix}ar" + ]; + installFlags = [ "DESTDIR=$(out)" "DISTRO=unknown" ]; inherit doCheck; @@ -204,8 +207,8 @@ let buildInputs = [ libapparmor pam ]; postPatch = "cd ./changehat/pam_apparmor"; - makeFlags = ''USE_SYSTEM=1''; - installFlags = ''DESTDIR=$(out)''; + makeFlags = [ "USE_SYSTEM=1" ]; + installFlags = [ "DESTDIR=$(out)" ]; inherit doCheck; @@ -219,7 +222,7 @@ let nativeBuildInputs = [ which ]; postPatch = "cd ./profiles"; - installFlags = ''DESTDIR=$(out) EXTRAS_DEST=$(out)/share/apparmor/extra-profiles''; + installFlags = [ "DESTDIR=$(out)" "EXTRAS_DEST=$(out)/share/apparmor/extra-profiles" ]; inherit doCheck; diff --git a/pkgs/os-specific/linux/firmware/fwupd/default.nix b/pkgs/os-specific/linux/firmware/fwupd/default.nix index 1f6a7145b77..aa2d9978178 100644 --- a/pkgs/os-specific/linux/firmware/fwupd/default.nix +++ b/pkgs/os-specific/linux/firmware/fwupd/default.nix @@ -211,6 +211,7 @@ stdenv.mkDerivation rec { "--localstatedir=/var" "--sysconfdir=/etc" "-Dsysconfdir_install=${placeholder "out"}/etc" + "--libexecdir=${placeholder "out"}/libexec" ] ++ stdenv.lib.optionals (!haveDell) [ "-Dplugin_dell=false" "-Dplugin_synaptics=false" @@ -220,12 +221,6 @@ stdenv.mkDerivation rec { "-Dplugin_flashrom=true" ]; - # TODO: We need to be able to override the directory flags from meson setup hook - # better – declaring them multiple times might become an error. - preConfigure = '' - mesonFlagsArray+=("--libexecdir=$out/libexec") - ''; - postInstall = '' moveToOutput share/installed-tests "$installedTests" wrapProgram $installedTests/share/installed-tests/fwupd/hardware.py \ diff --git a/pkgs/os-specific/linux/forktty/default.nix b/pkgs/os-specific/linux/forktty/default.nix index 6402b5c69d8..66570bac942 100644 --- a/pkgs/os-specific/linux/forktty/default.nix +++ b/pkgs/os-specific/linux/forktty/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation { mkdir -p "$out/bin" mkdir -p "$out/share/man/man8" ''; - makeFlags='' prefix="''${out}" manprefix="''${out}/share/" ''; + makeFlags = [ "prefix=$(out)" "manprefix=$(out)/share/" ]; meta = { inherit (s) version; description = ''Tool to detach from controlling TTY and attach to another''; diff --git a/pkgs/tools/filesystems/fatresize/default.nix b/pkgs/tools/filesystems/fatresize/default.nix index a00104510bf..5a60f8c055e 100644 --- a/pkgs/tools/filesystems/fatresize/default.nix +++ b/pkgs/tools/filesystems/fatresize/default.nix @@ -25,9 +25,7 @@ stdenv.mkDerivation rec { # Filesystem resize functions were reintroduced in parted 3.1 due to no other available free alternatives # but in a sepparate library -> libparted-fs-resize --- that's why the added LDFLAG - makeFlags = '' - LDFLAGS=-lparted-fs-resize - ''; + makeFlags = [ "LDFLAGS=-lparted-fs-resize" ]; propagatedBuildInputs = [ parted utillinux ]; diff --git a/pkgs/tools/inputmethods/fcitx/unwrapped.nix b/pkgs/tools/inputmethods/fcitx/unwrapped.nix index 636cb518fd2..60de9e6910e 100644 --- a/pkgs/tools/inputmethods/fcitx/unwrapped.nix +++ b/pkgs/tools/inputmethods/fcitx/unwrapped.nix @@ -75,20 +75,20 @@ stdenv.mkDerivation rec { libxkbcommon libxml2 dbus cairo gtk2 gtk3 pango qt4 libuuid ]; - cmakeFlags = '' - -DENABLE_QT_IM_MODULE=ON - -DENABLE_GTK2_IM_MODULE=ON - -DENABLE_GTK3_IM_MODULE=ON - -DENABLE_GIR=OFF - -DENABLE_OPENCC=OFF - -DENABLE_PRESAGE=OFF - -DENABLE_XDGAUTOSTART=OFF - -DENABLE_PINYIN=${if withPinyin then "ON" else "OFF"} - -DENABLE_TABLE=ON - -DENABLE_SPELL=ON - -DENABLE_QT_GUI=ON - -DXKB_RULES_XML_FILE='${xkeyboard_config}/share/X11/xkb/rules/evdev.xml' - ''; + cmakeFlags = [ + "-DENABLE_QT_IM_MODULE=ON" + "-DENABLE_GTK2_IM_MODULE=ON" + "-DENABLE_GTK3_IM_MODULE=ON" + "-DENABLE_GIR=OFF" + "-DENABLE_OPENCC=OFF" + "-DENABLE_PRESAGE=OFF" + "-DENABLE_XDGAUTOSTART=OFF" + "-DENABLE_PINYIN=${if withPinyin then "ON" else "OFF"}" + "-DENABLE_TABLE=ON" + "-DENABLE_SPELL=ON" + "-DENABLE_QT_GUI=ON" + "-DXKB_RULES_XML_FILE='${xkeyboard_config}/share/X11/xkb/rules/evdev.xml'" + ]; meta = with stdenv.lib; { homepage = https://github.com/fcitx/fcitx; diff --git a/pkgs/tools/misc/cpulimit/default.nix b/pkgs/tools/misc/cpulimit/default.nix index 547e2a1f059..1978476a12d 100644 --- a/pkgs/tools/misc/cpulimit/default.nix +++ b/pkgs/tools/misc/cpulimit/default.nix @@ -9,12 +9,13 @@ stdenv.mkDerivation rec { sha256 = "0xf0r6zxaqan1drz61nqf95p2pkiiihpvrjhrr9dx9j3vswyx31g"; }; - buildFlags = with stdenv; + buildFlags = with stdenv; [ ( if isDarwin then "osx" else if isFreeBSD then "freebsd" - else "cpulimit"; + else "cpulimit" + ) ]; - installFlags = "PREFIX=$(out)"; + installFlags = [ "PREFIX=$(out)" ]; meta = with stdenv.lib; { homepage = http://limitcpu.sourceforge.net/; diff --git a/pkgs/tools/misc/ent/default.nix b/pkgs/tools/misc/ent/default.nix index 1c0401e2ead..7e8d04b4209 100644 --- a/pkgs/tools/misc/ent/default.nix +++ b/pkgs/tools/misc/ent/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation { buildInputs = [ unzip ]; - buildFlags = if stdenv.cc.isClang then [ "CC=clang" ] else null; + buildFlags = stdenv.lib.optional stdenv.cc.isClang "CC=clang"; installPhase = '' mkdir -p $out/bin diff --git a/pkgs/tools/networking/miniupnpc/default.nix b/pkgs/tools/networking/miniupnpc/default.nix index dc0a4457dde..ebe6a60291a 100644 --- a/pkgs/tools/networking/miniupnpc/default.nix +++ b/pkgs/tools/networking/miniupnpc/default.nix @@ -11,14 +11,13 @@ let inherit sha256; }; - nativeBuildInputs = [] ++ - stdenv.lib.optionals stdenv.isDarwin [ which cctools ]; + nativeBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ which cctools ]; patches = stdenv.lib.optional stdenv.isFreeBSD ./freebsd.patch; doCheck = !stdenv.isFreeBSD; - makeFlags = "PREFIX=$(out) INSTALLPREFIX=$(out)"; + makeFlags = [ "PREFIX=$(out)" "INSTALLPREFIX=$(out)" ]; meta = with stdenv.lib; { homepage = http://miniupnp.free.fr/; diff --git a/pkgs/tools/networking/uwimap/default.nix b/pkgs/tools/networking/uwimap/default.nix index bc500a01c11..b687f1db017 100644 --- a/pkgs/tools/networking/uwimap/default.nix +++ b/pkgs/tools/networking/uwimap/default.nix @@ -8,12 +8,12 @@ stdenv.mkDerivation ({ sha256 = "0a2a00hbakh0640r2wdpnwr8789z59wnk7rfsihh3j0vbhmmmqak"; }; - makeFlags = if stdenv.isDarwin + makeFlags = [ (if stdenv.isDarwin then "osx" - else "lnp" # Linux with PAM modules; + else "lnp") ] # Linux with PAM modules; # -fPIC is required to compile php with imap on x86_64 systems - + stdenv.lib.optionalString stdenv.isx86_64 " EXTRACFLAGS=-fPIC" - + stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " CC=${stdenv.hostPlatform.config}-gcc RANLIB=${stdenv.hostPlatform.config}-ranlib"; + ++ stdenv.lib.optional stdenv.isx86_64 "EXTRACFLAGS=-fPIC" + ++ stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "CC=${stdenv.hostPlatform.config}-gcc" "RANLIB=${stdenv.hostPlatform.config}-ranlib" ]; hardeningDisable = [ "format" ]; diff --git a/pkgs/tools/package-management/librepo/default.nix b/pkgs/tools/package-management/librepo/default.nix index 0c53c1bbbc9..61435cee284 100644 --- a/pkgs/tools/package-management/librepo/default.nix +++ b/pkgs/tools/package-management/librepo/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkgconfig ]; - cmakeFlags="-DPYTHON_DESIRED=${stdenv.lib.substring 0 1 python.pythonVersion}"; + cmakeFlags = ["-DPYTHON_DESIRED=${stdenv.lib.substring 0 1 python.pythonVersion}" ]; buildInputs = [ python libxml2 glib openssl curl check gpgme ]; diff --git a/pkgs/tools/system/ipmitool/default.nix b/pkgs/tools/system/ipmitool/default.nix index c906ad3c8cf..3105cba5a34 100644 --- a/pkgs/tools/system/ipmitool/default.nix +++ b/pkgs/tools/system/ipmitool/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation { ${if static then "LDFLAGS=-static --enable-static --disable-shared" else "--enable-shared"} ) ''; - makeFlags = if static then "AM_LDFLAGS=-all-static" else ""; + makeFlags = stdenv.lib.optional static "AM_LDFLAGS=-all-static"; dontDisableStatic = static; meta = with lib; { diff --git a/pkgs/tools/text/smu/default.nix b/pkgs/tools/text/smu/default.nix index a80a6d3d799..50bceb4fcb3 100644 --- a/pkgs/tools/text/smu/default.nix +++ b/pkgs/tools/text/smu/default.nix @@ -14,7 +14,9 @@ stdenv.mkDerivation rec { # _FORTIFY_SOURCE requires compiling with optimization (-O) NIX_CFLAGS_COMPILE = "-O"; - makeFlags = [ "DESTDIR=$(out)" "PREFIX=" ]; + makeFlags = [ + "PREFIX=${placeholder "out"}" + ]; meta = with lib; { description = "simple markup - markdown like syntax";