libtiff: switch back to CMake

Since libwebp was switched to CMake, the .la files that told static
builds which libraries had to be linked with libwebp are no longer
generated, breaking static builds. By switching libtiff to CMake too,
we can use the CMake files instead. (This is necessary, but not
sufficient, for static builds to work — a further patch is required.)

This was tried once before (in 96d50327bc59 ("libtiff: export private
headers for freeimage")), and I reverted it (in
5df9305b60d5 ("libtiff: fix cross by switching back to autoconf")),
because at the time, it broke cross compilation of libtiff. Things
seem to have settled since then, and this now cross compiles
correctly.

Fixes: 909c49149371 ("libwebp: build with CMake")

+23 -45
-16
pkgs/by-name/li/libtiff/headers.patch
··· 1 - export private headers for freeimage 2 - --- i/libtiff/Makefile.am 3 - +++ w/libtiff/Makefile.am 4 - @@ -36,8 +36,12 @@ EXTRA_DIST = \ 5 - tif_win32_versioninfo.rc 6 - 7 - libtiffinclude_HEADERS = \ 8 - + tif_config.h \ 9 - + tif_dir.h \ 10 - + tif_hash_set.h \ 11 - tiff.h \ 12 - tiffio.h \ 13 - + tiffiop.h \ 14 - tiffvers.h 15 - 16 - if HAVE_CXX
···
+12 -10
pkgs/by-name/li/libtiff/package.nix
··· 5 fetchpatch, 6 nix-update-script, 7 8 - autoreconfHook, 9 pkg-config, 10 sphinx, 11 ··· 40 }; 41 42 patches = [ 43 - # FreeImage needs this patch 44 - ./headers.patch 45 # libc++abi 11 has an `#include <version>`, this picks up files name 46 # `version` in the project's include paths 47 ./rename-version.patch ··· 61 ]; 62 63 postFixup = '' 64 - moveToOutput include/tif_config.h $dev_private 65 - moveToOutput include/tif_dir.h $dev_private 66 - moveToOutput include/tif_hash_set.h $dev_private 67 - moveToOutput include/tiffiop.h $dev_private 68 ''; 69 70 - # If you want to change to a different build system, please make 71 - # sure cross-compilation works first! 72 nativeBuildInputs = [ 73 - autoreconfHook 74 pkg-config 75 sphinx 76 ]; ··· 90 xz 91 zlib 92 zstd 93 ]; 94 95 enableParallelBuilding = true;
··· 5 fetchpatch, 6 nix-update-script, 7 8 + cmake, 9 pkg-config, 10 sphinx, 11 ··· 40 }; 41 42 patches = [ 43 # libc++abi 11 has an `#include <version>`, this picks up files name 44 # `version` in the project's include paths 45 ./rename-version.patch ··· 59 ]; 60 61 postFixup = '' 62 + mkdir -p $dev_private/include 63 + mv -t $dev_private/include \ 64 + libtiff/tif_config.h \ 65 + ../libtiff/tif_dir.h \ 66 + ../libtiff/tif_hash_set.h \ 67 + ../libtiff/tiffiop.h 68 ''; 69 70 nativeBuildInputs = [ 71 + cmake 72 pkg-config 73 sphinx 74 ]; ··· 88 xz 89 zlib 90 zstd 91 + ]; 92 + 93 + cmakeFlags = [ 94 + "-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON" 95 ]; 96 97 enableParallelBuilding = true;
+11 -19
pkgs/by-name/li/libtiff/rename-version.patch
··· 1 - fix case-insensitive build 2 - --- a/Makefile.am 3 - +++ b/Makefile.am 4 - @@ -34,7 +34,7 @@ docfiles = \ 5 - README.md \ 6 - RELEASE-DATE \ 7 - TODO \ 8 - - VERSION 9 - + VERSION.txt 10 11 - EXTRA_DIST = \ 12 - placeholder.h \ 13 - @@ -68,7 +68,7 @@ NEW_LIBTIFF_RELEASE_DATE=$(shell date +"%Y%m%d") 14 - release: 15 - @(echo --- Setting release date to $(NEW_LIBTIFF_RELEASE_DATE) and release version to $(LIBTIFF_VERSION) ---) 16 - (rm -f $(top_srcdir)/RELEASE-DATE && echo $(NEW_LIBTIFF_RELEASE_DATE) > $(top_srcdir)/RELEASE-DATE) 17 - - (rm -f $(top_srcdir)/VERSION && echo $(LIBTIFF_VERSION) > $(top_srcdir)/VERSION) 18 - + (rm -f $(top_srcdir)/VERSION && echo $(LIBTIFF_VERSION) > $(top_srcdir)/VERSION.txt) 19 - (rm -f $(top_builddir)/libtiff/tiffvers.h && sed 's,LIBTIFF_VERSION,$(LIBTIFF_VERSION),;s,LIBTIFF_RELEASE_DATE,$(NEW_LIBTIFF_RELEASE_DATE),;s,LIBTIFF_MAJOR_VERSION,$(LIBTIFF_MAJOR_VERSION),;s,LIBTIFF_MINOR_VERSION,$(LIBTIFF_MINOR_VERSION),;s,LIBTIFF_MICRO_VERSION,$(LIBTIFF_MICRO_VERSION),' $(top_srcdir)/libtiff/tiffvers.h.in > $(top_builddir)/libtiff/tiffvers.h && sed -i 's,@,,g' $(top_builddir)/libtiff/tiffvers.h) 20 21 - pkgconfigdir = $(libdir)/pkgconfig
··· 1 + diff --git a/cmake/AutotoolsVersion.cmake b/cmake/AutotoolsVersion.cmake 2 + index f93f5cf0..fd33df59 100644 3 + --- a/cmake/AutotoolsVersion.cmake 4 + +++ b/cmake/AutotoolsVersion.cmake 5 + @@ -41,7 +41,7 @@ set(LIBTIFF_VERSION "${LIBTIFF_MAJOR_VERSION}.${LIBTIFF_MINOR_VERSION}.${LIBTIFF 6 + set(LIBTIFF_VERSION_FULL "${LIBTIFF_VERSION}${LIBTIFF_ALPHA_VERSION}") 7 8 + # Get release version from file VERSION 9 + -FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" LIBTIFF_RELEASE_VERSION) 10 + +FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt" LIBTIFF_RELEASE_VERSION) 11 12 + # Package date - get it from file RELEASE-DATE 13 + FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/RELEASE-DATE" LIBTIFF_RELEASE_DATE)