[neon/forks/jxrlib/Neon/unstable] debian/patches: refine patch
Carlos De Maine
null at kde.org
Wed Aug 26 04:43:19 BST 2026
Git commit 37c02fc9d2a3de5be18484553cd9c9afdadfdbbc by Carlos De Maine.
Committed on 26/08/2026 at 03:43.
Pushed by carlosdem into branch 'Neon/unstable'.
refine patch
M +50 -22 debian/patches/usecmake.patch
https://invent.kde.org/neon/forks/jxrlib/-/commit/37c02fc9d2a3de5be18484553cd9c9afdadfdbbc
diff --git a/debian/patches/usecmake.patch b/debian/patches/usecmake.patch
index b188014..2a62caa 100644
--- a/debian/patches/usecmake.patch
+++ b/debian/patches/usecmake.patch
@@ -1,10 +1,9 @@
-Description: Prefer a cmake based build system
-Author: Mathieu Malaterre <malat at debian.org>
-Forwarded: https://jxrlib.codeplex.com/discussions/440294
-
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+new file mode 100644
+index 0000000..743b117
--- /dev/null
+++ b/CMakeLists.txt
-@@ -0,0 +1,156 @@
+@@ -0,0 +1,186 @@
+# Copyright Mathieu Malaterre <malat at debian.org>
+# BSD (Same as jxrlib)
+cmake_minimum_required(VERSION 3.5)
@@ -13,24 +12,34 @@ Forwarded: https://jxrlib.codeplex.com/discussions/440294
+# Need shared libs for ABI
+set(BUILD_SHARED_LIBS ON)
+
-+# helper macro to preserve original Makefile convention
-+macro(JXR_MAKE_OBJ SET_NAME)
-+ foreach(src ${SRC_${SET_NAME}})
-+ list(APPEND OBJ_${SET_NAME} ${DIR_${SET_NAME}}/${src})
-+ endforeach()
-+endmacro()
++include(GNUInstallDirs)
++include(TestBigEndian)
+
+if(NOT MSVC)
+ add_definitions(-D__ANSI__)
+ add_compile_options(-Wno-error=implicit-function-declaration)
+endif()
-+
-+include(TestBigEndian)
++
+test_big_endian(ISBIGENDIAN)
+if(ISBIGENDIAN)
+ set(DEF_ENDIAN _BIG__ENDIAN_)
+endif()
+
++set(PC_DEFINES "")
++if(NOT MSVC)
++ set(PC_DEFINES "${PC_DEFINES} -D__ANSI__")
++endif()
++if(ISBIGENDIAN)
++ set(PC_DEFINES "${PC_DEFINES} -D_BIG__ENDIAN_")
++endif()
++
++# helper macro to preserve original Makefile convention
++macro(JXR_MAKE_OBJ SET_NAME)
++ foreach(src ${SRC_${SET_NAME}})
++ list(APPEND OBJ_${SET_NAME} ${DIR_${SET_NAME}}/${src})
++ endforeach()
++endmacro()
++
+set(DIR_SYS image/sys)
+set(DIR_DEC image/decode)
+set(DIR_ENC image/encode)
@@ -39,8 +48,29 @@ Forwarded: https://jxrlib.codeplex.com/discussions/440294
+set(DIR_TEST jxrtestlib)
+set(DIR_EXEC jxrencoderdecoder)
+
-+set(VERSION "1.1")
++set(VERSION_H "${CMAKE_CURRENT_SOURCE_DIR}/${DIR_GLUE}/JXRVersion.h")
++file(READ "${VERSION_H}" FILE_CONTENTS)
++
++string(REGEX MATCH "#define[ \t]+JXR_VERSION_MAJOR[ \t]+([0-9]+)" _ "${FILE_CONTENTS}")
++set(JXR_VERSION_MAJOR ${CMAKE_MATCH_1})
++message(STATUS "JXR_VERSION_MAJOR is: ${JXR_VERSION_MAJOR}")
++
++string(REGEX MATCH "#define[ \t]+JXR_VERSION_MINOR[ \t]+([0-9]+)" _ "${FILE_CONTENTS}")
++set(JXR_VERSION_MINOR ${CMAKE_MATCH_1})
++message(STATUS "JXR_VERSION_MINOR is: ${JXR_VERSION_MINOR}")
++
++string(REGEX MATCH "#define[ \t]+JXR_VERSION_PATCH[ \t]+([0-9]+)" _ "${FILE_CONTENTS}")
++set(JXR_VERSION_PATCH ${CMAKE_MATCH_1})
++message(STATUS "JXR_VERSION_PATCH is: ${JXR_VERSION_PATCH}")
++
++set(JXR_VERSION "${JXR_VERSION_MAJOR}.${JXR_VERSION_MINOR}.${JXR_VERSION_PATCH}")
++message(STATUS "JXR_VERSION is: ${JXR_VERSION}")
++
++set(VERSION "${JXR_VERSION_MAJOR}.${JXR_VERSION_MINOR}")
++message(STATUS "VERSION is: ${VERSION}")
++
+set(SOVERSION "0")
++message(STATUS "SOVERSION is: ${SOVERSION}")
+
+if(NOT JXRLIB_INSTALL_BIN_DIR)
+ set(JXRLIB_INSTALL_BIN_DIR "bin")
@@ -95,7 +125,7 @@ Forwarded: https://jxrlib.codeplex.com/discussions/440294
+ LIBRARY DESTINATION ${JXRLIB_INSTALL_LIB_DIR} COMPONENT Libraries
+)
+
-+# JXR-GLUE
++# JXR-GLUE
+set(SRC_GLUE JXRGlue.c JXRMeta.c JXRGluePFC.c JXRGlueJxr.c)
+JXR_MAKE_OBJ(GLUE)
+set(SRC_TEST JXRTest.c JXRTestBmp.c JXRTestHdr.c JXRTestPnm.c JXRTestTif.c JXRTestYUV.c)
@@ -138,7 +168,6 @@ Forwarded: https://jxrlib.codeplex.com/discussions/440294
+target_link_libraries(${DECAPP} jxrglue) # jpegxr)
+install(TARGETS ${DECAPP} RUNTIME DESTINATION ${JXRLIB_INSTALL_BIN_DIR})
+
-+
+# Generate pkgconfig file
+include(JoinPaths.cmake)
+join_paths(JXRLIB_PKGCONF_LIB_DIR "\${prefix}" "${JXRLIB_INSTALL_LIB_DIR}")
@@ -154,7 +183,7 @@ Forwarded: https://jxrlib.codeplex.com/discussions/440294
+)
+
+# install rules
-+install(FILES jxrgluelib/JXRGlue.h jxrgluelib/JXRMeta.h jxrgluelib/JXRVersion.h jxrtestlib/JXRTest.h
++install(FILES jxrgluelib/JXRGlue.h jxrgluelib/JXRMeta.h jxrtestlib/JXRTest.h
+ image/sys/windowsmediaphoto.h
+ DESTINATION ${JXRLIB_INSTALL_INCLUDE_DIR} COMPONENT Headers
+)
@@ -163,7 +192,7 @@ Forwarded: https://jxrlib.codeplex.com/discussions/440294
+)
diff --git a/JoinPaths.cmake b/JoinPaths.cmake
new file mode 100644
-index 0000000..a767270
+index 0000000..6e241bf
--- /dev/null
+++ b/JoinPaths.cmake
@@ -0,0 +1,26 @@
@@ -195,7 +224,7 @@ index 0000000..a767270
+endfunction()
diff --git a/jxrlib.pc.in b/jxrlib.pc.in
new file mode 100644
-index 0000000..be9170c
+index 0000000..765bda8
--- /dev/null
+++ b/jxrlib.pc.in
@@ -0,0 +1,12 @@
@@ -207,8 +236,7 @@ index 0000000..be9170c
+Name: jxrlib
+Description: A library for reading JPEG XR images.
+
-+Version: @VERSION@
++Version: @JXR_VERSION@
+Libs: -L${libdir} -ljpegxr -ljxrglue
+Libs.private: -lm
-+Cflags: -I${includedir}/libjxr/common -I${includedir}/libjxr/image/x86 -I${includedir}/libjxr/image -I${includedir}/libjxr/glue -I${includedir}/libjxr/test -D__ANSI__ -DDISABLE_PERF_MEASUREMENT %(JXR_ENDIAN)s
---
++Cflags: -I${includedir}/libjxr/common -I${includedir}/libjxr/image/x86 -I${includedir}/libjxr/image -I${includedir}/libjxr/glue -I${includedir}/libjxr/test -DDISABLE_PERF_MEASUREMENT %(@PC_DEFINES@)s
More information about the Neon-commits
mailing list