From 29fce94665b6434ca22e78d873a01396bcd2a85a Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 21 Aug 2012 10:47:29 +0200 Subject: [PATCH] nss: Clean up build/make flags. First of all, let's remove that redundant BUILD_OPT variable. This variable already is in makeFlags, so we really don't want it to be lurking around in the attribute set of the derivation, and it annoys me for being there for days. We now state build targets explicitly rather than relying on "nss_build_all". This makes NSPR_CONFIG_STATUS and the touch of build_nspr stamp obsolete, as only nss_build_all includes build_nspr. In addition, we don't need the -lz hack anymore, as this has been fixed in recent NSS versions, so we can completly remove the postBuild hook. And while we're at it, we're removing those outdated build instructions as well, especially because we don't and can't follow official building guidelines anymore, as those are difficult to apply to Nix. --- pkgs/development/libraries/nss/default.nix | 32 +++++++--------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/pkgs/development/libraries/nss/default.nix b/pkgs/development/libraries/nss/default.nix index a957996d1f1..222fd6e94f6 100644 --- a/pkgs/development/libraries/nss/default.nix +++ b/pkgs/development/libraries/nss/default.nix @@ -39,9 +39,6 @@ stdenv.mkDerivation rec { patches = [ ./nss-3.12.5-gentoo-fixups.diff ]; - # Based on the build instructions at - # http://www.mozilla.org/projects/security/pki/nss/nss-3.11.4/nss-3.11.4-build.html - postPatch = '' sed -i -e 's/^DIRS.*$/& pem/' mozilla/security/nss/lib/ckfw/manifest.mn sed -i -e "/^PREFIX =/s:= /usr:= $out:" mozilla/security/nss/config/Makefile @@ -49,26 +46,17 @@ stdenv.mkDerivation rec { preConfigure = "cd mozilla/security/nss"; - BUILD_OPT = "1"; + makeFlags = [ + "NSPR_INCLUDE_DIR=${nspr}/include/nspr" + "NSPR_LIB_DIR=${nspr}/lib" + "NSDISTMODE=copy" + "BUILD_OPT=1" + "SOURCE_PREFIX=\$(out)" + "NSS_ENABLE_ECC=1" + "NSS_USE_SYSTEM_SQLITE=1" + ] ++ stdenv.lib.optional stdenv.is64bit "USE_64=1"; - makeFlags = - [ "NSPR_CONFIG_STATUS=" "NSDISTMODE=copy" "BUILD_OPT=1" "SOURCE_PREFIX=\$(out)" - "NSS_ENABLE_ECC=1" "NSS_USE_SYSTEM_SQLITE=1" - ] - ++ stdenv.lib.optional stdenv.is64bit "USE_64=1"; - - buildFlags = "nss_build_all"; - - NIX_CFLAGS_COMPILE = "-I${nspr}/include/nspr"; - - preBuild = - '' - # Fool it into thinking NSPR has already been built. - touch build_nspr - - # Hack to make -lz dependencies work. - touch cmd/signtool/-lz cmd/modutil/-lz - ''; + buildFlags = [ "build_coreconf" "build_dbm" "all" ]; postInstall = ''