Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, stdenv 3, fetchFromGitHub 4, autoconf 5, automake 6, cargo 7, libtool 8, pkg-config 9, cracklib 10, lmdb 11, json_c 12, linux-pam 13, libevent 14, libxcrypt 15, nspr 16, nss 17, openldap 18, withOpenldap ? true 19, db 20, withBdb ? true 21, cyrus_sasl 22, icu 23, net-snmp 24, withNetSnmp ? true 25, krb5 26, pcre2 27, python3 28, rustPlatform 29, rustc 30, openssl 31, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd 32, zlib 33, rsync 34, withCockpit ? true 35, withAsan ? false 36}: 37 38stdenv.mkDerivation rec { 39 pname = "389-ds-base"; 40 version = "2.4.1"; 41 42 src = fetchFromGitHub { 43 owner = "389ds"; 44 repo = pname; 45 rev = "${pname}-${version}"; 46 hash = "sha256-LoM2iztWC/HEq0jBKzzi+T6euXcNIDqsEzAeWfQSr90="; 47 }; 48 49 cargoDeps = rustPlatform.fetchCargoTarball { 50 inherit src; 51 sourceRoot = "source/src"; 52 name = "${pname}-${version}"; 53 hash = "sha256-+eJgWeLVoJ8j8J2QNM91EY3DBy4zicTwKAU1rcLr8R4="; 54 }; 55 56 nativeBuildInputs = [ 57 autoconf 58 automake 59 libtool 60 pkg-config 61 python3 62 cargo 63 rustc 64 ] 65 ++ lib.optional withCockpit rsync; 66 67 buildInputs = [ 68 cracklib 69 lmdb 70 json_c 71 linux-pam 72 libevent 73 libxcrypt 74 nspr 75 nss 76 cyrus_sasl 77 icu 78 krb5 79 pcre2 80 openssl 81 zlib 82 ] 83 ++ lib.optional withSystemd systemd 84 ++ lib.optional withOpenldap openldap 85 ++ lib.optional withBdb db 86 ++ lib.optional withNetSnmp net-snmp; 87 88 postPatch = '' 89 patchShebangs ./buildnum.py ./ldap/servers/slapd/mkDBErrStrs.py 90 ''; 91 92 preConfigure = '' 93 ./autogen.sh --prefix="$out" 94 ''; 95 96 preBuild = '' 97 mkdir -p ./vendor 98 tar -xzf ${cargoDeps} -C ./vendor --strip-components=1 99 ''; 100 101 configureFlags = [ 102 "--enable-rust-offline" 103 "--enable-autobind" 104 ] 105 ++ lib.optionals withSystemd [ 106 "--with-systemd" 107 "--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system" 108 ] ++ lib.optionals withOpenldap [ 109 "--with-openldap" 110 ] ++ lib.optionals withBdb [ 111 "--with-db-inc=${lib.getDev db}/include" 112 "--with-db-lib=${lib.getLib db}/lib" 113 ] ++ lib.optionals withNetSnmp [ 114 "--with-netsnmp-inc=${lib.getDev net-snmp}/include" 115 "--with-netsnmp-lib=${lib.getLib net-snmp}/lib" 116 ] ++ lib.optionals (!withCockpit) [ 117 "--disable-cockpit" 118 ] ++ lib.optionals withAsan [ 119 "--enable-asan" 120 "--enable-debug" 121 ]; 122 123 enableParallelBuilding = true; 124 # Disable parallel builds as those lack some dependencies: 125 # ld: cannot find -lslapd: No such file or directory 126 # https://hydra.nixos.org/log/h38bj77gav0r6jbi4bgzy1lfjq22k2wy-389-ds-base-2.3.1.drv 127 enableParallelInstalling = false; 128 129 doCheck = true; 130 131 installFlags = [ 132 "sysconfdir=${placeholder "out"}/etc" 133 "localstatedir=${placeholder "TMPDIR"}" 134 ]; 135 136 passthru.version = version; 137 138 meta = with lib; { 139 homepage = "https://www.port389.org/"; 140 description = "Enterprise-class Open Source LDAP server for Linux"; 141 license = licenses.gpl3Plus; 142 platforms = platforms.linux; 143 maintainers = [ maintainers.ners ]; 144 }; 145}