Update mingw-w64-jasper to 3.0.4
This commit is contained in:
parent
83771dced3
commit
a88a8e3daa
|
@ -0,0 +1,39 @@
|
||||||
|
From 4f15088f82a2a001f064cee1ef9cfe23d281e957 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martchus <martchus@gmx.net>
|
||||||
|
Date: Tue, 14 Jun 2022 23:12:32 +0200
|
||||||
|
Subject: [PATCH 1/3] Fix exports
|
||||||
|
|
||||||
|
---
|
||||||
|
src/libjasper/jp2/jp2_cod.h | 10 +++++-----
|
||||||
|
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/libjasper/jp2/jp2_cod.h b/src/libjasper/jp2/jp2_cod.h
|
||||||
|
index 81d3b7e..4f22fa3 100644
|
||||||
|
--- a/src/libjasper/jp2/jp2_cod.h
|
||||||
|
+++ b/src/libjasper/jp2/jp2_cod.h
|
||||||
|
@@ -288,10 +288,10 @@ typedef struct jp2_boxinfo_s {
|
||||||
|
* Box class.
|
||||||
|
\******************************************************************************/
|
||||||
|
|
||||||
|
-jp2_box_t *jp2_box_create(int type);
|
||||||
|
-void jp2_box_destroy(jp2_box_t *box);
|
||||||
|
-jp2_box_t *jp2_box_get(jas_stream_t *in);
|
||||||
|
-int jp2_box_put(jp2_box_t *box, jas_stream_t *out);
|
||||||
|
+JAS_DLLEXPORT jp2_box_t *jp2_box_create(int type);
|
||||||
|
+JAS_DLLEXPORT void jp2_box_destroy(jp2_box_t *box);
|
||||||
|
+JAS_DLLEXPORT jp2_box_t *jp2_box_get(jas_stream_t *in);
|
||||||
|
+JAS_DLLEXPORT int jp2_box_put(jp2_box_t *box, jas_stream_t *out);
|
||||||
|
|
||||||
|
JAS_ATTRIBUTE_CONST
|
||||||
|
static inline uint_least8_t JP2_DTYPETOBPC(uint_least8_t dtype)
|
||||||
|
@@ -309,6 +309,6 @@ static inline uint_least8_t JP2_BPCTODTYPE(uint_least8_t bpc)
|
||||||
|
#define ICC_CS_YCBCR 0x59436272
|
||||||
|
#define ICC_CS_GRAY 0x47524159
|
||||||
|
|
||||||
|
-const jp2_cdefchan_t *jp2_cdef_lookup(jp2_cdef_t *cdef, int channo);
|
||||||
|
+JAS_DLLEXPORT const jp2_cdefchan_t *jp2_cdef_lookup(jp2_cdef_t *cdef, int channo);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
--
|
||||||
|
2.36.1
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
From f783c72a35b0cbf8d04b9d9472e267c72c52e1ff Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martchus <martchus@gmx.net>
|
||||||
|
Date: Tue, 14 Jun 2022 23:13:06 +0200
|
||||||
|
Subject: [PATCH 2/3] Fix building for mingw-w64 target
|
||||||
|
|
||||||
|
---
|
||||||
|
CMakeLists.txt | 2 ++
|
||||||
|
src/libjasper/CMakeLists.txt | 8 ++++++++
|
||||||
|
2 files changed, 10 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index 52ad5a8..72257ec 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -723,10 +723,12 @@ message("JAS_INCLUDE_HEIC_CODEC: ${JAS_INCLUDE_HEIC_CODEC}")
|
||||||
|
# Check for the Math library.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
+if(NOT WIN32)
|
||||||
|
find_library(MATH_LIBRARY m)
|
||||||
|
if(NOT MATH_LIBRARY)
|
||||||
|
set(MATH_LIBRARY "")
|
||||||
|
endif()
|
||||||
|
+endif()
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Perform shared library setup.
|
||||||
|
diff --git a/src/libjasper/CMakeLists.txt b/src/libjasper/CMakeLists.txt
|
||||||
|
index c0b19b3..9fab05f 100644
|
||||||
|
--- a/src/libjasper/CMakeLists.txt
|
||||||
|
+++ b/src/libjasper/CMakeLists.txt
|
||||||
|
@@ -182,6 +182,14 @@ target_include_directories(libjasper BEFORE PRIVATE
|
||||||
|
set_target_properties(libjasper PROPERTIES
|
||||||
|
OUTPUT_NAME jasper LINKER_LANGUAGE C)
|
||||||
|
|
||||||
|
+if (MINGW)
|
||||||
|
+ set_target_properties(libjasper
|
||||||
|
+ PROPERTIES
|
||||||
|
+ OUTPUT_NAME jasper
|
||||||
|
+ RUNTIME_OUTPUT_NAME jasper-${JAS_SO_VERSION}
|
||||||
|
+ ARCHIVE_OUTPUT_NAME jasper)
|
||||||
|
+endif()
|
||||||
|
+
|
||||||
|
if(MSVC)
|
||||||
|
target_compile_definitions(libjasper PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||||
|
target_compile_definitions(libjasper PRIVATE _CRT_SECURE_NO_DEPRECATE)
|
||||||
|
--
|
||||||
|
2.36.1
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
From 5e697686ff137496f5ede4b1ee21d67ea682186a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martchus <martchus@gmx.net>
|
||||||
|
Date: Tue, 14 Jun 2022 23:14:10 +0200
|
||||||
|
Subject: [PATCH 3/3] Fix filename buffer overflow
|
||||||
|
|
||||||
|
---
|
||||||
|
src/libjasper/include/jasper/jas_stream.h | 9 ++++++++-
|
||||||
|
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/libjasper/include/jasper/jas_stream.h b/src/libjasper/include/jasper/jas_stream.h
|
||||||
|
index d8938d1..61a6e66 100644
|
||||||
|
--- a/src/libjasper/include/jasper/jas_stream.h
|
||||||
|
+++ b/src/libjasper/include/jasper/jas_stream.h
|
||||||
|
@@ -77,6 +77,7 @@
|
||||||
|
#include <jasper/jas_config.h> /* IWYU pragma: export */
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
+#include <limits.h>
|
||||||
|
#if defined(JAS_HAVE_FCNTL_H)
|
||||||
|
#include <fcntl.h>
|
||||||
|
#endif
|
||||||
|
@@ -100,6 +101,12 @@ extern "C" {
|
||||||
|
#define O_BINARY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#ifdef PATH_MAX
|
||||||
|
+#define JAS_PATH_MAX PATH_MAX
|
||||||
|
+#else
|
||||||
|
+#define JAS_PATH_MAX 4096
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* Stream open flags.
|
||||||
|
*/
|
||||||
|
@@ -258,7 +265,7 @@ typedef struct {
|
||||||
|
typedef struct {
|
||||||
|
int fd;
|
||||||
|
int flags;
|
||||||
|
- char pathname[L_tmpnam + 1];
|
||||||
|
+ char pathname[JAS_PATH_MAX + 1];
|
||||||
|
} jas_stream_fileobj_t;
|
||||||
|
|
||||||
|
/* Delete underlying file object upon stream close. */
|
||||||
|
--
|
||||||
|
2.36.1
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
# Maintainer: Martchus <martchus@gmx.net>
|
||||||
|
# Contributor: drakkan <nicola.murino at gmail dot com>
|
||||||
|
|
||||||
|
pkgname=mingw-w64-jasper
|
||||||
|
pkgver=3.0.4
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc="A software-based implementation of the codec specified in the emerging JPEG-2000 Part-1 standard (mingw-w64)"
|
||||||
|
arch=(any)
|
||||||
|
url='https://www.ece.uvic.ca/~frodo/jasper/'
|
||||||
|
license=("custom:JasPer2.0")
|
||||||
|
makedepends=('mingw-w64-cmake')
|
||||||
|
depends=('mingw-w64-libjpeg-turbo')
|
||||||
|
options=(staticlibs !strip !buildflags)
|
||||||
|
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/mdadams/jasper/archive/version-${pkgver}.tar.gz
|
||||||
|
0001-Fix-exports.patch
|
||||||
|
0002-Fix-building-for-mingw-w64-target.patch
|
||||||
|
0003-Fix-filename-buffer-overflow.patch)
|
||||||
|
sha512sums=('1846d5c5c263ea9f3279a33e9be50350d2e91ea91271af5e6423b3fd87e069abc51290196f0e4ef72e54b0e727171d66562c0b855396afbed06dc9b0bb7bef04'
|
||||||
|
'0eb2588a54e154ca93977088a63b7261bed605047e51ae0e9d537b0abbb5846a94f47f3e5df7cfd753d12c80273b922c74a752578938d3ba4da81f3b756b0ffb'
|
||||||
|
'bd61f586bc910fd698d5f3e66a7892a63ee85eabc6c2802672d607d1b7b3fda6e412973f5bcc7b47db2c80b3c627f679dd45cbe2d13b08f8520314d4d29e2468'
|
||||||
|
'31d900b6c160205151cbfac9f36fa0e5243dc87b0b8eab159cfa0b6935d87dd08119a52a0f853e6c2f3f754ca6c0030ec229379deb68ba16befd5f99983112ad')
|
||||||
|
|
||||||
|
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
cd "$srcdir/jasper-version-$pkgver"
|
||||||
|
patch -p1 -i "${srcdir}"/0001-Fix-exports.patch
|
||||||
|
patch -p1 -i "${srcdir}"/0002-Fix-building-for-mingw-w64-target.patch
|
||||||
|
patch -p1 -i "${srcdir}"/0003-Fix-filename-buffer-overflow.patch
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "$srcdir/jasper-version-$pkgver"
|
||||||
|
local options=(
|
||||||
|
-DCMAKE_INSTALL_LIBDIR=lib
|
||||||
|
-DCMAKE_BUILD_TYPE=Release
|
||||||
|
-DJAS_ENABLE_OPENGL=OFF
|
||||||
|
-DJAS_ENABLE_LIBJPEG=ON
|
||||||
|
-DJAS_ENABLE_AUTOMATIC_DEPENDENCIES=OFF
|
||||||
|
-DCMAKE_SKIP_RPATH=ON
|
||||||
|
-DJAS_ENABLE_DOC=OFF
|
||||||
|
-DJAS_STDC_VERSION=201112L
|
||||||
|
)
|
||||||
|
for _arch in ${_architectures}; do
|
||||||
|
mkdir -p build-${_arch}-static && pushd build-${_arch}-static
|
||||||
|
${_arch}-cmake ${options[@]} -DJAS_ENABLE_SHARED=OFF ..
|
||||||
|
make
|
||||||
|
popd
|
||||||
|
mkdir -p build-${_arch} && pushd build-${_arch}
|
||||||
|
${_arch}-cmake ${options[@]} -DJAS_ENABLE_SHARED=ON ..
|
||||||
|
make
|
||||||
|
popd
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
for _arch in ${_architectures}; do
|
||||||
|
cd "${srcdir}/jasper-version-${pkgver}/build-${_arch}-static"
|
||||||
|
make DESTDIR="$pkgdir" install
|
||||||
|
cd "${srcdir}/jasper-version-${pkgver}/build-${_arch}"
|
||||||
|
make DESTDIR="$pkgdir" install
|
||||||
|
rm -r "$pkgdir/usr/${_arch}/share"
|
||||||
|
${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
|
||||||
|
${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
|
||||||
|
if [[ $NO_EXECUTABLES ]]; then
|
||||||
|
find "${pkgdir}/usr/${_arch}" -name '*.exe' -delete
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# vim: ts=2 sw=2 et:
|
Loading…
Reference in New Issue