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

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

146 lines
2.9 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
, cargo
2022-10-17 09:04:41 +00:00
, 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
, rustc
2022-10-17 09:04:41 +00:00
, openssl
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
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";
2023-05-26 10:31:03 +00:00
version = "2.4.1";
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}";
2023-05-26 10:31:03 +00:00
hash = "sha256-LoM2iztWC/HEq0jBKzzi+T6euXcNIDqsEzAeWfQSr90=";
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}";
2023-05-26 10:31:03 +00:00
hash = "sha256-+eJgWeLVoJ8j8J2QNM91EY3DBy4zicTwKAU1rcLr8R4=";
2022-10-17 09:04:41 +00:00
};
nativeBuildInputs = [
autoconf
automake
libtool
pkg-config
python3
cargo
rustc
2022-10-17 09:04:41 +00:00
]
++ 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;
# Disable parallel builds as those lack some dependencies:
# ld: cannot find -lslapd: No such file or directory
# https://hydra.nixos.org/log/h38bj77gav0r6jbi4bgzy1lfjq22k2wy-389-ds-base-2.3.1.drv
enableParallelInstalling = false;
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
};
}