From 1878ac9335e86631a92320ca0c3894f56b278a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Wed, 30 Dec 2015 09:54:36 +0100 Subject: [PATCH] tree-wide: various cleanups It's mainly refactoring and mass-rebuild simplifications without any real impact (besides better readability). --- pkgs/development/libraries/expat/default.nix | 2 +- pkgs/development/libraries/kerberos/heimdal.nix | 3 ++- pkgs/development/libraries/kerberos/krb5.nix | 4 ++-- pkgs/development/libraries/libedit/default.nix | 14 ++++++-------- pkgs/development/libraries/libiconv/default.nix | 15 ++++++++------- .../libraries/libossp-uuid/default.nix | 2 +- pkgs/tools/networking/miniupnpc/default.nix | 4 ++-- pkgs/top-level/perl-packages.nix | 8 ++++---- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pkgs/development/libraries/expat/default.nix b/pkgs/development/libraries/expat/default.nix index 766ef6c11c5f..96d46649d916 100644 --- a/pkgs/development/libraries/expat/default.nix +++ b/pkgs/development/libraries/expat/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { patches = [ ./CVE-2015-1283.patch ]; - configureFlags = stdenv.lib.optionalString stdenv.isFreeBSD "--with-pic"; + configureFlags = stdenv.lib.optional stdenv.isFreeBSD "--with-pic"; meta = with stdenv.lib; { homepage = http://www.libexpat.org/; diff --git a/pkgs/development/libraries/kerberos/heimdal.nix b/pkgs/development/libraries/kerberos/heimdal.nix index e17d0c19e037..175d0c7bc3b2 100644 --- a/pkgs/development/libraries/kerberos/heimdal.nix +++ b/pkgs/development/libraries/kerberos/heimdal.nix @@ -23,7 +23,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook pkgconfig python perl yacc flex ] ++ (with perlPackages; [ JSON ]) ++ optional (!libOnly) texinfo; - buildInputs = (if (!stdenv.isFreeBSD) then [ libcap_ng db ] else []) ++ [ sqlite openssl libedit ] + buildInputs = optionals (!stdenv.isFreeBSD) [ libcap_ng db ] + ++ [ sqlite openssl libedit ] ++ optionals (!libOnly) [ openldap pam ]; ## ugly, X should be made an option diff --git a/pkgs/development/libraries/kerberos/krb5.nix b/pkgs/development/libraries/kerberos/krb5.nix index b263a4ef06ce..e735285231ea 100644 --- a/pkgs/development/libraries/kerberos/krb5.nix +++ b/pkgs/development/libraries/kerberos/krb5.nix @@ -18,11 +18,11 @@ stdenv.mkDerivation rec { sha256 = "1sgr61cnkgc5xazijaww6wpn5fnxl9vyj9ixk3r3y7ikv3x0gnyf"; }; - configureFlags = stdenv.lib.optionalString stdenv.isFreeBSD ''WARN_CFLAGS=""''; + configureFlags = optional stdenv.isFreeBSD ''WARN_CFLAGS=""''; nativeBuildInputs = [ pkgconfig perl yacc ] # Provides the mig command used by the build scripts - ++ stdenv.lib.optional stdenv.isDarwin bootstrap_cmds; + ++ optional stdenv.isDarwin bootstrap_cmds; buildInputs = [ openssl ] ++ optionals (!libOnly) [ openldap libedit ]; diff --git a/pkgs/development/libraries/libedit/default.nix b/pkgs/development/libraries/libedit/default.nix index 5234c16e1354..6e8d85cb88d9 100644 --- a/pkgs/development/libraries/libedit/default.nix +++ b/pkgs/development/libraries/libedit/default.nix @@ -11,23 +11,21 @@ stdenv.mkDerivation rec { # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds. NROFF = "${groff}/bin/nroff"; - patches = if stdenv.isCygwin then [ - ./01-cygwin.patch - ] else [ ] ++ [ ./freebsd-wchar.patch ]; + patches = [ ./01-cygwin.patch ./freebsd-wchar.patch ]; + + propagatedBuildInputs = [ ncurses ]; + + configureFlags = [ "--enable-widec" ]; postInstall = '' find $out/lib -type f | grep '\.\(la\|pc\)''$' | xargs sed -i \ -e 's,-lncurses[a-z]*,-L${ncurses}/lib -lncursesw,g' ''; - configureFlags = [ "--enable-widec" ]; - - propagatedBuildInputs = [ ncurses ]; - meta = with stdenv.lib; { homepage = "http://www.thrysoee.dk/editline/"; description = "A port of the NetBSD Editline library (libedit)"; - license = licenses.bsd3; + license = licenses.bsd3; platforms = platforms.all; }; } diff --git a/pkgs/development/libraries/libiconv/default.nix b/pkgs/development/libraries/libiconv/default.nix index 24a0376f0f9f..f5818c3bf4c9 100644 --- a/pkgs/development/libraries/libiconv/default.nix +++ b/pkgs/development/libraries/libiconv/default.nix @@ -1,4 +1,4 @@ -{ fetchurl, stdenv }: +{ fetchurl, stdenv, lib }: assert (!stdenv.isLinux); @@ -10,17 +10,18 @@ stdenv.mkDerivation rec { sha256 = "04q6lgl3kglmmhw59igq1n7v3rp1rpkypl366cy1k1yn2znlvckj"; }; - patches = if stdenv.isCygwin then [ + patches = lib.optionals stdenv.isCygwin [ ./libiconv-1.14-reloc.patch ./libiconv-1.14-wchar.patch - ] else null; + ]; + configureFlags = # On Cygwin, Libtool produces a `.dll.a', which is not a "real" DLL # (Windows' linker would need to be used somehow to produce an actual # DLL.) Thus, build the static library too, and this is what Gettext # will actually use. - configureFlags = if stdenv.isCygwin then [ "--enable-static" ] else - if stdenv.isFreeBSD then [ "--with-pic" ] else null; + lib.optional stdenv.isCygwin "--enable-static" + ++ lib.optional stdenv.isFreeBSD "--with-pic"; crossAttrs = { # Disable stripping to avoid "libiconv.a: Archive has no index" (MinGW). @@ -42,11 +43,11 @@ stdenv.mkDerivation rec { ''; homepage = http://www.gnu.org/software/libiconv/; - license = stdenv.lib.licenses.lgpl2Plus; + license = lib.licenses.lgpl2Plus; maintainers = [ ]; # This library is not needed on GNU platforms. - hydraPlatforms = stdenv.lib.platforms.cygwin ++ stdenv.lib.platforms.darwin ++ stdenv.lib.platforms.freebsd; + hydraPlatforms = with lib.platforms; cygwin ++ darwin ++ freebsd; }; } diff --git a/pkgs/development/libraries/libossp-uuid/default.nix b/pkgs/development/libraries/libossp-uuid/default.nix index 72fa1a29992e..ddfc2a5132c7 100644 --- a/pkgs/development/libraries/libossp-uuid/default.nix +++ b/pkgs/development/libraries/libossp-uuid/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation { sha256= "11a615225baa5f8bb686824423f50e4427acd3f70d394765bdff32801f0fd5b0"; }; - configureFlags = stdenv.lib.optionalString stdenv.isFreeBSD "--with-pic"; + configureFlags = stdenv.lib.optional stdenv.isFreeBSD "--with-pic"; meta = with stdenv.lib; { homepage = http://www.ossp.org/pkg/lib/uuid/; diff --git a/pkgs/tools/networking/miniupnpc/default.nix b/pkgs/tools/networking/miniupnpc/default.nix index 644045800d4e..e5b6ea396fe4 100644 --- a/pkgs/tools/networking/miniupnpc/default.nix +++ b/pkgs/tools/networking/miniupnpc/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { name = "${name}.tar.gz"; }; - patches = stdenv.lib.optional stdenv.isFreeBSD [ ./freebsd.patch ]; + patches = stdenv.lib.optional stdenv.isFreeBSD ./freebsd.patch; doCheck = !stdenv.isFreeBSD; @@ -20,6 +20,6 @@ stdenv.mkDerivation rec { inherit version; homepage = http://miniupnp.free.fr/; description = "A client that implements the UPnP Internet Gateway Device (IGD) specification"; - platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.freebsd; + platforms = with stdenv.lib.platforms; linux ++ freebsd; }; } diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 41dcdcddcbf6..97b2740f6c7e 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -6339,7 +6339,7 @@ let self = _self // overrides; _self = with self; { LocaleGettext = buildPerlPackage { name = "LocaleGettext-1.05"; buildInputs = stdenv.lib.optional (stdenv.isFreeBSD || stdenv.isDarwin || stdenv.isCygwin) pkgs.gettext; - NIX_CFLAGS_LINK = if (stdenv.isFreeBSD || stdenv.isDarwin || stdenv.isCygwin) then "-lintl" else null; + NIX_CFLAGS_LINK = stdenv.lib.optional (stdenv.isFreeBSD || stdenv.isDarwin || stdenv.isCygwin) "-lintl"; src = fetchurl { url = mirror://cpan/authors/id/P/PV/PVANDRY/gettext-1.05.tar.gz; sha256 = "15262a00vx714szpx8p2z52wxkz46xp7acl72znwjydyq4ypydi7"; @@ -6552,10 +6552,10 @@ let self = _self // overrides; _self = with self; { }; patches = [ ../development/perl-modules/lwp-test-with-localhost.patch ]; propagatedBuildInputs = [ EncodeLocale FileListing HTMLParser HTTPCookies HTTPDaemon HTTPDate HTTPMessage HTTPNegotiate LWPMediaTypes NetHTTP URI WWWRobotRules ]; - meta = { + meta = with stdenv.lib; { description = "The World-Wide Web library for Perl"; - license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ]; - platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin ++ stdenv.lib.platforms.illumos ++ stdenv.lib.platforms.freebsd; + license = with licenses; [ artistic1 gpl1Plus ]; + platforms = platforms.unix; }; };