From e70105cf8392dc7b792d8ffd73ac4c6e81e0f505 Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 13 Feb 2024 07:21:40 +0000 Subject: [PATCH] procmail: support cross compilation --- pkgs/applications/misc/procmail/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/misc/procmail/default.nix b/pkgs/applications/misc/procmail/default.nix index 661bbd22be85..3bd280766b16 100644 --- a/pkgs/applications/misc/procmail/default.nix +++ b/pkgs/applications/misc/procmail/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, fetchpatch }: +{ lib, stdenv, fetchurl, fetchpatch, buildPackages }: stdenv.mkDerivation rec { pname = "procmail"; @@ -30,8 +30,19 @@ stdenv.mkDerivation rec { sed -e "3i\ .PHONY: install " -i Makefile + '' + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + substituteInPlace src/Makefile.0 \ + --replace-fail '@./_autotst' '@${stdenv.hostPlatform.emulator buildPackages} ./_autotst' + sed -e '3i\ + _autotst() { ${stdenv.hostPlatform.emulator buildPackages} ./_autotst "$@"; } \ + _locktst() { ${stdenv.hostPlatform.emulator buildPackages} ./_locktst "$@"; } \ + ' -i src/autoconf ''; + # default target is binaries + manpages; manpages don't cross compile without more work. + makeFlags = lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ "bins" ]; + installTargets = lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ "install.bin" ]; + meta = with lib; { description = "Mail processing and filtering utility"; homepage = "https://github.com/BuGlessRB/procmail/";