Skip to content

Commit

Permalink
openjph: update to 0.10.2, drop 32-bit
Browse files Browse the repository at this point in the history
  • Loading branch information
kmilos authored and Biswa96 committed Jan 8, 2024
1 parent 3c4e841 commit b268691
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 148 deletions.
216 changes: 76 additions & 140 deletions mingw-w64-openjph/0001-cmake-mingw-fixes.patch
Original file line number Diff line number Diff line change
@@ -1,156 +1,92 @@
--- OpenJPH-0.9.0/CMakeLists.txt.orig 2022-05-25 14:38:19.000000000 +0200
+++ OpenJPH-0.9.0/CMakeLists.txt 2024-01-04 14:44:47.955106100 +0100
@@ -1,11 +1,5 @@
cmake_minimum_required(VERSION 3.10.0)

-project (openjph DESCRIPTION "Open source implementation of JPH" LANGUAGES CXX)
-
-################################################################################################
-# Building OpenJPH
-################################################################################################
-
############################################################
# Parse version file
# credit: https://stackoverflow.com/a/47084079
@@ -25,6 +19,12 @@
set(OPENJPH_VERSION "${OPENJPH_VERSION_MAJOR}.${OPENJPH_VERSION_MINOR}.${OPENJPH_VERSION_PATCH}")
############################################################

+project (openjph VERSION ${OPENJPH_VERSION} DESCRIPTION "Open source implementation of JPH" LANGUAGES CXX)
+
+################################################################################################
+# Building OpenJPH
+################################################################################################
+
option(OJPH_DISABLE_INTEL_SIMD "Disables the use of SIMD instructions and associated files" OFF)
option(BUILD_SHARED_LIBS "Shared Libraries" ON)
option(OJPH_ENABLE_TIFF_SUPPORT "Enables input and output support for TIFF files" ON)
@@ -51,17 +51,10 @@
endif()
endif()

-if (BUILD_SHARED_LIBS AND MSVC)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D \"OJPH_BUILD_SHARED_LIBRARY\"")
-endif()
-
if (OJPH_CODE_COVERAGE AND NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
--- OpenJPH-0.10.2/CMakeLists.txt.orig 2024-01-06 22:52:52.000000000 +0100
+++ OpenJPH-0.10.2/CMakeLists.txt 2024-01-08 11:34:52.402267000 +0100
@@ -68,12 +68,6 @@
add_compile_options(-DOJPH_ENABLE_INTEL_AVX512)
endif()

-## specify output directories
-## this will be refined further for Debug and Release builds in included CMakeLists.txt
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../bin)
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../bin)
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../lib)
-
## Build library and applications
add_subdirectory(src/core)
if (OJPH_BUILD_EXECUTABLES)
@@ -84,11 +78,6 @@
# Install
################################################################################################

