heimdal: refactor lib-prefixed packages to multi-output
This commit is contained in:
parent
83a18e14d9
commit
cb1e30f84b
2 changed files with 39 additions and 32 deletions
|
@ -2,16 +2,11 @@
|
||||||
, texinfo, perlPackages
|
, texinfo, perlPackages
|
||||||
, openldap, libcap_ng, sqlite, openssl, db, libedit, pam
|
, openldap, libcap_ng, sqlite, openssl, db, libedit, pam
|
||||||
, CoreFoundation, Security, SystemConfiguration
|
, CoreFoundation, Security, SystemConfiguration
|
||||||
# Extra Args
|
|
||||||
, type ? ""
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
|
||||||
libOnly = type == "lib";
|
|
||||||
in
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "${type}heimdal-${version}";
|
name = "heimdal-${version}";
|
||||||
version = "7.5.0";
|
version = "7.5.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
|
@ -21,15 +16,15 @@ stdenv.mkDerivation rec {
|
||||||
sha256 = "1j38wjj4k0q8vx168k3d3k0fwa8j1q5q8f2688nnx1b9qgjd6w1d";
|
sha256 = "1j38wjj4k0q8vx168k3d3k0fwa8j1q5q8f2688nnx1b9qgjd6w1d";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
outputs = [ "out" "bin" "dev" "man" ];
|
||||||
|
|
||||||
patches = [ ./heimdal-make-missing-headers.patch ];
|
patches = [ ./heimdal-make-missing-headers.patch ];
|
||||||
|
|
||||||
nativeBuildInputs = [ autoreconfHook pkgconfig python2 perl yacc flex ]
|
nativeBuildInputs = [ autoreconfHook pkgconfig python2 perl yacc flex texinfo ]
|
||||||
++ (with perlPackages; [ JSON ])
|
++ (with perlPackages; [ JSON ]);
|
||||||
++ optional (!libOnly) texinfo;
|
|
||||||
buildInputs = optionals (stdenv.isLinux) [ libcap_ng ]
|
buildInputs = optionals (stdenv.isLinux) [ libcap_ng ]
|
||||||
++ [ db sqlite openssl libedit ]
|
++ [ db sqlite openssl libedit openldap pam]
|
||||||
++ optionals (stdenv.isDarwin) [ CoreFoundation Security SystemConfiguration ]
|
++ optionals (stdenv.isDarwin) [ CoreFoundation Security SystemConfiguration ];
|
||||||
++ optionals (!libOnly) [ openldap pam ];
|
|
||||||
|
|
||||||
## ugly, X should be made an option
|
## ugly, X should be made an option
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
|
@ -37,12 +32,14 @@ stdenv.mkDerivation rec {
|
||||||
"--localstatedir=/var"
|
"--localstatedir=/var"
|
||||||
"--enable-hdb-openldap-module"
|
"--enable-hdb-openldap-module"
|
||||||
"--with-sqlite3=${sqlite.dev}"
|
"--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}"
|
"--with-openssl=${openssl.dev}"
|
||||||
"--without-x"
|
"--without-x"
|
||||||
"--with-berkeley-db"
|
"--with-berkeley-db"
|
||||||
"--with-berkeley-db-include=${db.dev}/include"
|
"--with-berkeley-db-include=${db.dev}/include"
|
||||||
] ++ optionals (!libOnly) [
|
|
||||||
"--with-openldap=${openldap.dev}"
|
"--with-openldap=${openldap.dev}"
|
||||||
] ++ optionals (stdenv.isLinux) [
|
] ++ optionals (stdenv.isLinux) [
|
||||||
"--with-capng"
|
"--with-capng"
|
||||||
|
@ -50,24 +47,17 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
postUnpack = ''
|
postUnpack = ''
|
||||||
sed -i '/^DEFAULT_INCLUDES/ s,$, -I..,' source/cf/Makefile.am.common
|
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 ''
|
preConfigure = ''
|
||||||
(cd include; make -j $NIX_BUILD_CORES)
|
configureFlagsArray+=(
|
||||||
(cd lib; make -j $NIX_BUILD_CORES)
|
"--bindir=$out/bin" # Put binaries to $out, then move them to $bin,
|
||||||
(cd tools; make -j $NIX_BUILD_CORES)
|
# otherwise we go a cyclic dependecny
|
||||||
(cd include/hcrypto; make -j $NIX_BUILD_CORES)
|
"--sbindir=$out/sbin"
|
||||||
(cd lib/hcrypto; make -j $NIX_BUILD_CORES)
|
"--mandir=$man/share/man"
|
||||||
'';
|
"--infodir=$man/share/info"
|
||||||
|
"--includedir=$dev/include")
|
||||||
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
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# We need to build hcrypt for applications like samba
|
# We need to build hcrypt for applications like samba
|
||||||
|
@ -76,14 +66,27 @@ stdenv.mkDerivation rec {
|
||||||
(cd lib/hcrypto; make -j $NIX_BUILD_CORES)
|
(cd lib/hcrypto; make -j $NIX_BUILD_CORES)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# FIXME: share/info hits $bin, IDK why, but I decide is to minor to block
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
# Install hcrypto
|
# Install hcrypto
|
||||||
(cd include/hcrypto; make -j $NIX_BUILD_CORES install)
|
(cd include/hcrypto; make -j $NIX_BUILD_CORES install)
|
||||||
(cd lib/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
|
# 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
|
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
|
# Issues with hydra
|
||||||
|
|
|
@ -9700,10 +9700,14 @@ with pkgs;
|
||||||
|
|
||||||
hamlib = callPackage ../development/libraries/hamlib { };
|
hamlib = callPackage ../development/libraries/hamlib { };
|
||||||
|
|
||||||
|
# TODO : Let admin choose.
|
||||||
|
# We are using mit-krb5 because it is better maintained
|
||||||
|
kerberos = libkrb5;
|
||||||
|
|
||||||
heimdal = callPackage ../development/libraries/kerberos/heimdal.nix {
|
heimdal = callPackage ../development/libraries/kerberos/heimdal.nix {
|
||||||
inherit (darwin.apple_sdk.frameworks) CoreFoundation Security SystemConfiguration;
|
inherit (darwin.apple_sdk.frameworks) CoreFoundation Security SystemConfiguration;
|
||||||
};
|
};
|
||||||
libheimdal = heimdal.override { type = "lib"; };
|
libheimdal = heimdal;
|
||||||
|
|
||||||
harfbuzz = callPackage ../development/libraries/harfbuzz { };
|
harfbuzz = callPackage ../development/libraries/harfbuzz { };
|
||||||
harfbuzz-icu = harfbuzz.override {
|
harfbuzz-icu = harfbuzz.override {
|
||||||
|
|
Loading…
Reference in a new issue