From 5bf5de58ea568b733d7399233f4d661f911c742d Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sat, 1 Oct 2016 23:38:06 +0300 Subject: [PATCH] treewide: Fix 'lib.optional' misuses These add a singleton list of a package to buildInputs. --- pkgs/applications/audio/cd-discid/default.nix | 2 +- pkgs/applications/graphics/feh/default.nix | 2 +- pkgs/applications/networking/cluster/spark/default.nix | 2 +- pkgs/applications/networking/mumble/default.nix | 2 +- pkgs/development/libraries/gtk+/3.x.nix | 2 +- pkgs/development/libraries/librsvg/default.nix | 2 +- pkgs/development/libraries/openal-soft/default.nix | 2 +- pkgs/development/libraries/png++/default.nix | 2 +- pkgs/games/openttd/default.nix | 2 +- pkgs/tools/networking/openssh/default.nix | 2 +- pkgs/tools/networking/swec/default.nix | 2 +- pkgs/tools/video/atomicparsley/default.nix | 2 +- pkgs/top-level/perl-packages.nix | 2 +- pkgs/top-level/python-packages.nix | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/audio/cd-discid/default.nix b/pkgs/applications/audio/cd-discid/default.nix index 2cf9849e351b..382d4a1b6675 100644 --- a/pkgs/applications/audio/cd-discid/default.nix +++ b/pkgs/applications/audio/cd-discid/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { installFlags = "PREFIX=$(out) INSTALL=install"; buildInputs = [] - ++ stdenv.lib.optional stdenv.isDarwin [ IOKit ]; + ++ stdenv.lib.optional stdenv.isDarwin IOKit; meta = with stdenv.lib; { homepage = http://linukz.org/cd-discid.shtml; diff --git a/pkgs/applications/graphics/feh/default.nix b/pkgs/applications/graphics/feh/default.nix index 380e5d298864..40fe178d6257 100644 --- a/pkgs/applications/graphics/feh/default.nix +++ b/pkgs/applications/graphics/feh/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "doc" ]; nativeBuildInputs = [ makeWrapper xorg.libXt ] - ++ stdenv.lib.optional doCheck [ perlPackages.TestCommand perlPackages.TestHarness ]; + ++ stdenv.lib.optionals doCheck [ perlPackages.TestCommand perlPackages.TestHarness ]; buildInputs = [ xorg.libX11 xorg.libXinerama imlib2 libjpeg libpng curl libexif ]; diff --git a/pkgs/applications/networking/cluster/spark/default.nix b/pkgs/applications/networking/cluster/spark/default.nix index 79074d2d28e6..b4c20e22680b 100644 --- a/pkgs/applications/networking/cluster/spark/default.nix +++ b/pkgs/applications/networking/cluster/spark/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { }; buildInputs = [ makeWrapper jre pythonPackages.python pythonPackages.numpy ] - ++ optional mesosSupport [ mesos ]; + ++ optional mesosSupport mesos; untarDir = "${name}-bin-cdh4"; installPhase = '' diff --git a/pkgs/applications/networking/mumble/default.nix b/pkgs/applications/networking/mumble/default.nix index fff0bc5edc46..038f4cb1a739 100644 --- a/pkgs/applications/networking/mumble/default.nix +++ b/pkgs/applications/networking/mumble/default.nix @@ -104,7 +104,7 @@ let "CONFIG+=no-client" ]; - buildInputs = [ libcap ] ++ optional iceSupport [ zeroc_ice ]; + buildInputs = [ libcap ] ++ optional iceSupport zeroc_ice; }; stableSource = rec { diff --git a/pkgs/development/libraries/gtk+/3.x.nix b/pkgs/development/libraries/gtk+/3.x.nix index 1ac006b21617..df223688d46d 100644 --- a/pkgs/development/libraries/gtk+/3.x.nix +++ b/pkgs/development/libraries/gtk+/3.x.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { [ expat glib cairo pango gdk_pixbuf atk at_spi2_atk libXrandr libXrender libXcomposite libXi libXcursor libSM libICE ] ++ optionals waylandSupport [ wayland wayland-protocols ] - ++ optional stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ AppKit Cocoa ]) + ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ AppKit Cocoa ]) ++ optional xineramaSupport libXinerama ++ optional cupsSupport cups; #TODO: colord? diff --git a/pkgs/development/libraries/librsvg/default.nix b/pkgs/development/libraries/librsvg/default.nix index d5df00a7e9ba..409307fb52b0 100644 --- a/pkgs/development/libraries/librsvg/default.nix +++ b/pkgs/development/libraries/librsvg/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; buildInputs = [ libxml2 libgsf bzip2 libcroco pango libintlOrEmpty ] - ++ stdenv.lib.optional enableIntrospection [ gobjectIntrospection ]; + ++ stdenv.lib.optional enableIntrospection gobjectIntrospection; propagatedBuildInputs = [ glib gdk_pixbuf cairo ] ++ lib.optional withGTK gtk3; diff --git a/pkgs/development/libraries/openal-soft/default.nix b/pkgs/development/libraries/openal-soft/default.nix index 4a466ad133ac..c17c224415db 100644 --- a/pkgs/development/libraries/openal-soft/default.nix +++ b/pkgs/development/libraries/openal-soft/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { buildInputs = [ cmake ] ++ optional alsaSupport alsaLib ++ optional pulseSupport libpulseaudio - ++ optional stdenv.isDarwin [ CoreServices AudioUnit AudioToolbox ]; + ++ optionals stdenv.isDarwin [ CoreServices AudioUnit AudioToolbox ]; NIX_LDFLAGS = [] ++ optional alsaSupport "-lasound" diff --git a/pkgs/development/libraries/png++/default.nix b/pkgs/development/libraries/png++/default.nix index baebce8e4b11..6ca4734a4f7d 100644 --- a/pkgs/development/libraries/png++/default.nix +++ b/pkgs/development/libraries/png++/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { postCheck = "cat test/test.log"; buildInputs = [ ] - ++ stdenv.lib.optional docSupport [ doxygen ]; + ++ stdenv.lib.optional docSupport doxygen; propagatedBuildInputs = [ libpng ]; diff --git a/pkgs/games/openttd/default.nix b/pkgs/games/openttd/default.nix index c40337d54f52..0c129f8d556f 100644 --- a/pkgs/games/openttd/default.nix +++ b/pkgs/games/openttd/default.nix @@ -38,7 +38,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig makeWrapper ]; buildInputs = [ SDL libpng xz zlib freetype fontconfig ] - ++ stdenv.lib.optional withFluidSynth [ fluidsynth soundfont-fluid ]; + ++ stdenv.lib.optionals withFluidSynth [ fluidsynth soundfont-fluid ]; prefixKey = "--prefix-dir="; diff --git a/pkgs/tools/networking/openssh/default.nix b/pkgs/tools/networking/openssh/default.nix index a6e4b7c4c209..0c19822d37c9 100644 --- a/pkgs/tools/networking/openssh/default.nix +++ b/pkgs/tools/networking/openssh/default.nix @@ -53,7 +53,7 @@ stdenv.mkDerivation rec { ++ optional withGssapiPatches gssapiSrc; buildInputs = [ zlib openssl libedit pkgconfig pam ] - ++ optional withKerberos [ kerberos ]; + ++ optional withKerberos kerberos; # I set --disable-strip because later we strip anyway. And it fails to strip # properly when cross building. diff --git a/pkgs/tools/networking/swec/default.nix b/pkgs/tools/networking/swec/default.nix index 851af6f24f6f..5b7f8f114df3 100644 --- a/pkgs/tools/networking/swec/default.nix +++ b/pkgs/tools/networking/swec/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { }; buildInputs = [ makeWrapper perl LWP URI HTMLParser ] - ++ stdenv.lib.optional doCheck [ HTTPServerSimple Parent ]; + ++ stdenv.lib.optionals doCheck [ HTTPServerSimple Parent ]; configurePhase = '' for i in swec tests/{runTests,testServer} diff --git a/pkgs/tools/video/atomicparsley/default.nix b/pkgs/tools/video/atomicparsley/default.nix index bb44fe044e81..835cacf0098c 100644 --- a/pkgs/tools/video/atomicparsley/default.nix +++ b/pkgs/tools/video/atomicparsley/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { }; buildInputs = with pkgs; [ unzip ] - ++ stdenv.lib.optional stdenv.isDarwin [ darwin.apple_sdk.frameworks.Cocoa ]; + ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Cocoa ]; patches = [ ./casts.patch ]; setSourceRoot = "sourceRoot=${product}-source-${version}"; buildPhase = "bash build"; diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 96d92f40ca8b..c02693422761 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -32,7 +32,7 @@ let self = _self // overrides; _self = with self; { }; outputs = ["out" "doc"]; # use gnused so that the preCheck command passes - buildInputs = stdenv.lib.optional stdenv.isDarwin [ gnused ]; + buildInputs = stdenv.lib.optional stdenv.isDarwin gnused; propagatedBuildInputs = [ FileNext ]; meta = with stdenv.lib; { description = "A grep-like tool tailored to working with large trees of source code"; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2055160ab302..d88af031135a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2016,7 +2016,7 @@ in modules // { }; propagatedBuildInputs = with stdenv.lib; with pkgs; [ modules.curses zlib xz ncompress gzip bzip2 gnutar p7zip cabextract lzma self.pycrypto ] - ++ optional visualizationSupport [ pyqtgraph ]; + ++ optional visualizationSupport pyqtgraph; meta = with stdenv.lib; { homepage = "http://binwalk.org";