-set(PKG_CONFIG_INCLUDEDIR "\${prefix}/include")
-set(PKG_CONFIG_LIBDIR "\${prefix}/lib")
-set(PKG_CONFIG_LIBS "-L\${libdir} -lopenjph")
-set(PKG_CONFIG_CFLAGS "-I\${includedir}")
-
include_directories(src/core/common)
include_directories(src/apps/common)
include(GNUInstallDirs)
install(TARGETS openjph
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -96,13 +86,18 @@
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

install(DIRECTORY src/core/common/
- DESTINATION include/openjph
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openjph
FILES_MATCHING
PATTERN "*.h")

@@ -94,9 +87,14 @@
source_group("others" FILES ${OTHERS})
source_group("transform" FILES ${TRANSFORM})
install(FILES "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)

+set(PKG_CONFIG_INCLUDEDIR "\${prefix}/include")
+set(PKG_CONFIG_LIBDIR "\${prefix}/lib")
+set(PKG_CONFIG_INCLUDEDIR "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
+set(PKG_CONFIG_LIBDIR "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
+set(PKG_CONFIG_LIBS "-L\${libdir} -lopenjph")
+set(PKG_CONFIG_CFLAGS "-I\${includedir}")
+
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/src/pkg-config.pc.cmake"
- "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${PROJECT_NAME}.pc"
+ "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc"
)

if(EMSCRIPTEN)
@@ -125,8 +123,12 @@

target_compile_definitions(openjph PUBLIC _FILE_OFFSET_BITS=64)

+if (BUILD_SHARED_LIBS AND WIN32)
+ target_compile_definitions(openjph PRIVATE OJPH_BUILD_SHARED_LIBRARY)
+endif()
+
if (OPENJPH_VERSION)
- if (WIN32)
+ if (MSVC)
set_target_properties(openjph
PROPERTIES
OUTPUT_NAME "openjph.${OPENJPH_VERSION_MAJOR}.${OPENJPH_VERSION_MINOR}")
@@ -160,7 +162,7 @@
############################################################
if( OJPH_ENABLE_TIFF_SUPPORT )

- if( WIN32 )
+ if( MSVC )

set(TIFF_INCLUDE_DIR "C:\\Program Files\\tiff\\include" CACHE PATH "the directory containing the TIFF headers")
set(TIFF_LIBRARY_DEBUG "C:\\Program Files\\tiff\\lib\\tiffd.lib" CACHE FILEPATH "the path to the TIFF library for debug configurations")
@@ -175,7 +177,7 @@
message( STATUS " TIFFXX_LIBRARY_DEBUG : \"${TIFFXX_LIBRARY_DEBUG}\" " )
message( STATUS " TIFFXX_LIBRARY_RELEASE : \"${TIFFXX_LIBRARY_RELEASE}\" " )

- endif( WIN32 )
+ endif( MSVC )

FIND_PACKAGE( TIFF )

@@ -205,8 +207,8 @@
list(APPEND OJPH_COMPRESS ${OJPH_IMG_IO_AVX2})
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc"
@@ -116,4 +111,3 @@
enable_testing()
add_subdirectory(tests)
endif()
-
--- OpenJPH-0.10.2/src/apps/CMakeLists.txt.orig 2024-01-08 11:33:04.858155500 +0100
+++ OpenJPH-0.10.2/src/apps/CMakeLists.txt 2024-01-08 11:36:16.066877800 +0100
@@ -34,14 +34,6 @@
endif()
############################################################

- ## Change folders
- set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/../bin)
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/../bin)
- set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/../lib)
- set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/../bin)
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/../bin)
- set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/../lib)
-
## Build executables
add_subdirectory(ojph_expand)
add_subdirectory(ojph_compress)
--- OpenJPH-0.10.2/src/core/CMakeLists.txt.orig 2024-01-06 22:52:52.000000000 +0100
+++ OpenJPH-0.10.2/src/core/CMakeLists.txt 2024-01-08 11:38:08.421727800 +0100
@@ -1,11 +1,3 @@
-
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/../bin)
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/../bin)
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/../lib)
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/../bin)
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/../bin)
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/../lib)
-
include_directories(common)

-add_executable(ojph_expand ${OJPH_EXPAND})
-add_executable(ojph_compress ${OJPH_COMPRESS})
+# add_executable(ojph_expand ${OJPH_EXPAND})
+# add_executable(ojph_compress ${OJPH_COMPRESS})

