Merge pull request #114657 from siraben/noweb-xcompile

authored by Sandro and committed by GitHub afd0feb8 19f61789

+32 -27
+17 -14
pkgs/development/tools/literate-programming/noweb/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, gawk, groff, icon-lang ? null }: 1 + { lib, stdenv, fetchFromGitHub, nawk, groff, icon-lang }: 2 2 3 - let noweb = stdenv.mkDerivation rec { 3 + lib.fix (noweb: stdenv.mkDerivation rec { 4 4 pname = "noweb"; 5 5 version = "2.12"; 6 6 ··· 11 11 sha256 = "1160i2ghgzqvnb44kgwd6s3p4jnk9668rmc15jlcwl7pdf3xqm95"; 12 12 }; 13 13 14 - patches = [ ./no-FAQ.patch ]; 14 + sourceRoot = "source/src"; 15 + 16 + patches = [ 17 + # Remove FAQ 18 + ./no-FAQ.patch 19 + ]; 20 + 21 + postPatch = '' 22 + substituteInPlace Makefile --replace 'strip' '${stdenv.cc.targetPrefix}strip' 23 + ''; 15 24 16 25 nativeBuildInputs = [ groff ] ++ lib.optionals (!isNull icon-lang) [ icon-lang ]; 26 + buildInputs = [ nawk ]; 17 27 18 28 preBuild = '' 19 29 mkdir -p "$out/lib/noweb" 20 - cd src 21 30 ''; 22 31 23 32 makeFlags = lib.optionals (!isNull icon-lang) [ 24 33 "LIBSRC=icon" 25 34 "ICONC=icont" 26 - ] ++ lib.optionals stdenv.isDarwin [ 27 - "CC=clang" 28 - ]; 29 - 30 - 31 - installFlags = [ 32 - ]; 35 + ] ++ [ "CC=${stdenv.cc.targetPrefix}cc" ]; 33 36 34 37 preInstall = '' 35 38 mkdir -p "$tex/tex/latex/noweb" ··· 50 53 for f in $out/bin/no{index,roff,roots,untangle,web} \ 51 54 $out/lib/noweb/to{ascii,html,roff,tex} \ 52 55 $out/lib/noweb/{bt,empty}defn \ 53 - $out/lib/noweb/{noidx,unmarkup}; do 56 + $out/lib/noweb/{noidx,pipedocs,unmarkup}; do 54 57 # NOTE: substituteInPlace breaks Icon binaries, so make sure the script 55 58 # uses (n)awk before calling. 56 59 if grep -q nawk "$f"; then 57 - substituteInPlace "$f" --replace "nawk" "${gawk}/bin/awk" 60 + substituteInPlace "$f" --replace "nawk" "${nawk}/bin/awk" 58 61 fi 59 62 done 60 63 ··· 77 80 maintainers = with maintainers; [ yurrriq ]; 78 81 platforms = with platforms; linux ++ darwin; 79 82 }; 80 - }; in noweb 83 + })
+2 -2
pkgs/development/tools/literate-programming/noweb/no-FAQ.patch
··· 1 - --- a/src/Makefile 2006-06-12 22:14:20.000000000 +0200 2 - +++ b/src/Makefile 2010-06-17 11:30:11.804018145 +0200 1 + --- a/Makefile 2006-06-12 22:14:20.000000000 +0200 2 + +++ b/Makefile 2010-06-17 11:30:11.804018145 +0200 3 3 @@ -198,7 +198,7 @@ 4 4 (cd elisp; ci -l $(CINAME) $(CIMSG) *.el) 5 5 ci -l $(CINAME) $(CIMSG) Makefile.nw INSTALL INSTALL.DOS README FAQ COPYRIGHT nwmake *.nw
+13 -11
pkgs/tools/text/nawk/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, yacc }: 1 + { lib, stdenv, fetchFromGitHub, bison, buildPackages }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "nawk"; 5 - version = "20180827"; 5 + version = "unstable-2021-02-15"; 6 6 7 7 src = fetchFromGitHub { 8 8 owner = "onetrueawk"; 9 9 repo = "awk"; 10 - rev = version; 11 - sha256 = "0qcsxhcwg6g3c0zxmbipqa8d8d5n8zxrq0hymb8yavsaz103fcl6"; 10 + rev = "c0f4e97e4561ff42544e92512bbaf3d7d1f6a671"; 11 + sha256 = "kQCvItpSJnDJMDvlB8ruY+i0KdjmAphRDqCKw8f0m/8="; 12 12 }; 13 13 14 - nativeBuildInputs = [ yacc ]; 15 - 16 - patchPhase = '' 17 - substituteInPlace ./makefile \ 18 - --replace "YACC = yacc -d -S" "" 19 - ''; 14 + depsBuildBuild = [ buildPackages.stdenv.cc ]; 15 + nativeBuildInputs = [ bison ]; 16 + makeFlags = [ 17 + "CC=${stdenv.cc.targetPrefix}cc" 18 + "HOSTCC=${if stdenv.buildPlatform.isDarwin then "clang" else "cc"}" 19 + ]; 20 20 21 21 installPhase = '' 22 + runHook preInstall 22 23 install -Dm755 a.out "$out/bin/nawk" 23 24 install -Dm644 awk.1 "$out/share/man/man1/nawk.1" 25 + runHook postInstall 24 26 ''; 25 27 26 28 meta = { ··· 33 35 homepage = "https://www.cs.princeton.edu/~bwk/btl.mirror/"; 34 36 license = lib.licenses.mit; 35 37 maintainers = [ lib.maintainers.konimex ]; 36 - platforms = lib.platforms.linux; 38 + platforms = lib.platforms.all; 37 39 }; 38 40 }