fim: fix cross / strictDeps build

This commit is contained in:
FliegendeWurst
2025-03-30 11:13:26 +02:00
parent 4534205b61
commit 06f6e784b0
2 changed files with 53 additions and 5 deletions
+26
View File
@@ -0,0 +1,26 @@
diff --git a/doc/Makefile.in b/doc/Makefile.in
index be8ebe5..13ae676 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -684,7 +684,7 @@ fimgs.man.html: fimgs.man
if test ! -s $@ ; then $(MAN2TXT) ./$< > $<.txt && $(srcdir)/vim2html.pl tags $<.txt && mv $<.txt.html $@ ; fi
doctags$(EXEEXT): doctags.c
- $(CC) -o $@ $<
+ @cc_for_build@ -o $@ $<
#clean:
# $(RM) -f doctags.o doctags$(EXEEXT) FIM.html tags fim-stylesheet.css fim.man.html fimgs.man.html
diff --git a/src/Makefile.in b/src/Makefile.in
index 76f5e1e..027159c 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1132,7 +1132,7 @@ help-acm.cpp: fim.h
$(ECHO) '//#endif' >> $@
b2ba$(EXEEXT): b2ba.c
- $(CC) -o $@ $<
+ @cc_for_build@ -o $@ $<
@FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@default_font_byte_array.h: $(FIM_CUSTOM_HARDCODED_CONSOLEFONT) b2ba$(EXEEXT)
@FIM_WANT_CUSTOM_HARDCODED_CONSOLEFONT_TRUE@@HAVE_RUNNABLE_TESTS_TRUE@ ./b2ba$(EXEEXT) < $< > $@
+27 -5
View File
@@ -4,13 +4,17 @@
autoconf,
automake,
pkg-config,
substituteAll,
lib,
perl,
flex,
bison,
readline,
libexif,
x11Support ? true,
bash,
buildPackages,
# SDL depends on Qt, which doesn't cross-compile
x11Support ? (stdenv.buildPlatform.canExecute stdenv.hostPlatform),
SDL,
svgSupport ? true,
inkscape,
@@ -35,24 +39,33 @@ stdenv.mkDerivation rec {
sha256 = "sha256-/p7bjeZM46DJOQ9sgtebhkNpBPj2RJYY3dMXhzHnNmg=";
};
patches = [
# build tools with a build compiler
(substituteAll {
src = ./native-tools.patch;
cc_for_build = lib.getExe buildPackages.stdenv.cc;
})
];
postPatch = ''
substituteInPlace doc/vim2html.pl \
--replace /usr/bin/perl ${perl}/bin/perl
patchShebangs --build doc/vim2html.pl
'';
nativeBuildInputs = [
autoconf
automake
bison
flex
perl
pkg-config
];
buildInputs =
[
perl
flex
bison
readline
libexif
bash
]
++ lib.optional x11Support SDL
++ lib.optional svgSupport inkscape
@@ -62,6 +75,15 @@ stdenv.mkDerivation rec {
++ lib.optional jpegSupport libjpeg
++ lib.optional pngSupport libpng;
configureFlags = [
# mmap works on all relevant platforms
"ac_cv_func_mmap_fixed_mapped=yes"
# system regexp works on all relevant platforms
"fim_cv_regex_broken=no"
];
env.LIBAA_CONFIG = lib.getExe' (lib.getDev aalib) "aalib-config";
env.LIBPNG_CONFIG = lib.getExe' (lib.getDev libpng) "libpng-config";
env.NIX_CFLAGS_COMPILE = lib.optionalString x11Support "-lSDL";
meta = with lib; {