From d727b87f5a56d04ed11b9d68f4cb4efa93444457 Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Tue, 2 Mar 2021 22:22:06 +0700 Subject: [PATCH] cwebbin: fix build on darwin and fix cross-compilation --- pkgs/development/tools/misc/cwebbin/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/misc/cwebbin/default.nix b/pkgs/development/tools/misc/cwebbin/default.nix index 3ab8800f3c4..055a24f3fe0 100644 --- a/pkgs/development/tools/misc/cwebbin/default.nix +++ b/pkgs/development/tools/misc/cwebbin/default.nix @@ -16,7 +16,15 @@ stdenv.mkDerivation rec { sha256 = "1hdzxfzaibnjxjzgp6d2zay8nsarnfy9hfq55hz1bxzzl23n35aj"; }; - buildInputs = [ tie ]; + # Remove references to __DATE__ and __TIME__ + postPatch = '' + substituteInPlace wmerg-patch.ch --replace ' ("__DATE__", "__TIME__")' "" + substituteInPlace ctang-patch.ch --replace ' ("__DATE__", "__TIME__")' "" + substituteInPlace ctangle.cxx --replace ' ("__DATE__", "__TIME__")' "" + substituteInPlace cweav-patch.ch --replace ' ("__DATE__", "__TIME__")' "" + ''; + + nativeBuildInputs = [ tie ]; makeFlags = [ "MACROSDIR=$(out)/share/texmf/tex/generic/cweb" @@ -27,7 +35,7 @@ stdenv.mkDerivation rec { "CP=cp" "RM=rm" "PDFTEX=echo" - "CC=c++" + "CC=${stdenv.cc.targetPrefix}c++" ]; buildPhase = ''