diff --git a/pkgs/by-name/fc/fcron/package.nix b/pkgs/by-name/fc/fcron/package.nix index ccf8fb806c5a..c0c8aa8df2a4 100644 --- a/pkgs/by-name/fc/fcron/package.nix +++ b/pkgs/by-name/fc/fcron/package.nix @@ -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