Skip to content

Commit

Permalink
pkgsCross.mingwW64.giflib: fix build
Browse files Browse the repository at this point in the history
It was failing with:

    x86_64-w64-mingw32-ld: qprintf.o:qprintf.c:(.text+0xb9): undefined reference to `GifErrorString'

and then

    install gif2rgb gifbuild giffix giftext giftool gifclrmp "/nix/store/vcik0mlp8756g2lpmzbjw3v8mhn1529i-giflib-x86_64-w64-mingw32-5.2.1/bin"
    install: cannot stat 'gif2rgb': No such file or directory
  • Loading branch information
jtojnar authored and Artturin committed Jul 26, 2023
1 parent 9096d43 commit 007173a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkgs/development/libraries/giflib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ stdenv.mkDerivation rec {
sha256 = "12afkqnlkl3n1hywwgx8sqnhp3bz0c5qrwcv8j9hifw1lmfhv67r";
extraPrefix = "./";
})
] ++ lib.optionals stdenv.hostPlatform.isMinGW [
# Build dll libraries.
(fetchurl {
url = "https://aur.archlinux.org/cgit/aur.git/plain/001-mingw-build.patch?h=mingw-w64-giflib&id=4cf1e519bcf51338dc607d23388fca47d71790c0";
sha256 = "KyJi3eqH/Ae+guEK6znraZI5+IPImaoYoW5NTkCvjsg=";
})

# Install executables.
./mingw-install-exes.patch
];

nativeBuildInputs = lib.optionals stdenv.isDarwin [
Expand Down
11 changes: 11 additions & 0 deletions pkgs/development/libraries/giflib/mingw-install-exes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/Makefile
+++ b/Makefile
@@ -92,7 +92,7 @@
install: all install-bin install-include install-lib install-man
install-bin: $(INSTALLABLE)
$(INSTALL) -d "$(DESTDIR)$(BINDIR)"
- $(INSTALL) $^ "$(DESTDIR)$(BINDIR)"
+ $(INSTALL) $(^:=.exe) "$(DESTDIR)$(BINDIR)"
install-include:
$(INSTALL) -d "$(DESTDIR)$(INCDIR)"
$(INSTALL) -m 644 gif_lib.h "$(DESTDIR)$(INCDIR)"

0 comments on commit 007173a

Please sign in to comment.