From 8865278b098c269b9751186181121202402f59fb Mon Sep 17 00:00:00 2001 From: John Date: Mon, 25 Jan 2021 22:54:18 +0100 Subject: [PATCH] openjpeg2: patch cmake stuff to fix cross in other packages --- ...c27e7c91f745a1dda9991b5deea3cbef2072.patch | 31 +++++++++++++++++++ ...49edad7fb31ebbf03c60a45b72aaa7b7412b.patch | 26 ++++++++++++++++ srcpkgs/openjpeg2/template | 3 +- 3 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/openjpeg2/patches/14f4c27e7c91f745a1dda9991b5deea3cbef2072.patch create mode 100644 srcpkgs/openjpeg2/patches/4d0b49edad7fb31ebbf03c60a45b72aaa7b7412b.patch diff --git a/srcpkgs/openjpeg2/patches/14f4c27e7c91f745a1dda9991b5deea3cbef2072.patch b/srcpkgs/openjpeg2/patches/14f4c27e7c91f745a1dda9991b5deea3cbef2072.patch new file mode 100644 index 0000000000..3f658e849d --- /dev/null +++ b/srcpkgs/openjpeg2/patches/14f4c27e7c91f745a1dda9991b5deea3cbef2072.patch @@ -0,0 +1,31 @@ +From 14f4c27e7c91f745a1dda9991b5deea3cbef2072 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Thu, 7 Jan 2021 14:09:50 +0100 +Subject: [PATCH] Revert "Use INC_DIR for OPENJPEG_INCLUDE_DIRS (fixes + uclouvain#1174)" + +This reverts commit 65586374d639cfc0104419992f9022174b412594 which +breaks cross-compilation of poppler under buildroot (because of +DESTDIR usage). +--- + cmake/OpenJPEGConfig.cmake.in | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git cmake/OpenJPEGConfig.cmake.in cmake/OpenJPEGConfig.cmake.in +index 8a726697a..2925108ad 100644 +--- cmake/OpenJPEGConfig.cmake.in ++++ cmake/OpenJPEGConfig.cmake.in +@@ -27,8 +27,12 @@ if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake) + # This is an install tree + include(${SELF_DIR}/OpenJPEGTargets.cmake) + ++ # We find a relative path from the PKG directory to header files. ++ set(PKG_DIR "@CMAKE_INSTALL_PREFIX@/@OPENJPEG_INSTALL_PACKAGE_DIR@") + set(INC_DIR "@CMAKE_INSTALL_PREFIX@/@OPENJPEG_INSTALL_INCLUDE_DIR@") +- get_filename_component(OPENJPEG_INCLUDE_DIRS "${INC_DIR}" ABSOLUTE) ++ file(RELATIVE_PATH PKG_TO_INC_RPATH "${PKG_DIR}" "${INC_DIR}") ++ ++ get_filename_component(OPENJPEG_INCLUDE_DIRS "${SELF_DIR}/${PKG_TO_INC_RPATH}" ABSOLUTE) + + else() + if(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake) diff --git a/srcpkgs/openjpeg2/patches/4d0b49edad7fb31ebbf03c60a45b72aaa7b7412b.patch b/srcpkgs/openjpeg2/patches/4d0b49edad7fb31ebbf03c60a45b72aaa7b7412b.patch new file mode 100644 index 0000000000..9c6b47ce47 --- /dev/null +++ b/srcpkgs/openjpeg2/patches/4d0b49edad7fb31ebbf03c60a45b72aaa7b7412b.patch @@ -0,0 +1,26 @@ +From 4d0b49edad7fb31ebbf03c60a45b72aaa7b7412b Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Thu, 7 Jan 2021 14:11:26 +0100 +Subject: [PATCH] cmake/OpenJPEGConfig.cmake: replace ABSOLUTE by REALPATH + +Fix #1174 by replacing ABSOLUTE by REALPATH which will resolve symlinks: +https://cmake.org/cmake/help/latest/command/get_filename_component.html + +Signed-off-by: Fabrice Fontaine +--- + cmake/OpenJPEGConfig.cmake.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git cmake/OpenJPEGConfig.cmake.in cmake/OpenJPEGConfig.cmake.in +index 2925108ad..6e88036c6 100644 +--- cmake/OpenJPEGConfig.cmake.in ++++ cmake/OpenJPEGConfig.cmake.in +@@ -32,7 +32,7 @@ if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake) + set(INC_DIR "@CMAKE_INSTALL_PREFIX@/@OPENJPEG_INSTALL_INCLUDE_DIR@") + file(RELATIVE_PATH PKG_TO_INC_RPATH "${PKG_DIR}" "${INC_DIR}") + +- get_filename_component(OPENJPEG_INCLUDE_DIRS "${SELF_DIR}/${PKG_TO_INC_RPATH}" ABSOLUTE) ++ get_filename_component(OPENJPEG_INCLUDE_DIRS "${SELF_DIR}/${PKG_TO_INC_RPATH}" REALPATH) + + else() + if(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake) diff --git a/srcpkgs/openjpeg2/template b/srcpkgs/openjpeg2/template index 372fb65370..4e6f16ac7c 100644 --- a/srcpkgs/openjpeg2/template +++ b/srcpkgs/openjpeg2/template @@ -1,7 +1,7 @@ # Template file for 'openjpeg2' pkgname=openjpeg2 version=2.4.0 -revision=1 +revision=2 wrksrc="openjpeg-${version}" build_style=cmake configure_args="-DCMAKE_BUILD_TYPE=None" @@ -12,7 +12,6 @@ license="BSD-2-Clause" homepage="http://www.openjpeg.org/" distfiles="https://github.com/uclouvain/openjpeg/archive/v${version}.tar.gz" checksum=8702ba68b442657f11aaeb2b338443ca8d5fb95b0d845757968a7be31ef7f16d -patch_args="-Np1" post_install() { vlicense LICENSE