4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.illumos.org/license/CDDL.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
21 # Copyright (c) 2013-2016, Aurelien Larcher. All rights reserved.
22 # Copyright (c) 2019, Tim Mooney
23 # Copyright (c) 2024, Andreas Wacknitz
27 USE_COMMON_TEST_MASTER
= no
28 include ..
/..
/..
/make-rules
/shared-macros.mk
30 COMPONENT_NAME
= openjpeg
31 COMPONENT_VERSION
= 2.5.2
32 COMPONENT_SUMMARY
= OpenJPEG library
: Open source JPEG
2000 codecs
33 COMPONENT_SRC
= $(COMPONENT_NAME
)-$(COMPONENT_VERSION
)
34 COMPONENT_PROJECT_URL
= https
://www.openjpeg.org
/
35 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.gz
36 COMPONENT_ARCHIVE_HASH
= sha256
:90e3896fed910c376aaf79cdd98bdfdaf98c6472efd8e1debf0a854938cbda6a
37 COMPONENT_ARCHIVE_URL
= https
://github.com
/uclouvain
/openjpeg
/archive
/v
$(COMPONENT_VERSION
).
tar.gz
38 COMPONENT_FMRI
= image
/library
/openjpeg
39 COMPONENT_CLASSIFICATION
=System
/Libraries
40 COMPONENT_LICENSE
= BSD-2-Clause
41 COMPONENT_LICENSE_FILE
= LICENSE
44 # The test suite requires an extra 600+ MiB download of conformance data.
46 COMPONENT_NAME_1
= openjpeg-data
47 GIT_REPO_1
= https
://github.com
/uclouvain
/openjpeg-data
48 GIT_COMMIT_ID_1
= f9991d5
49 GIT_HASH_1
= sha256
:0bea3d2001c50846350342d02a7b1583051bb449d26fe879807cac462b2fdce1
50 COMPONENT_LICENSE_1
= $(COMPONENT_LICENSE
)
52 include $(WS_MAKE_RULES
)/common.mk
54 CFLAGS
+= -std
=c99
-D_XOPEN_SOURCE
=600
55 CFLAGS
+= $(CPP_LARGEFILES
)
57 CMAKE_OPTIONS
+= -DCMAKE_EXE_LINKER_FLAGS
:STRING
="-lnsl -lsocket"
58 # Openjpeg does not use CMake's internal variables.
59 CMAKE_OPTIONS
+= -DOPENJPEG_INSTALL_BIN_DIR
=$(CMAKE_BINDIR.
$(BITS
))
60 CMAKE_OPTIONS
+= -DOPENJPEG_INSTALL_LIB_DIR
=$(CMAKE_LIBDIR.
$(BITS
))
62 CMAKE_OPTIONS
+= -DOPENJPEG_INSTALL_SHARE_DIR
=$(USRSHAREDIR
)/lib
/java
63 CMAKE_OPTIONS
+= -DBUILD_CODEC
:BOOL
=ON
64 CMAKE_OPTIONS
+= -DBUILD_DOC
:BOOL
=OFF
65 CMAKE_OPTIONS
+= -DBUILD_JPIP
:BOOL
=ON
66 CMAKE_OPTIONS
+= -DBUILD_PKGCONFIG_FILES
:BOOL
=ON
67 CMAKE_OPTIONS
+= -DBUILD_SHARED_LIBS
:BOOL
=ON
68 CMAKE_OPTIONS
+= -DBUILD_STATIC_LIBS
:BOOL
=OFF
69 CMAKE_OPTIONS
+= -DBUILD_THIRDPARTY
:BOOL
=ON
70 CMAKE_OPTIONS
+= -DBUILD_TESTING
:BOOL
=ON
71 CMAKE_OPTIONS
+= -DOPJ_DATA_ROOT
:PATH
="$(BUILD_DIR_$(BITS))/../../$(COMPONENT_SRC_1)"
73 # Drop 32-bit binaries
74 COMPONENT_POST_INSTALL_ACTION
+= $(RM
) -r
$(PROTOUSRBINDIR32
);
75 # Move jar file to its destination (-DOPENJPEG_INSTALL_SHARE_DIR is being ignored)
76 COMPONENT_POST_INSTALL_ACTION
+= $(MKDIR
) -p
$(PROTO_DIR
)/usr
/share
/lib
/java
;
77 COMPONENT_POST_INSTALL_ACTION
+= $(MV
) $(PROTO_DIR
)/usr
/share
/opj_jpip_viewer.jar
$(PROTO_DIR
)/usr
/share
/lib
/java
/;
79 # Normalize test results
80 COMPONENT_TEST_TRANSFORMS
+= "-e 's/ *[0-9]\{1,\}\.[0-9]\{1,\} sec\$$//'" # timing
81 COMPONENT_TEST_TRANSFORMS
+= "-e '/^Total Test time/d'" # timing
82 COMPONENT_TEST_TRANSFORMS
+= "-e '/^ *Start/d'" # drop Start lines
83 COMPONENT_TEST_TRANSFORMS
+= "-e 's/^ *[0-9]\{1,\}\/[0-9]\{1,\} Test *\#[0-9]\{1,\}:/Test/'" # drop test numbers
85 # Auto-generated dependencies
86 REQUIRED_PACKAGES
+= system
/library
87 REQUIRED_PACKAGES
+= system
/library
/math