diff --git a/pkgs/by-name/li/libtiff/headers.patch b/pkgs/by-name/li/libtiff/headers.patch deleted file mode 100644 index 933e06f32326..000000000000 --- a/pkgs/by-name/li/libtiff/headers.patch +++ /dev/null @@ -1,16 +0,0 @@ -export private headers for freeimage ---- i/libtiff/Makefile.am -+++ w/libtiff/Makefile.am -@@ -36,8 +36,12 @@ EXTRA_DIST = \ - tif_win32_versioninfo.rc - - libtiffinclude_HEADERS = \ -+ tif_config.h \ -+ tif_dir.h \ -+ tif_hash_set.h \ - tiff.h \ - tiffio.h \ -+ tiffiop.h \ - tiffvers.h - - if HAVE_CXX diff --git a/pkgs/by-name/li/libtiff/package.nix b/pkgs/by-name/li/libtiff/package.nix index 674369df1cd0..03564fced802 100644 --- a/pkgs/by-name/li/libtiff/package.nix +++ b/pkgs/by-name/li/libtiff/package.nix @@ -5,7 +5,7 @@ fetchpatch, nix-update-script, - autoreconfHook, + cmake, pkg-config, sphinx, @@ -40,11 +40,10 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ - # FreeImage needs this patch - ./headers.patch # libc++abi 11 has an `#include `, this picks up files name # `version` in the project's include paths ./rename-version.patch + ./static.patch ]; postPatch = '' @@ -61,16 +60,16 @@ stdenv.mkDerivation (finalAttrs: { ]; postFixup = '' - moveToOutput include/tif_config.h $dev_private - moveToOutput include/tif_dir.h $dev_private - moveToOutput include/tif_hash_set.h $dev_private - moveToOutput include/tiffiop.h $dev_private + mkdir -p $dev_private/include + mv -t $dev_private/include \ + libtiff/tif_config.h \ + ../libtiff/tif_dir.h \ + ../libtiff/tif_hash_set.h \ + ../libtiff/tiffiop.h ''; - # If you want to change to a different build system, please make - # sure cross-compilation works first! nativeBuildInputs = [ - autoreconfHook + cmake pkg-config sphinx ]; @@ -92,6 +91,10 @@ stdenv.mkDerivation (finalAttrs: { zstd ]; + cmakeFlags = [ + "-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON" + ]; + enableParallelBuilding = true; doCheck = true; diff --git a/pkgs/by-name/li/libtiff/rename-version.patch b/pkgs/by-name/li/libtiff/rename-version.patch index 04fa1bfc88c7..f5c9ec2811ca 100644 --- a/pkgs/by-name/li/libtiff/rename-version.patch +++ b/pkgs/by-name/li/libtiff/rename-version.patch @@ -1,21 +1,13 @@ -fix case-insensitive build ---- a/Makefile.am -+++ b/Makefile.am -@@ -34,7 +34,7 @@ docfiles = \ - README.md \ - RELEASE-DATE \ - TODO \ -- VERSION -+ VERSION.txt +diff --git a/cmake/AutotoolsVersion.cmake b/cmake/AutotoolsVersion.cmake +index f93f5cf0..fd33df59 100644 +--- a/cmake/AutotoolsVersion.cmake ++++ b/cmake/AutotoolsVersion.cmake +@@ -41,7 +41,7 @@ set(LIBTIFF_VERSION "${LIBTIFF_MAJOR_VERSION}.${LIBTIFF_MINOR_VERSION}.${LIBTIFF + set(LIBTIFF_VERSION_FULL "${LIBTIFF_VERSION}${LIBTIFF_ALPHA_VERSION}") - EXTRA_DIST = \ - placeholder.h \ -@@ -68,7 +68,7 @@ NEW_LIBTIFF_RELEASE_DATE=$(shell date +"%Y%m%d") - release: - @(echo --- Setting release date to $(NEW_LIBTIFF_RELEASE_DATE) and release version to $(LIBTIFF_VERSION) ---) - (rm -f $(top_srcdir)/RELEASE-DATE && echo $(NEW_LIBTIFF_RELEASE_DATE) > $(top_srcdir)/RELEASE-DATE) -- (rm -f $(top_srcdir)/VERSION && echo $(LIBTIFF_VERSION) > $(top_srcdir)/VERSION) -+ (rm -f $(top_srcdir)/VERSION && echo $(LIBTIFF_VERSION) > $(top_srcdir)/VERSION.txt) - (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) + # Get release version from file VERSION +-FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" LIBTIFF_RELEASE_VERSION) ++FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt" LIBTIFF_RELEASE_VERSION) - pkgconfigdir = $(libdir)/pkgconfig + # Package date - get it from file RELEASE-DATE + FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/RELEASE-DATE" LIBTIFF_RELEASE_DATE) diff --git a/pkgs/by-name/li/libtiff/static.patch b/pkgs/by-name/li/libtiff/static.patch new file mode 100644 index 000000000000..0eecc5d149b8 --- /dev/null +++ b/pkgs/by-name/li/libtiff/static.patch @@ -0,0 +1,36 @@ +From ed5fcc718075021fe670daee6dd426a5e12d6842 Mon Sep 17 00:00:00 2001 +From: Alyssa Ross +Date: Thu, 19 Dec 2024 16:51:51 +0100 +Subject: [PATCH] Fix name of Lerc package + +Lerc calls its CMake package "Lerc", not "LERC". This meant that, +even if building libtiff with -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON, +Lerc's CMake files wouldn't be used as intended. + +Link: https://gitlab.com/libtiff/libtiff/-/merge_requests/686 +--- + cmake/{FindLERC.cmake => FindLerc.cmake} | 0 + cmake/LERCCodec.cmake | 2 +- + 2 files changed, 1 insertion(+), 1 deletion(-) + rename cmake/{FindLERC.cmake => FindLerc.cmake} (100%) + +diff --git a/cmake/FindLERC.cmake b/cmake/FindLerc.cmake +similarity index 100% +rename from cmake/FindLERC.cmake +rename to cmake/FindLerc.cmake +diff --git a/cmake/LERCCodec.cmake b/cmake/LERCCodec.cmake +index 54504ca1..237f8d7e 100644 +--- a/cmake/LERCCodec.cmake ++++ b/cmake/LERCCodec.cmake +@@ -25,7 +25,7 @@ + + # libLerc + set(LERC_SUPPORT FALSE) +-find_package(LERC) ++find_package(Lerc) + option(lerc "use libLerc (required for LERC compression)" ${LERC_FOUND}) + if (lerc AND LERC_FOUND AND ZIP_SUPPORT) + set(LERC_SUPPORT TRUE) +-- +2.47.0 +