1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-11 02:50:24 +00:00

graphics/leptonica: fix build with openjpeg 2.5.0

ChangeLog: https://github.com/DanBloomberg/leptonica/issues/623

Fix detection of openjpeg 2.5.0

PR:     264684
Reported by:    vvd@unislabs.com
Approved by:    hiroto.kagotani@gmail.com (maintainer, timeout > 1 month)
This commit is contained in:
VVD 2022-07-18 10:54:30 +02:00 committed by Fernando Apesteguía
parent 5281a948fa
commit cd714f2f4e

View File

@ -0,0 +1,59 @@
diff -u CMakeLists.txt.orig CMakeLists.txt
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -141,6 +141,17 @@
set(HAVE_LIBJP2K 1)
endif()
endif()
+ if(NOT JP2K)
+ find_path(JP2K_INCLUDE_DIR /openjpeg-2.5/openjpeg.h)
+ find_library(JP2K_LIBRARY NAMES openjp2)
+ if (JP2K_INCLUDE_DIR AND JP2K_LIBRARY)
+ set(JP2K 1)
+ set(JP2K_FOUND TRUE)
+ set(JP2K_LIBRARIES ${JP2K_LIBRARY})
+ set(JP2K_INCLUDE_DIRS ${JP2K_INCLUDE_DIR})
+ set(HAVE_LIBJP2K 1)
+ endif()
+ endif()
set(libs_private "${libs_private} -lopenjp2")
endif()
endif()
diff -u cmake/Configure.cmake.orig cmake/Configure.cmake
--- cmake/Configure.cmake.orig
+++ cmake/Configure.cmake
@@ -69,6 +69,7 @@
openjpeg-2.2/openjpeg.h
openjpeg-2.3/openjpeg.h
openjpeg-2.4/openjpeg.h
+ openjpeg-2.5/openjpeg.h
)
check_includes(include_files_list)
@@ -146,7 +147,9 @@
/* Define to 1 if you have zlib. */
#cmakedefine HAVE_LIBZ 1
-#if defined(HAVE_OPENJPEG_2_4_OPENJPEG_H)
+#if defined(HAVE_OPENJPEG_2_5_OPENJPEG_H)
+#define LIBJP2K_HEADER <openjpeg-2.5/openjpeg.h>
+#elif defined(HAVE_OPENJPEG_2_4_OPENJPEG_H)
#define LIBJP2K_HEADER <openjpeg-2.4/openjpeg.h>
#elif defined(HAVE_OPENJPEG_2_3_OPENJPEG_H)
#define LIBJP2K_HEADER <openjpeg-2.3/openjpeg.h>
diff -u config/config.h.in.orig config/config.h.in
--- config/config.h.in.orig
+++ config/config.h.in
@@ -51,6 +51,12 @@
/* Define to 1 if you have the <openjpeg-2.3/openjpeg.h> header file. */
#undef HAVE_OPENJPEG_2_3_OPENJPEG_H
+/* Define to 1 if you have the <openjpeg-2.4/openjpeg.h> header file. */
+#undef HAVE_OPENJPEG_2_4_OPENJPEG_H
+
+/* Define to 1 if you have the <openjpeg-2.5/openjpeg.h> header file. */
+#undef HAVE_OPENJPEG_2_5_OPENJPEG_H
+
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H