fcron: improve cross compilation and parameterize embedded paths

This commit is contained in:
Audrey Dutcher
2025-12-06 15:39:03 -07:00
parent a937d80b7c
commit 7ac2507a07
+10 -3
View File
@@ -6,8 +6,12 @@
stdenv,
fetchurl,
perl,
buildPackages,
busybox,
vim,
sendmailProgram ?
if lib.meta.availableOn stdenv.hostPlatform busybox then "${busybox}/sbin/sendmail" else null,
editorProgram ? if lib.meta.availableOn stdenv.hostPlatform vim then "${vim}/bin/vi" else null,
}:
stdenv.mkDerivation rec {
@@ -24,14 +28,17 @@ stdenv.mkDerivation rec {
patches = [ ./relative-fcronsighup.patch ];
configureFlags = [
"--with-sendmail=${busybox}/sbin/sendmail"
"--with-editor=${vim}/bin/vi" # TODO customizable
"--with-sendmail=${if sendmailProgram == null then "no" else sendmailProgram}"
"--with-editor=${if editorProgram == null then "no" else editorProgram}"
"--with-bootinstall=no"
"--localstatedir=/var"
"--sysconfdir=/etc"
"--with-rootname=root"
"--with-rootgroup=root"
"--disable-checks"
]
++ lib.optionals (!(stdenv.buildPlatform.canExecute stdenv.hostPlatform)) [
"ac_cv_func_memcmp_working=yes"
];
installTargets = [ "install-staged" ]; # install does also try to change permissions of /etc/* files
@@ -48,7 +55,7 @@ stdenv.mkDerivation rec {
];
preConfigure = ''
sed -i 's@/usr/bin/env perl@${perl}/bin/perl@g' configure script/*
sed -i 's@/usr/bin/env perl@${lib.getExe buildPackages.perl}@g' configure script/*
# Don't let fcron create the group fcron, nix(os) should do this
sed -i '2s@.*@exit 0@' script/user-group