if (MSVC)
set_source_files_properties(src/apps/others/ojph_img_io_avx2.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX2")
@@ -215,35 +217,37 @@
set_source_files_properties(src/apps/others/ojph_img_io_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2)
file(GLOB CODESTREAM "codestream/*.cpp" "codestream/*.h")
@@ -89,7 +89,7 @@
set_source_files_properties(transform/ojph_transform_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2)
endif()

-if( USE_TIFF )
- target_link_libraries(ojph_expand openjph ${TIFF_LIBRARIES})
- target_link_libraries(ojph_compress openjph ${TIFF_LIBRARIES})
-else()
- target_link_libraries(ojph_expand openjph)
- target_link_libraries(ojph_compress openjph)
-endif()
+# if( USE_TIFF )
+ # target_link_libraries(ojph_expand openjph ${TIFF_LIBRARIES})
+ # target_link_libraries(ojph_compress openjph ${TIFF_LIBRARIES})
+# else()
+ # target_link_libraries(ojph_expand openjph)
+ # target_link_libraries(ojph_compress openjph)
+# endif()


################################################################################################
# Install
################################################################################################

-install(TARGETS ojph_expand
- DESTINATION bin)
+# install(TARGETS ojph_expand
+ # DESTINATION bin)

-install(TARGETS ojph_compress
- DESTINATION bin)
+# install(TARGETS ojph_compress
+ # DESTINATION bin)

include(GNUInstallDirs)
-install(TARGETS openjph LIBRARY
- DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(TARGETS openjph
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

install (DIRECTORY src/core/common/
DESTINATION include/openjph
FILES_MATCHING
PATTERN "*.h")

-install(FILES "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${PROJECT_NAME}.pc"
+install(FILES "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)

################################################################################################
-if (WIN32)
+if (MSVC)
set(OJPH_LIB_NAME_STRING "openjph.${OPENJPH_VERSION_MAJOR}.${OPENJPH_VERSION_MINOR}")
set_target_properties(openjph
PROPERTIES
16 changes: 8 additions & 8 deletions mingw-w64-openjph/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@
_realname=openjph
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.9.0
pkgver=0.10.2
pkgrel=1
pkgdesc="Open-source implementation of HTJ2K (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
msys2_repository_url='https://github.com/aous72/OpenJPH'
url="https://openjph.org/"
license=("spdx:BSD-2-Clause")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-libtiff")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja")
source=(${_realname}-${pkgver}.tar.gz::https://github.com/aous72/OpenJPH/archive/${pkgver}.tar.gz
0001-cmake-mingw-fixes.patch)
sha256sums=('6970b14e73babb7a2e466be115e45fc55e9e02104248938257dd5bac5c67d41a'
'da3eb53bfd08d10687c140b64e12a7b9e97eac7a7f915af8764a3becc8308f37')
sha256sums=('f7eb6115a256b36bdcb8088a8cb3d58a3a7475c9031807f3b356de3074692e8c'
'f77c2a2c26fb6c485175b0f79ab7c6bc4cd0e3cd3e767671252b74329c55b516')

prepare() {
cd "${srcdir}"/OpenJPH-${pkgver}

Expand Down Expand Up @@ -48,7 +50,6 @@ build() {
-DCMAKE_SYSTEM_PREFIX_PATH=${MINGW_PREFIX} \
-DOJPH_DISABLE_INTEL_SIMD=$( [[ ${CARCH} == aarch64 ]] &&
echo "ON" || echo "OFF" ) \
-DOJPH_ENABLE_TIFF_SUPPORT=OFF \
../OpenJPH-${pkgver}

${MINGW_PREFIX}/bin/cmake --build ./
Expand All @@ -68,7 +69,6 @@ build() {
-DCMAKE_SYSTEM_PREFIX_PATH=${MINGW_PREFIX} \
-DOJPH_DISABLE_INTEL_SIMD=$( [[ ${CARCH} == aarch64 ]] &&
echo "ON" || echo "OFF" ) \
-DOJPH_ENABLE_TIFF_SUPPORT=OFF \
../OpenJPH-${pkgver}

${MINGW_PREFIX}/bin/cmake --build ./
Expand All @@ -81,5 +81,5 @@ package() {
cd "${srcdir}/build-shared-${MSYSTEM}"
DESTDIR=${pkgdir} ${MINGW_PREFIX}/bin/cmake --install .

install -Dm644 "${srcdir}/OpenJPH-${pkgver}/license.txt" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
install -Dm644 "${srcdir}/OpenJPH-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}

0 comments on commit b268691

Please sign in to comment.