Skip to content

Commit

Permalink
graphics/openjp2: update to 2.5.2.
Browse files Browse the repository at this point in the history
- use https HOMEPAGE
- bump major
- cf https://github.com/uclouvain/openjpeg/blob/v2.5.2/CHANGELOG.md#v252-2024-02-28
  & https://github.com/uclouvain/openjpeg/blob/v2.5.2/CHANGELOG.md#v251-2024-02-26
for details, including CVE-2021-3575
- drop now unneeded patches, last one remaining upstreamed in
  uclouvain/openjpeg#1520
- similar diff sent by brad

tested in a bulk by tb@
  • Loading branch information
landryb committed Mar 5, 2024
1 parent fbf54aa commit 3e1e46a
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 73 deletions.
9 changes: 4 additions & 5 deletions graphics/openjp2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@ COMMENT= open-source JPEG 2000 codec library

GH_ACCOUNT= uclouvain
GH_PROJECT= openjpeg
GH_TAGNAME= v2.5.0
GH_TAGNAME= v2.5.2
DISTNAME= openjp2-${GH_TAGNAME:S/v//}

SHARED_LIBS += openjp2 5.0
SHARED_LIBS += openjp2 6.0

CATEGORIES= graphics

HOMEPAGE= http://www.openjpeg.org/
HOMEPAGE= https://www.openjpeg.org/

# BSD
PERMIT_PACKAGE= Yes

WANTLIB += c lcms2 m png pthread tiff z

MODULES= devel/cmake
CONFIGURE_ARGS= -DOPENJPEG_INSTALL_MAN_DIR=man \
-DOPJ_DATA_ROOT=${WRKDIR}/data \
CONFIGURE_ARGS= -DOPJ_DATA_ROOT=${WRKDIR}/data \
-DBUILD_TESTING=True

LIB_DEPENDS= graphics/lcms2 \
Expand Down
4 changes: 2 additions & 2 deletions graphics/openjp2/distinfo
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SHA256 (openjp2-2.5.0.tar.gz) = AzOAbWrezG96kSQ7K4Of9NIFOCNjTU9u16WbyHQJEio=
SIZE (openjp2-2.5.0.tar.gz) = 1867111
SHA256 (openjp2-2.5.2.tar.gz) = kOOJb+2RDDdqr3nN2Yvf2vmMZHLv2OHevwqFSTjL2mo=
SIZE (openjp2-2.5.2.tar.gz) = 1871948
15 changes: 0 additions & 15 deletions graphics/openjp2/patches/patch-CMakeLists_txt

This file was deleted.

28 changes: 22 additions & 6 deletions graphics/openjp2/patches/patch-src_bin_jp2_convert_c
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
fix build on big endian

https://github.com/uclouvain/openjpeg/pull/1520
https://github.com/uclouvain/openjpeg/commit/995d8c96b51f3e510457cf71b5b5902de11dc08c

Index: src/bin/jp2/convert.c
--- src/bin/jp2/convert.c.orig
+++ src/bin/jp2/convert.c
@@ -662,7 +662,7 @@ static int tga_readheader(FILE *fp, unsigned int *bits
return 1;
}
@@ -664,7 +664,7 @@ static int tga_readheader(FILE *fp, unsigned int *bits

-#ifdef OPJ_BIG_ENDIAN
+#if defined(OPJ_BIG_ENDIAN) && !defined(swap16)
#ifdef OPJ_BIG_ENDIAN

static INLINE OPJ_UINT16 swap16(OPJ_UINT16 x)
-static INLINE OPJ_UINT16 swap16(OPJ_UINT16 x)
+static INLINE OPJ_UINT16 opj_swap16(OPJ_UINT16 x)
{
return (OPJ_UINT16)(((x & 0x00ffU) << 8) | ((x & 0xff00U) >> 8));
}
@@ -733,8 +733,8 @@ static int tga_writeheader(FILE *fp, int bits_per_pixe
goto fails;
}
#else
- image_w = swap16(image_w);
- image_h = swap16(image_h);
+ image_w = opj_swap16(image_w);
+ image_h = opj_swap16(image_h);
if (fwrite(&image_w, 2, 1, fp) != 1) {
goto fails;
}
40 changes: 0 additions & 40 deletions graphics/openjp2/patches/patch-thirdparty_CMakeLists_txt

This file was deleted.

10 changes: 5 additions & 5 deletions graphics/openjp2/pkg/PLIST
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
include/openjpeg-2.5/
include/openjpeg-2.5/openjpeg.h
include/openjpeg-2.5/opj_config.h
include/openjpeg-2.5/opj_stdint.h
lib/cmake/openjpeg-2.5/
lib/cmake/openjpeg-2.5/OpenJPEGConfig.cmake
lib/cmake/openjpeg-2.5/OpenJPEGConfigVersion.cmake
lib/cmake/openjpeg-2.5/OpenJPEGTargets${MODCMAKE_BUILD_SUFFIX}
lib/cmake/openjpeg-2.5/OpenJPEGTargets.cmake
@static-lib lib/libopenjp2.a
@lib lib/libopenjp2.so.${LIBopenjp2_VERSION}
lib/openjpeg-2.5/
lib/openjpeg-2.5/OpenJPEGConfig.cmake
lib/openjpeg-2.5/OpenJPEGTargets${MODCMAKE_BUILD_SUFFIX}
lib/openjpeg-2.5/OpenJPEGTargets.cmake
lib/pkgconfig/libopenjp2.pc
@man man/man1/opj_compress.1
@man man/man1/opj_decompress.1
Expand Down

0 comments on commit 3e1e46a

Please sign in to comment.