2021-01-15 22:18:51 +00:00
|
|
|
|
{ lib, stdenv, fetchurl, sqlite, postgresql, zlib, acl, ncurses, openssl, readline
|
2024-10-09 16:51:18 +00:00
|
|
|
|
, gettext, CoreFoundation, IOKit, Kerberos
|
2020-10-27 00:29:36 +00:00
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-01-15 22:18:51 +00:00
|
|
|
|
pname = "bacula";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
version = "15.0.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
2021-01-15 22:18:51 +00:00
|
|
|
|
url = "mirror://sourceforge/bacula/${pname}-${version}.tar.gz";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
sha256 = "sha256-VVFcKmavmoa5VdrqQIk3i4ZNBRsubjA4O+825pOs6no=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
|
# libtool.m4 only matches macOS 10.*
|
2024-09-26 11:04:55 +00:00
|
|
|
|
postPatch = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) ''
|
2022-11-04 12:27:35 +00:00
|
|
|
|
substituteInPlace configure \
|
|
|
|
|
--replace "10.*)" "*)"
|
|
|
|
|
'';
|
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
|
buildInputs = [ postgresql sqlite zlib ncurses openssl readline ]
|
2021-01-15 22:18:51 +00:00
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-10-09 16:51:18 +00:00
|
|
|
|
gettext # bacula requires CoreFoundation, but its `configure` script will only link it when it detects libintl.
|
2020-10-27 00:29:36 +00:00
|
|
|
|
CoreFoundation
|
|
|
|
|
IOKit
|
2024-10-09 16:51:18 +00:00
|
|
|
|
Kerberos
|
2020-10-27 00:29:36 +00:00
|
|
|
|
]
|
2020-04-24 23:36:52 +00:00
|
|
|
|
# acl relies on attr, which I can't get to build on darwin
|
2024-09-26 11:04:55 +00:00
|
|
|
|
++ lib.optional (!stdenv.hostPlatform.isDarwin) acl;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
|
"--with-sqlite3=${sqlite.dev}"
|
2024-09-19 14:19:46 +00:00
|
|
|
|
"--with-postgresql=${lib.getDev postgresql}"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
"--with-logdir=/var/log/bacula"
|
|
|
|
|
"--with-working-dir=/var/lib/bacula"
|
|
|
|
|
"--mandir=\${out}/share/man"
|
2024-10-09 16:51:18 +00:00
|
|
|
|
] ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "ac_cv_func_setpgrp_void=yes"
|
|
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
|
# bacula’s `configure` script fails to detect CoreFoundation correctly,
|
|
|
|
|
# but these symbols are available in the nixpkgs CoreFoundation framework.
|
|
|
|
|
"gt_cv_func_CFLocaleCopyCurrent=yes"
|
|
|
|
|
"gt_cv_func_CFPreferencesCopyAppValue=yes"
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
installFlags = [
|
|
|
|
|
"logdir=\${out}/logdir"
|
|
|
|
|
"working_dir=\${out}/workdir"
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
|
ln -s $out/sbin/* $out/bin
|
|
|
|
|
'';
|
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
description = "Enterprise ready, Network Backup Tool";
|
|
|
|
|
homepage = "http://bacula.org/";
|
2021-01-15 22:18:51 +00:00
|
|
|
|
license = with licenses; [ agpl3Only bsd2 ];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
maintainers = with maintainers; [ lovek323 eleanor ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
platforms = platforms.all;
|
|
|
|
|
};
|
|
|
|
|
}
|