Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bacula: fix build on Darwin #346986

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions pkgs/tools/backup/bacula/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ lib, stdenv, fetchurl, sqlite, postgresql, zlib, acl, ncurses, openssl, readline
, CoreFoundation, IOKit
, gettext, CoreFoundation, IOKit, Kerberos
}:

stdenv.mkDerivation rec {
Expand All @@ -19,8 +19,10 @@ stdenv.mkDerivation rec {

buildInputs = [ postgresql sqlite zlib ncurses openssl readline ]
++ lib.optionals stdenv.hostPlatform.isDarwin [
gettext # bacula requires CoreFoundation, but its `configure` script will only link it when it detects libintl.
CoreFoundation
IOKit
Kerberos
]
# acl relies on attr, which I can't get to build on darwin
++ lib.optional (!stdenv.hostPlatform.isDarwin) acl;
Expand All @@ -31,7 +33,13 @@ stdenv.mkDerivation rec {
"--with-logdir=/var/log/bacula"
"--with-working-dir=/var/lib/bacula"
"--mandir=\${out}/share/man"
] ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "ac_cv_func_setpgrp_void=yes";
] ++ 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"
];

installFlags = [
"logdir=\${out}/logdir"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6083,7 +6083,7 @@ with pkgs;
};

bacula = callPackage ../tools/backup/bacula {
inherit (darwin.apple_sdk.frameworks) CoreFoundation IOKit;
inherit (darwin.apple_sdk.frameworks) CoreFoundation IOKit Kerberos;
};

bacon = callPackage ../development/tools/bacon {
Expand Down