git: 3aff837326a9 - main - graphics/openjpeg: Update to 2.5.0

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sun, 22 May 2022 05:14:51 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3aff837326a9e23905d09d0d034df382f75f12e1

commit 3aff837326a9e23905d09d0d034df382f75f12e1
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-05-22 04:22:33 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-05-22 04:22:33 +0000

    graphics/openjpeg: Update to 2.5.0
    
    - Update WWW
    
    Changes:        https://github.com/uclouvain/openjpeg/releases
                    https://github.com/uclouvain/openjpeg/blob/master/CHANGELOG.md
                    https://github.com/uclouvain/openjpeg/blob/master/NEWS.md
    Security:       CVE-2013-4289, CVE-2013-4290, CVE-2018-16376, CVE-2018-20846, CVE-2019-6988, CVE-2021-29338
---
 graphics/openjpeg/Makefile                   | 15 +++++++++++++--
 graphics/openjpeg/distinfo                   |  6 +++---
 graphics/openjpeg/files/patch-CMakeLists.txt | 28 +++++-----------------------
 graphics/openjpeg/pkg-descr                  |  2 +-
 4 files changed, 22 insertions(+), 29 deletions(-)

diff --git a/graphics/openjpeg/Makefile b/graphics/openjpeg/Makefile
index c5528ebfb1cd..03b1702c9d38 100644
--- a/graphics/openjpeg/Makefile
+++ b/graphics/openjpeg/Makefile
@@ -1,7 +1,7 @@
 # Created by: trasz <trasz@pin.if.uz.zgora.pl>
 
 PORTNAME=	openjpeg
-PORTVERSION=	2.4.0
+PORTVERSION=	2.5.0
 DISTVERSIONPREFIX=	v
 CATEGORIES=	graphics
 
@@ -16,8 +16,10 @@ LIB_DEPENDS=	liblcms2.so:graphics/lcms2 \
 		libpng.so:graphics/png \
 		libtiff.so:graphics/tiff
 
-USES=		cmake cpe pkgconfig
+USES=		cmake cpe localbase:ldflags jpeg pkgconfig
 
+CMAKE_OFF=	BUILD_DOC BUILD_JAVA BUILD_JPIP BUILD_JPIP_SERVER BUILD_LUTS_GENERATOR BUILD_TESTING BUILD_THIRDPARTY BUILD_UNIT_TESTS BUILD_VIEWER WITH_ASTYLE
+CMAKE_ON=	BUILD_CODEC BUILD_PKGCONFIG_FILES BUILD_SHARED_LIBS BUILD_STATIC_LIBS
 USE_LDCONFIG=	yes
 
 PLIST_SUB=	PORTVERSION=${PORTVERSION} VER=${PORTVERSION:R}
@@ -27,4 +29,13 @@ USE_GITHUB=	yes
 
 CPE_VENDOR=	uclouvain
 
+post-patch:
+# Clean up bundled libraries
+	@${RM} -r ${WRKSRC}/thirdparty/astyle/
+	@${RM} -r ${WRKSRC}/thirdparty/include/
+	@${RM} -r ${WRKSRC}/thirdparty/liblcms2/
+	@${RM} -r ${WRKSRC}/thirdparty/libpng/
+	@${RM} -r ${WRKSRC}/thirdparty/libtiff/
+	@${RM} -r ${WRKSRC}/thirdparty/libz/
+
 .include <bsd.port.mk>
diff --git a/graphics/openjpeg/distinfo b/graphics/openjpeg/distinfo
index 31e0a46cee34..72da930c1f67 100644
--- a/graphics/openjpeg/distinfo
+++ b/graphics/openjpeg/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1609598845
-SHA256 (uclouvain-openjpeg-v2.4.0_GH0.tar.gz) = 8702ba68b442657f11aaeb2b338443ca8d5fb95b0d845757968a7be31ef7f16d
-SIZE (uclouvain-openjpeg-v2.4.0_GH0.tar.gz) = 2233229
+TIMESTAMP = 1653151054
+SHA256 (uclouvain-openjpeg-v2.5.0_GH0.tar.gz) = 0333806d6adecc6f7a91243b2b839ff4d2053823634d4f6ed7a59bc87409122a
+SIZE (uclouvain-openjpeg-v2.5.0_GH0.tar.gz) = 1867111
diff --git a/graphics/openjpeg/files/patch-CMakeLists.txt b/graphics/openjpeg/files/patch-CMakeLists.txt
index e1bf64d555f2..306d2fed2c30 100644
--- a/graphics/openjpeg/files/patch-CMakeLists.txt
+++ b/graphics/openjpeg/files/patch-CMakeLists.txt
@@ -1,37 +1,19 @@
---- CMakeLists.txt.orig	2019-04-02 12:45:15 UTC
+--- CMakeLists.txt.orig	2022-05-13 16:54:29 UTC
 +++ CMakeLists.txt
-@@ -363,14 +363,14 @@ if(BUILD_PKGCONFIG_FILES)
+@@ -370,14 +370,14 @@ if(BUILD_PKGCONFIG_FILES)
    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp2/libopenjp2.pc.cmake.in
      ${CMAKE_CURRENT_BINARY_DIR}/libopenjp2.pc @ONLY)
    install( FILES  ${CMAKE_CURRENT_BINARY_DIR}/libopenjp2.pc DESTINATION
 -    ${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig )
-+    libdata/pkgconfig)
- #
-   if(BUILD_JPWL)
-   # install in lib and not share (see multi-arch note above)
-   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjpwl/libopenjpwl.pc.cmake.in
-     ${CMAKE_CURRENT_BINARY_DIR}/libopenjpwl.pc @ONLY)
-   install( FILES  ${CMAKE_CURRENT_BINARY_DIR}/libopenjpwl.pc DESTINATION
--    ${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig )
-+    libdata/pkgconfig)
-   endif()
++    libdata/pkgconfig )
  #
    if(BUILD_JPIP)
-@@ -378,7 +378,7 @@ if(BUILD_PKGCONFIG_FILES)
+   # install in lib and not share (see multi-arch note above)
    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjpip/libopenjpip.pc.cmake.in
      ${CMAKE_CURRENT_BINARY_DIR}/libopenjpip.pc @ONLY)
    install( FILES  ${CMAKE_CURRENT_BINARY_DIR}/libopenjpip.pc DESTINATION
 -    ${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig )
-+    libdata/pkgconfig)
-   endif()
- #
-   if(BUILD_JP3D)
-@@ -386,7 +386,7 @@ if(BUILD_PKGCONFIG_FILES)
-   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp3d/libopenjp3d.pc.cmake.in
-     ${CMAKE_CURRENT_BINARY_DIR}/libopenjp3d.pc @ONLY)
-   install( FILES  ${CMAKE_CURRENT_BINARY_DIR}/libopenjp3d.pc DESTINATION
--    ${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig )
-+    libdata/pkgconfig)
++    libdata/pkgconfig )
    endif()
  endif()
  
diff --git a/graphics/openjpeg/pkg-descr b/graphics/openjpeg/pkg-descr
index 9eca790392df..976e15e41a45 100644
--- a/graphics/openjpeg/pkg-descr
+++ b/graphics/openjpeg/pkg-descr
@@ -12,4 +12,4 @@ Besides this main codec, OpenJPEG integrates several other modules:
 - JPIP (JPEG 2000 standard Part 9)
 - OPJViewer, a GUI viewer for J2K, JP2, JPWL and MJ2 files
 
-WWW: http://www.openjpeg.org/
+WWW: https://www.openjpeg.org/