fim: fix cross / strictDeps build

+53 -5
+26
pkgs/by-name/fi/fim/native-tools.patch
··· 1 + diff --git a/doc/Makefile.in b/doc/Makefile.in 2 + index be8ebe5..13ae676 100644 3 + --- a/doc/Makefile.in 4 + +++ b/doc/Makefile.in 5 + @@ -684,7 +684,7 @@ fimgs.man.html: fimgs.man 6 + if test ! -s $@ ; then $(MAN2TXT) ./$< > $<.txt && $(srcdir)/vim2html.pl tags $<.txt && mv $<.txt.html $@ ; fi 7 + 8 + doctags$(EXEEXT): doctags.c 9 + - $(CC) -o $@ $< 10 + + @cc_for_build@ -o $@ $< 11 + 12 + #clean: 13 + # $(RM) -f doctags.o doctags$(EXEEXT) FIM.html tags fim-stylesheet.css fim.man.html fimgs.man.html 14 + diff --git a/src/Makefile.in b/src/Makefile.in 15 + index 76f5e1e..027159c 100644 16 + --- a/src/Makefile.in 17 + +++ b/src/Makefile.in 18 + @@ -1132,7 +1132,7 @@ help-acm.cpp: fim.h 19 + $(ECHO) '//#endif' >> $@ 20 + 21 + b2ba$(EXEEXT): b2ba.c 22 + - $(CC) -o $@ $< 23 + + @cc_for_build@ -o $@ $< 24 + 25 + @FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@default_font_byte_array.h: $(FIM_CUSTOM_HARDCODED_CONSOLEFONT) b2ba$(EXEEXT) 26 + @FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ ./b2ba$(EXEEXT) < $< > $@
+27 -5
pkgs/by-name/fi/fim/package.nix
··· 4 4 autoconf, 5 5 automake, 6 6 pkg-config, 7 + substituteAll, 7 8 lib, 8 9 perl, 9 10 flex, 10 11 bison, 11 12 readline, 12 13 libexif, 13 - x11Support ? true, 14 + bash, 15 + buildPackages, 16 + # SDL depends on Qt, which doesn't cross-compile 17 + x11Support ? (stdenv.buildPlatform.canExecute stdenv.hostPlatform), 14 18 SDL, 15 19 svgSupport ? true, 16 20 inkscape, ··· 35 39 sha256 = "sha256-/p7bjeZM46DJOQ9sgtebhkNpBPj2RJYY3dMXhzHnNmg="; 36 40 }; 37 41 42 + patches = [ 43 + # build tools with a build compiler 44 + (substituteAll { 45 + src = ./native-tools.patch; 46 + cc_for_build = lib.getExe buildPackages.stdenv.cc; 47 + }) 48 + ]; 49 + 38 50 postPatch = '' 39 - substituteInPlace doc/vim2html.pl \ 40 - --replace /usr/bin/perl ${perl}/bin/perl 51 + patchShebangs --build doc/vim2html.pl 41 52 ''; 42 53 43 54 nativeBuildInputs = [ 44 55 autoconf 45 56 automake 57 + bison 58 + flex 59 + perl 46 60 pkg-config 47 61 ]; 48 62 49 63 buildInputs = 50 64 [ 51 - perl 52 65 flex 53 - bison 54 66 readline 55 67 libexif 68 + bash 56 69 ] 57 70 ++ lib.optional x11Support SDL 58 71 ++ lib.optional svgSupport inkscape ··· 62 75 ++ lib.optional jpegSupport libjpeg 63 76 ++ lib.optional pngSupport libpng; 64 77 78 + configureFlags = [ 79 + # mmap works on all relevant platforms 80 + "ac_cv_func_mmap_fixed_mapped=yes" 81 + # system regexp works on all relevant platforms 82 + "fim_cv_regex_broken=no" 83 + ]; 84 + 85 + env.LIBAA_CONFIG = lib.getExe' (lib.getDev aalib) "aalib-config"; 86 + env.LIBPNG_CONFIG = lib.getExe' (lib.getDev libpng) "libpng-config"; 65 87 env.NIX_CFLAGS_COMPILE = lib.optionalString x11Support "-lSDL"; 66 88 67 89 meta = with lib; {