giflib: fix static build (#144919)

Co-authored-by: Dmitry Bogatov <git#v1@kaction.cc>
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>

authored by Dmitry Bogatov Dmitry Bogatov Sandro and committed by GitHub 4cb7014e 44e71586

+10 -1
+10 -1
pkgs/development/libraries/giflib/default.nix
··· 1 - { lib, stdenv, fetchurl, fetchpatch, xmlto, docbook_xml_dtd_412, docbook_xsl, libxml2, fixDarwinDylibNames }: 1 + { lib, stdenv, fetchurl, fetchpatch, xmlto, docbook_xml_dtd_412, docbook_xsl, libxml2, fixDarwinDylibNames, pkgsStatic }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 name = "giflib-5.2.1"; ··· 19 19 postPatch = '' 20 20 substituteInPlace Makefile \ 21 21 --replace 'PREFIX = /usr/local' 'PREFIX = ${builtins.placeholder "out"}' 22 + '' 23 + # Upstream build system does not support NOT building shared libraries. 24 + + lib.optionalString stdenv.hostPlatform.isStatic '' 25 + sed -i '/all:/ s/libgif.so//' Makefile 26 + sed -i '/all:/ s/libutil.so//' Makefile 27 + sed -i '/-m 755 libgif.so/ d' Makefile 28 + sed -i '/ln -sf libgif.so/ d' Makefile 22 29 ''; 23 30 24 31 nativeBuildInputs = lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ]; 25 32 26 33 buildInputs = [ xmlto docbook_xml_dtd_412 docbook_xsl libxml2 ]; 34 + 35 + passthru.tests.static = pkgsStatic.giflib; 27 36 28 37 meta = { 29 38 description = "A library for reading and writing gif images";