2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL)". You may
4 # only use this file in accordance with the terms of the CDDL.
6 # A full copy of the text of the CDDL should have accompanied this
7 # source. A copy of the CDDL is also available via the Internet at
8 # http://www.illumos.org/license/CDDL.
12 # Copyright 2015 Aurelien Larcher
17 USE_COMMON_TEST_MASTER
= no
18 include ..
/..
/..
/make-rules
/shared-macros.mk
20 COMPONENT_NAME
= libjpeg-turbo
21 COMPONENT_VERSION
= 3.0.4
23 COMPONENT_SUMMARY
= libjpeg
-JPEG Turbo libraries
24 COMPONENT_PROJECT_URL
= https
://www.libjpeg-turbo.org
/
25 COMPONENT_SRC
= $(COMPONENT_NAME
)-$(COMPONENT_VERSION
)
26 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.gz
27 COMPONENT_ARCHIVE_HASH
= sha256
:99130559e7d62e8d695f2c0eaeef912c5828d5b84a0537dcb24c9678c9d5b76b
28 COMPONENT_ARCHIVE_URL
= https
://github.com
/libjpeg-turbo
/libjpeg-turbo
/releases
/download
/$(COMPONENT_VERSION
)/$(COMPONENT_ARCHIVE
)
29 COMPONENT_FMRI
= image
/library
/libjpeg-turbo
30 COMPONENT_CLASSIFICATION
= System
/Multimedia Libraries
31 COMPONENT_LICENSE
= IJG
,BSD
,zlib
32 COMPONENT_LICENSE_FILE
= LICENSE.md
34 COMPONENT_FMRI.libjpeg6-turbo
= image
/library
/libjpeg6-turbo
36 COMPONENT_FMRI.libjpeg6-turbo-32
= $(COMPONENT_FMRI.libjpeg6-turbo
)/32
37 COMPONENT_SUMMARY.libjpeg6-turbo-32
= $(COMPONENT_SUMMARY
) (32-bit
)
39 COMPONENT_FMRI.libjpeg7-turbo
= image
/library
/libjpeg7-turbo
41 COMPONENT_FMRI.libjpeg7-turbo-32
= $(COMPONENT_FMRI.libjpeg7-turbo
)/32
42 COMPONENT_SUMMARY.libjpeg7-turbo-32
= $(COMPONENT_SUMMARY
) (32-bit
)
44 COMPONENT_FMRI.libjpeg8-turbo
= image
/library
/libjpeg8-turbo
46 COMPONENT_FMRI.libjpeg8-turbo-32
= $(COMPONENT_FMRI.libjpeg8-turbo
)/32
47 COMPONENT_SUMMARY.libjpeg8-turbo-32
= $(COMPONENT_SUMMARY
) (32-bit
)
49 JPEG_API_VERSIONS
= 6 7 8
51 # Custom BUILD_*, INSTALL_*, and TEST_* variables needs to be defined before
52 # the common.mk include.
54 $(eval BUILD_
$(b
) = $(foreach v
,$(JPEG_API_VERSIONS
),$(BUILD_DIR
)/$(MACH
$(b
))/$(v
)/.built
)) \
55 $(eval INSTALL_
$(b
) = $(foreach v
,$(JPEG_API_VERSIONS
),$(BUILD_DIR
)/$(MACH
$(b
))/$(v
)/.installed
)) \
56 $(if
$(strip $(wildcard $(COMPONENT_TEST_RESULTS_DIR
)/results-
*.master
)), \
57 $(eval TEST_
$(b
) = $(foreach v
,$(JPEG_API_VERSIONS
),$(BUILD_DIR
)/$(MACH
$(b
))/$(v
)/.tested-and-compared
)) \
59 $(eval TEST_
$(b
) = $(foreach v
,$(JPEG_API_VERSIONS
),$(BUILD_DIR
)/$(MACH
$(b
))/$(v
)/.tested
)) \
63 include $(WS_MAKE_RULES
)/common.mk
65 # Set BITS and JPEG_API_VERSION for all targets
66 $(foreach t
,configured built installed tested tested-and-compared
, \
68 $(eval
$(BUILD_DIR_
$(b
))/%/.
$(t
): BITS
=$(b
)) \
70 $(foreach v
,$(JPEG_API_VERSIONS
), \
71 $(eval
$(BUILD_DIR
)/%/$(v
)/.
$(t
): JPEG_API_VERSION
=$(v
)) \
75 # Settings to build the desired libjpeg API
77 CMAKE_OPTIONS.JPEG7
= -DWITH_JPEG7
=ON
78 CMAKE_OPTIONS.JPEG8
= -DWITH_JPEG8
=ON
80 # TurboAPI does not depend on libjpeg API version so it is enough to build it
82 CMAKE_OPTIONS.JPEG6
+= -DWITH_TURBOJPEG
=FALSE
83 CMAKE_OPTIONS.JPEG7
+= -DWITH_TURBOJPEG
=FALSE
85 # Include files for old libjpeg API versions goes to separate directory
86 CMAKE_OPTIONS.JPEG6
+= -DCMAKE_INSTALL_INCLUDEDIR
=$(USRINCDIR
)/libjpeg
$(JPEG_API_VERSION
)-turbo
87 CMAKE_OPTIONS.JPEG7
+= -DCMAKE_INSTALL_INCLUDEDIR
=$(USRINCDIR
)/libjpeg
$(JPEG_API_VERSION
)-turbo
89 # Libraries for old libjpeg API versions goes to separate directory
90 CMAKE_OPTIONS.JPEG6
+= -DCMAKE_INSTALL_LIBDIR
=$(USRLIBDIR
)/libjpeg
$(JPEG_API_VERSION
)-turbo
/$(CMAKE_LIBDIR.
$(BITS
))
91 CMAKE_OPTIONS.JPEG7
+= -DCMAKE_INSTALL_LIBDIR
=$(USRLIBDIR
)/libjpeg
$(JPEG_API_VERSION
)-turbo
/$(CMAKE_LIBDIR.
$(BITS
))
94 CMAKE_OPTIONS
+= -DENABLE_STATIC
=FALSE
96 # Allow for build with different API compliance
97 CMAKE_OPTIONS
+= $(CMAKE_OPTIONS.JPEG
$(JPEG_API_VERSION
))
99 # We need to install just a subset of files for various combinations of libjpeg
100 # API version and bitness
101 CMAKE_COMPONENTS.JPEG6
+= lib
102 CMAKE_COMPONENTS.JPEG6.64
+= include
103 CMAKE_COMPONENTS.JPEG7
+= lib
104 CMAKE_COMPONENTS.JPEG7.64
+= include
105 CMAKE_COMPONENTS.JPEG8.32
+= lib
106 CMAKE_COMPONENTS
+= $(CMAKE_COMPONENTS.JPEG
$(JPEG_API_VERSION
))
107 CMAKE_COMPONENTS
+= $(CMAKE_COMPONENTS.JPEG
$(JPEG_API_VERSION
).
$(BITS
))
109 # Create library symlinks at standard locations
110 COMPONENT_POST_INSTALL_ACTION
+= \
111 for f in
$(PROTOUSRLIBDIR
)/libjpeg
$(JPEG_API_VERSION
)-turbo
/$(CMAKE_LIBDIR.
$(BITS
))/*.so.
* ; do \
112 [ -e
"$$f" ] || continue
; \
113 t
=$(PROTOUSRLIBDIR.
$(BITS
)) ; \
115 while
[ "$${f\#/}" != "$$f" ] ; do f
=$${f\
#/} ; done ; \
116 while
[ "$${t\#/}" != "$$t" ] ; do t
=$${t\
#/} ; done ; \
117 [ "$${f%%/*}" == "$${t%%/*}" ] || break
; \
118 f
=$${f\
#$${f%%/*}} ; \
119 t
=$${t\
#$${t%%/*}} ; \
121 [ "$$t" ] && t
=$$t/ ; \
122 f
=$$(echo
$$t |
$(GSED
) -e
's|[^/]\{1,\}|..|g')$$f ; \
123 $(MKDIR
) $(PROTOUSRLIBDIR.
$(BITS
)) ; \
124 $(SYMLINK
) $$f $(PROTOUSRLIBDIR.
$(BITS
))/$$(basename $$f) ; \
127 # Per libjpeg API version test directory
128 COMPONENT_TEST_BUILD_DIR
= $(BUILD_DIR
)/test/$(MACH
$(BITS
))/$(JPEG_API_VERSION
)
129 # Per libjpeg API version master test results file
130 COMPONENT_TEST_MASTER
= $(COMPONENT_TEST_RESULTS_DIR
)/results-
$(BITS
)-$(JPEG_API_VERSION
).master
132 # Normalize test results
133 COMPONENT_TEST_TRANSFORMS
+= "-e 's/ *[0-9]\{1,\}\.[0-9]\{1,\} sec\$$//'" # timing
134 COMPONENT_TEST_TRANSFORMS
+= "-e '/^Total Test time/d'" # timing
135 COMPONENT_TEST_TRANSFORMS
+= "-e '/^ *Start/d'" # drop Start lines
136 COMPONENT_TEST_TRANSFORMS
+= "-e 's/^ *[0-9]\{1,\}\/[0-9]\{1,\} Test *\#[0-9]\{1,\}:/Test/'" # drop test numbers
138 # Auto-generated dependencies
139 REQUIRED_PACKAGES
+= system
/library
140 REQUIRED_PACKAGES
+= system
/library
/math