diff options
author | Alexander V. Nikolaev <avn@avnik.info> | 2018-04-07 13:09:39 +0300 |
---|---|---|
committer | Alexander V. Nikolaev <avn@avnik.info> | 2018-08-08 13:38:40 +0300 |
commit | cb1e30f84bc1814c693a2e224022a5b528192cae (patch) | |
tree | 3f7ffb3536bc99d8f594b7d7caa095951a5d633b /pkgs/development/libraries/kerberos | |
parent | 83a18e14d9132e0255c589b2acee62fff022c00c (diff) | |
download | nixpkgs-cb1e30f84bc1814c693a2e224022a5b528192cae.tar nixpkgs-cb1e30f84bc1814c693a2e224022a5b528192cae.tar.gz nixpkgs-cb1e30f84bc1814c693a2e224022a5b528192cae.tar.bz2 nixpkgs-cb1e30f84bc1814c693a2e224022a5b528192cae.tar.lz nixpkgs-cb1e30f84bc1814c693a2e224022a5b528192cae.tar.xz nixpkgs-cb1e30f84bc1814c693a2e224022a5b528192cae.tar.zst nixpkgs-cb1e30f84bc1814c693a2e224022a5b528192cae.zip |
heimdal: refactor lib-prefixed packages to multi-output
Diffstat (limited to 'pkgs/development/libraries/kerberos')
-rw-r--r-- | pkgs/development/libraries/kerberos/heimdal.nix | 65 |
1 files changed, 34 insertions, 31 deletions
diff --git a/pkgs/development/libraries/kerberos/heimdal.nix b/pkgs/development/libraries/kerberos/heimdal.nix index 24adb2a141e..134ca4f05b0 100644 --- a/pkgs/development/libraries/kerberos/heimdal.nix +++ b/pkgs/development/libraries/kerberos/heimdal.nix @@ -2,16 +2,11 @@ , texinfo, perlPackages , openldap, libcap_ng, sqlite, openssl, db, libedit, pam , CoreFoundation, Security, SystemConfiguration -# Extra Args -, type ? "" }: -let - libOnly = type == "lib"; -in with stdenv.lib; stdenv.mkDerivation rec { - name = "${type}heimdal-${version}"; + name = "heimdal-${version}"; version = "7.5.0"; src = fetchFromGitHub { @@ -21,15 +16,15 @@ stdenv.mkDerivation rec { sha256 = "1j38wjj4k0q8vx168k3d3k0fwa8j1q5q8f2688nnx1b9qgjd6w1d"; }; + outputs = [ "out" "bin" "dev" "man" ]; + patches = [ ./heimdal-make-missing-headers.patch ]; - nativeBuildInputs = [ autoreconfHook pkgconfig python2 perl yacc flex ] - ++ (with perlPackages; [ JSON ]) - ++ optional (!libOnly) texinfo; + nativeBuildInputs = [ autoreconfHook pkgconfig python2 perl yacc flex texinfo ] + ++ (with perlPackages; [ JSON ]); buildInputs = optionals (stdenv.isLinux) [ libcap_ng ] - ++ [ db sqlite openssl libedit ] - ++ optionals (stdenv.isDarwin) [ CoreFoundation Security SystemConfiguration ] - ++ optionals (!libOnly) [ openldap pam ]; + ++ [ db sqlite openssl libedit openldap pam] + ++ optionals (stdenv.isDarwin) [ CoreFoundation Security SystemConfiguration ]; ## ugly, X should be made an option configureFlags = [ @@ -37,12 +32,14 @@ stdenv.mkDerivation rec { "--localstatedir=/var" "--enable-hdb-openldap-module" "--with-sqlite3=${sqlite.dev}" - "--with-libedit=${libedit}" + + # ugly, --with-libedit is not enought, it fall back to bundled libedit + "--with-libedit-include=${libedit.dev}/include" + "--with-libedit-lib=${libedit}/lib" "--with-openssl=${openssl.dev}" "--without-x" "--with-berkeley-db" "--with-berkeley-db-include=${db.dev}/include" - ] ++ optionals (!libOnly) [ "--with-openldap=${openldap.dev}" ] ++ optionals (stdenv.isLinux) [ "--with-capng" @@ -50,24 +47,17 @@ stdenv.mkDerivation rec { postUnpack = '' sed -i '/^DEFAULT_INCLUDES/ s,$, -I..,' source/cf/Makefile.am.common + sed -i -e 's/date/date --date="@$SOURCE_DATE_EPOCH"/' source/configure.ac ''; - buildPhase = optionalString libOnly '' - (cd include; make -j $NIX_BUILD_CORES) - (cd lib; make -j $NIX_BUILD_CORES) - (cd tools; make -j $NIX_BUILD_CORES) - (cd include/hcrypto; make -j $NIX_BUILD_CORES) - (cd lib/hcrypto; make -j $NIX_BUILD_CORES) - ''; - - installPhase = optionalString libOnly '' - (cd include; make -j $NIX_BUILD_CORES install) - (cd lib; make -j $NIX_BUILD_CORES install) - (cd tools; make -j $NIX_BUILD_CORES install) - (cd include/hcrypto; make -j $NIX_BUILD_CORES install) - (cd lib/hcrypto; make -j $NIX_BUILD_CORES install) - rm -rf $out/{libexec,sbin,share} - find $out/bin -type f | grep -v 'krb5-config' | xargs rm + preConfigure = '' + configureFlagsArray+=( + "--bindir=$out/bin" # Put binaries to $out, then move them to $bin, + # otherwise we go a cyclic dependecny + "--sbindir=$out/sbin" + "--mandir=$man/share/man" + "--infodir=$man/share/info" + "--includedir=$dev/include") ''; # We need to build hcrypt for applications like samba @@ -76,14 +66,27 @@ stdenv.mkDerivation rec { (cd lib/hcrypto; make -j $NIX_BUILD_CORES) ''; + # FIXME: share/info hits $bin, IDK why, but I decide is to minor to block postInstall = '' # Install hcrypto (cd include/hcrypto; make -j $NIX_BUILD_CORES install) (cd lib/hcrypto; make -j $NIX_BUILD_CORES install) + # Do we need it? + rm $out/bin/su + # Doesn't succeed with --libexec=$out/sbin, so - mv "$out/libexec/"* $out/sbin/ + mkdir -p $dev/bin + mkdir -p $bin/{,s}bin + mv "$out/libexec/heimdal/"* $dev/bin/ + rmdir $out/libexec/heimdal + mv "$out/libexec/"* $bin/sbin/ rmdir $out/libexec + + mkdir -p $dev/bin && mv $out/bin/krb5-config $dev/bin/ + + # Move remaining binaries to $bin + mv $out/bin/* $bin/bin/ ''; # Issues with hydra |