aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/jasper
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/jasper
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/jasper')
-rw-r--r--vcpkg/ports/jasper/check-for-atomics-support.patch12
-rw-r--r--vcpkg/ports/jasper/fix-library-name.patch13
-rw-r--r--vcpkg/ports/jasper/no_stdc_check.patch25
-rw-r--r--vcpkg/ports/jasper/portfile.cmake42
-rw-r--r--vcpkg/ports/jasper/vcpkg.json18
5 files changed, 110 insertions, 0 deletions
diff --git a/vcpkg/ports/jasper/check-for-atomics-support.patch b/vcpkg/ports/jasper/check-for-atomics-support.patch
new file mode 100644
index 0000000..132d07f
--- /dev/null
+++ b/vcpkg/ports/jasper/check-for-atomics-support.patch
@@ -0,0 +1,12 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8d2e9f9..110c245 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -591,6 +591,7 @@ set(JAS_HAVE_WIN32_THREADS FALSE)
+ if(JAS_ENABLE_MULTITHREADING_SUPPORT)
+ check_c_source_compiles("
+ #include <threads.h>
++ #include <stdatomic.h>
+ int main() {
+ thrd_t thread;
+ mtx_t mutex;
diff --git a/vcpkg/ports/jasper/fix-library-name.patch b/vcpkg/ports/jasper/fix-library-name.patch
new file mode 100644
index 0000000..2e53526
--- /dev/null
+++ b/vcpkg/ports/jasper/fix-library-name.patch
@@ -0,0 +1,13 @@
+diff --git a/build/pkgconfig/jasper.pc.in b/build/pkgconfig/jasper.pc.in
+index a4ce38f..a9a7bc4 100644
+--- a/build/pkgconfig/jasper.pc.in
++++ b/build/pkgconfig/jasper.pc.in
+@@ -6,7 +6,7 @@ Name: JasPer
+ Description: Image Processing/Coding Tool Kit with JPEG-2000 Support
+ Version: @JAS_VERSION@
+
+-Libs: -L${libdir} -ljasper
++Libs: -L${libdir} -ljasper@CMAKE_DEBUG_POSTFIX@
+ Requires.private: @JAS_PKGCONFIG_REQUIRES@
+ Cflags: -I${includedir}/jasper -I${includedir}
+ Cflags.private: -DLIBJASPER_STATIC_DEFINE
diff --git a/vcpkg/ports/jasper/no_stdc_check.patch b/vcpkg/ports/jasper/no_stdc_check.patch
new file mode 100644
index 0000000..0c579a5
--- /dev/null
+++ b/vcpkg/ports/jasper/no_stdc_check.patch
@@ -0,0 +1,25 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ba6f117..8d2e9f9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -424,7 +424,7 @@ if((DEFINED JAS_CROSSCOMPILING AND JAS_CROSSCOMPILING) OR
+ # (e.g., using -DJAS_STDC_VERSION=YYYYMML) or by changing the line below.
+ if(NOT JAS_WASM)
+ set(JAS_STDC_VERSION "0L" CACHE INTERNAL "The value of __STDC_VERSION__.")
+- if (JAS_STDC_VERSION STREQUAL "0L")
++ if (0)
+ message(FATAL_ERROR
+ "The value of __STDC_VERSION__ cannot be automatically determined "
+ "when cross-compiling. Please set JAS_STDC_VERSION to the value "
+@@ -434,8 +434,9 @@ if(NOT JAS_WASM)
+ endif()
+ endif()
+ else()
+- jas_get_stdc_version(status JAS_STDC_VERSION)
+- if(NOT status)
++ #jas_get_stdc_version(status JAS_STDC_VERSION)
++ set(JAS_STDC_VERSION 0L)
++ if(0)
+ message(FATAL_ERROR "Cannot determine the value of __STDC_VERSION__.")
+ endif()
+ endif()
diff --git a/vcpkg/ports/jasper/portfile.cmake b/vcpkg/ports/jasper/portfile.cmake
new file mode 100644
index 0000000..a777df3
--- /dev/null
+++ b/vcpkg/ports/jasper/portfile.cmake
@@ -0,0 +1,42 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO jasper-software/jasper
+ REF "version-${VERSION}"
+ SHA512 57d33b988f92a0aa2b30af983280c2210f4ed9548dc8a38ed34fce76698489ed37d05b11b1aa92d9c4d0223deb306fbbb11900b696ba080926d4aaf2b62b2740
+ HEAD_REF master
+ PATCHES
+ no_stdc_check.patch
+ fix-library-name.patch
+)
+
+if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
+ set(VCPKG_CXX_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_CXX_FLAGS}")
+ set(VCPKG_C_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_C_FLAGS}")
+endif()
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" JAS_ENABLE_SHARED)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DJAS_ENABLE_LIBHEIF=OFF # found via find_library instead of find_package
+ -DJAS_ENABLE_LIBJPEG=ON
+ -DJAS_ENABLE_DOC=OFF
+ -DJAS_ENABLE_LATEX=OFF
+ -DJAS_ENABLE_OPENGL=OFF # only used by programs, which are turned off
+ -DJAS_ENABLE_PROGRAMS=OFF
+ -DJAS_ENABLE_SHARED=${JAS_ENABLE_SHARED}
+ OPTIONS_DEBUG
+ -DCMAKE_DEBUG_POSTFIX=d # Due to CMakes FindJasper; Default for multi config generators.
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share")
+
+vcpkg_install_copyright(FILE_LIST ${SOURCE_PATH}/LICENSE.txt)
diff --git a/vcpkg/ports/jasper/vcpkg.json b/vcpkg/ports/jasper/vcpkg.json
new file mode 100644
index 0000000..9978a0f
--- /dev/null
+++ b/vcpkg/ports/jasper/vcpkg.json
@@ -0,0 +1,18 @@
+{
+ "name": "jasper",
+ "version": "4.2.8",
+ "description": "Open source implementation of the JPEG-2000 Part-1 standard",
+ "homepage": "https://github.com/jasper-software/jasper",
+ "license": null,
+ "dependencies": [
+ "libjpeg-turbo",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}