python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / libraries / kerberos / heimdal.nix
blobc426ec922ae4b7baf1cdc588a9da88e1b862b7f8
1 { lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, python3, perl, bison, flex
2 , texinfo, perlPackages
3 , openldap, libcap_ng, sqlite, openssl, db, libedit, pam
4 , CoreFoundation, Security, SystemConfiguration
5 }:
7 with lib;
8 stdenv.mkDerivation rec {
9   pname = "heimdal";
10   version = "7.7.0";
12   src = fetchFromGitHub {
13     owner = "heimdal";
14     repo = "heimdal";
15     rev = "heimdal-${version}";
16     sha256 = "099qn9b8q20invvi5r8d8q9rnwpcm3nr89hx5rj7gj2ah2x5vgxs";
17   };
19   outputs = [ "out" "dev" "man" "info" ];
21   patches = [ ./heimdal-make-missing-headers.patch ];
23   nativeBuildInputs = [ autoreconfHook pkg-config python3 perl bison flex texinfo ]
24     ++ (with perlPackages; [ JSON ]);
25   buildInputs = optionals (stdenv.isLinux) [ libcap_ng ]
26     ++ [ db sqlite openssl libedit openldap pam]
27     ++ optionals (stdenv.isDarwin) [ CoreFoundation Security SystemConfiguration ];
29   ## ugly, X should be made an option
30   configureFlags = [
31     "--sysconfdir=/etc"
32     "--localstatedir=/var"
33     "--infodir=$info/share/info"
34     "--enable-hdb-openldap-module"
35     "--with-sqlite3=${sqlite.dev}"
37   # ugly, --with-libedit is not enought, it fall back to bundled libedit
38     "--with-libedit-include=${libedit.dev}/include"
39     "--with-libedit-lib=${libedit}/lib"
40     "--with-openssl=${openssl.dev}"
41     "--without-x"
42     "--with-berkeley-db"
43     "--with-berkeley-db-include=${db.dev}/include"
44     "--with-openldap=${openldap.dev}"
45   ] ++ optionals (stdenv.isLinux) [
46     "--with-capng"
47   ];
49   postUnpack = ''
50     sed -i '/^DEFAULT_INCLUDES/ s,$, -I..,' source/cf/Makefile.am.common
51     sed -i -e 's/date/date --date="@$SOURCE_DATE_EPOCH"/' source/configure.ac
52   '';
54   preConfigure = ''
55     configureFlagsArray+=(
56       "--bindir=$out/bin"
57       "--sbindir=$out/sbin"
58       "--libexecdir=$out/libexec/heimdal"
59       "--mandir=$man/share/man"
60       "--infodir=$man/share/info"
61       "--includedir=$dev/include")
62   '';
64   # We need to build hcrypt for applications like samba
65   postBuild = ''
66     (cd include/hcrypto; make -j $NIX_BUILD_CORES)
67     (cd lib/hcrypto; make -j $NIX_BUILD_CORES)
68   '';
70   postInstall = ''
71     # Install hcrypto
72     (cd include/hcrypto; make -j $NIX_BUILD_CORES install)
73     (cd lib/hcrypto; make -j $NIX_BUILD_CORES install)
75     # Do we need it?
76     rm $out/bin/su
78     mkdir -p $dev/bin
79     mv $out/bin/krb5-config $dev/bin/
81     # asn1 compilers, move them to $dev
82     mv $out/libexec/heimdal/heimdal/* $dev/bin
83     rmdir $out/libexec/heimdal/heimdal
85     # compile_et is needed for cross-compiling this package and samba
86     mv lib/com_err/.libs/compile_et $dev/bin
87   '';
89   # Issues with hydra
90   #  In file included from hxtool.c:34:0:
91   #  hx_locl.h:67:25: fatal error: pkcs10_asn1.h: No such file or directory
92   #enableParallelBuilding = true;
94   meta = {
95     description = "An implementation of Kerberos 5 (and some more stuff)";
96     license = licenses.bsd3;
97     platforms = platforms.unix;
98   };
100   passthru.implementation = "heimdal";