nixpkgs/pkgs/servers/ldap/389/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

141 lines
2.7 KiB
Nix
Raw Normal View History

2022-10-17 09:04:41 +00:00
{ lib
, stdenv
2021-06-12 03:40:02 +00:00
, fetchFromGitHub
2022-10-17 09:04:41 +00:00
, autoconf
, automake
, libtool
, pkg-config
2021-06-12 03:40:02 +00:00
, cracklib
2022-10-17 09:04:41 +00:00
, lmdb
, json_c
, linux-pam
2021-06-12 03:40:02 +00:00
, libevent
2022-11-11 01:23:52 +00:00
, libxcrypt
2021-06-12 03:40:02 +00:00
, nspr
, nss
, openldap
2022-10-17 09:04:41 +00:00
, withOpenldap ? true
, db
, withBdb ? true
, cyrus_sasl
, icu
, net-snmp
, withNetSnmp ? true
, krb5
, pcre2
2021-06-12 03:40:02 +00:00
, python3
2022-10-17 09:04:41 +00:00
, rustPlatform
, openssl
, systemd
, withSystemd ? stdenv.isLinux
2021-06-12 03:40:02 +00:00
, zlib
, rsync
2022-10-17 09:04:41 +00:00
, withCockpit ? true
, withAsan ? false
2014-12-30 17:30:15 +00:00
}:
2014-12-30 17:30:15 +00:00
stdenv.mkDerivation rec {
pname = "389-ds-base";
2022-10-17 09:04:41 +00:00
version = "2.3.0";
2014-12-30 17:30:15 +00:00
2021-06-12 03:40:02 +00:00
src = fetchFromGitHub {
owner = "389ds";
repo = pname;
rev = "${pname}-${version}";
2022-10-17 09:04:41 +00:00
sha256 = "sha256-GnntF0UaufDrgcM6FFFdwxwVoU9Hu2NXTW1A2lTb6T4=";
2014-12-30 17:30:15 +00:00
};
2022-10-17 09:04:41 +00:00
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
sourceRoot = "source/src";
name = "${pname}-${version}";
hash = "sha256-OJXvNL7STNwvt6EiV2r8zv2ZoUGgNUj7UssAQNLN4KI=";
};
nativeBuildInputs = [
autoconf
automake
libtool
pkg-config
python3
rustPlatform.rust.cargo
rustPlatform.rust.rustc
]
++ lib.optional withCockpit rsync;
2021-06-12 03:40:02 +00:00
2014-12-30 17:30:15 +00:00
buildInputs = [
2021-06-12 03:40:02 +00:00
cracklib
2022-10-17 09:04:41 +00:00
lmdb
json_c
linux-pam
2021-06-12 03:40:02 +00:00
libevent
2022-11-11 01:23:52 +00:00
libxcrypt
2021-06-12 03:40:02 +00:00
nspr
nss
2022-10-17 09:04:41 +00:00
cyrus_sasl
icu
krb5
pcre2
2021-06-12 03:40:02 +00:00
openssl
zlib
]
2022-10-17 09:04:41 +00:00
++ lib.optional withSystemd systemd
++ lib.optional withOpenldap openldap
++ lib.optional withBdb db
++ lib.optional withNetSnmp net-snmp;
2021-06-12 03:40:02 +00:00
postPatch = ''
2021-06-12 03:40:02 +00:00
patchShebangs ./buildnum.py ./ldap/servers/slapd/mkDBErrStrs.py
'';
2015-01-09 23:01:01 +00:00
preConfigure = ''
2022-10-17 09:04:41 +00:00
./autogen.sh --prefix="$out"
2015-01-09 23:01:01 +00:00
'';
2015-01-09 19:05:12 +00:00
2022-10-17 09:04:41 +00:00
preBuild = ''
mkdir -p ./vendor
tar -xzf ${cargoDeps} -C ./vendor --strip-components=1
'';
2021-06-12 03:40:02 +00:00
2022-10-17 09:04:41 +00:00
configureFlags = [
"--enable-rust-offline"
"--enable-autobind"
]
++ lib.optionals withSystemd [
"--with-systemd"
"--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
] ++ lib.optionals withOpenldap [
"--with-openldap"
] ++ lib.optionals withBdb [
"--with-db-inc=${lib.getDev db}/include"
"--with-db-lib=${lib.getLib db}/lib"
] ++ lib.optionals withNetSnmp [
"--with-netsnmp-inc=${lib.getDev net-snmp}/include"
"--with-netsnmp-lib=${lib.getLib net-snmp}/lib"
] ++ lib.optionals (!withCockpit) [
"--disable-cockpit"
] ++ lib.optionals withAsan [
"--enable-asan"
"--enable-debug"
];
2017-02-05 21:40:28 +00:00
enableParallelBuilding = true;
2015-01-09 19:05:12 +00:00
2021-06-12 03:40:02 +00:00
doCheck = true;
2015-04-17 21:09:41 +00:00
installFlags = [
"sysconfdir=${placeholder "out"}/etc"
"localstatedir=${placeholder "TMPDIR"}"
2015-04-17 21:09:41 +00:00
];
2015-01-09 23:01:01 +00:00
passthru.version = version;
meta = with lib; {
homepage = "https://www.port389.org/";
description = "Enterprise-class Open Source LDAP server for Linux";
license = licenses.gpl3Plus;
2014-12-30 17:30:15 +00:00
platforms = platforms.linux;
2022-10-17 09:04:41 +00:00
maintainers = [ maintainers.ners ];
2014-12-30 17:30:15 +00:00
};
}