1 { lib, stdenv, fetchurl, sqlite, postgresql, zlib, acl, ncurses, openssl, readline
2 , gettext, CoreFoundation, IOKit, Kerberos
5 stdenv.mkDerivation rec {
10 url = "mirror://sourceforge/bacula/${pname}-${version}.tar.gz";
11 sha256 = "sha256-VVFcKmavmoa5VdrqQIk3i4ZNBRsubjA4O+825pOs6no=";
14 # libtool.m4 only matches macOS 10.*
15 postPatch = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) ''
16 substituteInPlace configure \
17 --replace "10.*)" "*)"
20 buildInputs = [ postgresql sqlite zlib ncurses openssl readline ]
21 ++ lib.optionals stdenv.hostPlatform.isDarwin [
22 gettext # bacula requires CoreFoundation, but its `configure` script will only link it when it detects libintl.
27 # acl relies on attr, which I can't get to build on darwin
28 ++ lib.optional (!stdenv.hostPlatform.isDarwin) acl;
31 "--with-sqlite3=${sqlite.dev}"
32 "--with-postgresql=${lib.getDev postgresql}"
33 "--with-logdir=/var/log/bacula"
34 "--with-working-dir=/var/lib/bacula"
35 "--mandir=\${out}/share/man"
36 ] ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "ac_cv_func_setpgrp_void=yes"
37 ++ lib.optionals stdenv.hostPlatform.isDarwin [
38 # bacula’s `configure` script fails to detect CoreFoundation correctly,
39 # but these symbols are available in the nixpkgs CoreFoundation framework.
40 "gt_cv_func_CFLocaleCopyCurrent=yes"
41 "gt_cv_func_CFPreferencesCopyAppValue=yes"
45 "logdir=\${out}/logdir"
46 "working_dir=\${out}/workdir"
51 ln -s $out/sbin/* $out/bin
55 description = "Enterprise ready, Network Backup Tool";
56 homepage = "http://bacula.org/";
57 license = with licenses; [ agpl3Only bsd2 ];
58 maintainers = with maintainers; [ lovek323 eleanor ];
59 platforms = platforms.all;