summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--media-libs/libjxl/Manifest2
-rw-r--r--media-libs/libjxl/files/system-lcms.patch47
-rw-r--r--media-libs/libjxl/libjxl-0.6.ebuild97
-rw-r--r--media-libs/libjxl/libjxl-9999.ebuild38
4 files changed, 178 insertions, 6 deletions
diff --git a/media-libs/libjxl/Manifest b/media-libs/libjxl/Manifest
new file mode 100644
index 0000000..05256c8
--- /dev/null
+++ b/media-libs/libjxl/Manifest
@@ -0,0 +1,2 @@
+DIST libjxl-0.6.tar.gz 16953410 BLAKE2B 8941987f6d31096a7286f9d98cdcc16e5fe338e6b3d966343f97fc5b5b932ec92c994fab5781448aa7d96324e5c9ce5c83754b01cf6e752d0702ce9fc0a2087f SHA512 934c86d079c7a1f5382fad158efac225b9d1b27e551ea85ea7ec43e7ffd5cba85ddbfa35658b242a9f9c9589decf245568349abfa8a4fe12898af78d51608852
+DIST lodepng-48e5364ef48ec2408f44c727657ac1b6703185f8.tar.gz 240079 BLAKE2B 08240bd72d22f789bc0e06ed1d641fbca21ca674697880d4f004e4e76bb1b6cf595e931d2447544d896c79576e942db3cbdcca91d717f4ad8ddcfbd6c5bdc97e SHA512 50a515f1f15122fa017637be30df0db05980d07f8891f16b0b68697ef0df797176bbe005df623e9f2dbb68b750b0a87e69c3cef215c7bf15187d00491c4023c7
diff --git a/media-libs/libjxl/files/system-lcms.patch b/media-libs/libjxl/files/system-lcms.patch
new file mode 100644
index 0000000..537e02c
--- /dev/null
+++ b/media-libs/libjxl/files/system-lcms.patch
@@ -0,0 +1,47 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 280d4af..c9186df 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -127,6 +127,8 @@ set(JPEGXL_FORCE_SYSTEM_BROTLI false CACHE BOOL
+ "Force using system installed brotli instead of third_party/brotli source.")
+ set(JPEGXL_FORCE_SYSTEM_HWY false CACHE BOOL
+ "Force using system installed highway (libhwy-dev) instead of third_party/highway source.")
++set(JPEGXL_FORCE_SYSTEM_LCMS false CACHE BOOL
++ "Force using system installed lcms instead of third_party/lcms source.")
+
+ # Check minimum compiler versions. Older compilers are not supported and fail
+ # with hard to understand errors.
+diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
+index b5e1899..887d31d 100644
+--- a/third_party/CMakeLists.txt
++++ b/third_party/CMakeLists.txt
+@@ -201,13 +201,23 @@ if (JPEGXL_ENABLE_SKCMS OR JPEGXL_ENABLE_PLUGINS)
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/skcms/LICENSE"
+ ${PROJECT_BINARY_DIR}/LICENSE.skcms COPYONLY)
+ endif ()
+-if (JPEGXL_ENABLE_VIEWERS OR NOT JPEGXL_ENABLE_SKCMS)
+- if( NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lcms/.git" )
+- message(SEND_ERROR "Please run git submodule update --init")
++if ((JPEGXL_ENABLE_VIEWERS OR NOT JPEGXL_ENABLE_SKCMS))
++ if(JPEGXL_FORCE_SYSTEM_LCMS)
++ pkg_check_modules(LCMS REQUIRED IMPORTED_TARGET lcms2)
++ add_library(lcms2 INTERFACE IMPORTED GLOBAL)
++ target_link_libraries(lcms2 INTERFACE PkgConfig::LCMS)
++ else()
++ if(JPEGXL_DEP_LICENSE_DIR)
++ configure_file("${JPEGXL_DEP_LICENSE_DIR}/libhwy-dev/copyright"
++ ${PROJECT_BINARY_DIR}/LICENSE.highway COPYONLY)
++ endif() # JPEGXL_DEP_LICENSE_DIR
++ if( NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lcms/.git" )
++ message(SEND_ERROR "Please run git submodule update --init")
++ endif()
++ include(lcms2.cmake)
++ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/lcms/COPYING"
++ ${PROJECT_BINARY_DIR}/LICENSE.lcms COPYONLY)
+ endif()
+- include(lcms2.cmake)
+- configure_file("${CMAKE_CURRENT_SOURCE_DIR}/lcms/COPYING"
+- ${PROJECT_BINARY_DIR}/LICENSE.lcms COPYONLY)
+ endif()
+
+ # sjpeg
diff --git a/media-libs/libjxl/libjxl-0.6.ebuild b/media-libs/libjxl/libjxl-0.6.ebuild
new file mode 100644
index 0000000..60b401d
--- /dev/null
+++ b/media-libs/libjxl/libjxl-0.6.ebuild
@@ -0,0 +1,97 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+inherit xdg cmake
+
+DESCRIPTION="JPEG XL image format reference implementation"
+HOMEPAGE="https://github.com/libjxl/libjxl"
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/libjxl/libjxl.git"
+ EGIT_SUBMODULES=(third_party/lodepng)
+else
+ LODEPNG_COMMIT="48e5364ef48ec2408f44c727657ac1b6703185f8"
+ SRC_URI="
+ https://github.com/libjxl/libjxl/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+ https://github.com/lvandeve/lodepng/archive/${LODEPNG_COMMIT}.tar.gz -> lodepng-${LODEPNG_COMMIT}.tar.gz
+ "
+fi
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="apng doc gif java jpeg +man openexr static-libs test viewers"
+
+RDEPEND="app-arch/brotli
+ dev-libs/highway
+ media-libs/lcms
+ apng? (
+ media-libs/libpng
+ sys-libs/zlib
+ )
+ gif? ( media-libs/giflib )
+ java? ( virtual/jdk )
+ jpeg? ( virtual/jpeg )
+ man? ( app-text/asciidoc )
+ openexr? ( media-libs/openexr:= )
+ viewers? (
+ dev-qt/qtwidgets
+ dev-qt/qtx11extras
+ )
+"
+BDEPEND="
+ doc? ( app-doc/doxygen )
+"
+DEPEND="${RDEPEND}
+ test? ( dev-cpp/gtest )
+"
+
+PATCHES=("${FILESDIR}/system-lcms.patch")
+
+src_prepare() {
+ if [[ ${PV} != 9999 ]]; then
+ rmdir third_party/lodepng
+ ln -sv ../../lodepng-${LODEPNG_COMMIT} third_party/lodepng || die
+ fi
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_TESTING=$(usex test ON OFF)
+ -DJPEGXL_ENABLE_BENCHMARK=OFF
+ -DJPEGXL_ENABLE_COVERAGE=OFF
+ -DJPEGXL_ENABLE_EXAMPLES=OFF
+ -DJPEGXL_ENABLE_FUZZERS=OFF
+ -DJPEGXL_ENABLE_JNI=$(usex java ON OFF)
+ -DJPEGXL_ENABLE_MANPAGES=$(usex man ON OFF)
+ -DJPEGXL_ENABLE_OPENEXR=$(usex openexr ON OFF)
+ -DJPEGXL_ENABLE_PLUGINS=OFF
+ -DJPEGXL_ENABLE_SJPEG=OFF
+ -DJPEGXL_ENABLE_SKCMS=OFF
+ -DJPEGXL_ENABLE_VIEWERS=$(usex viewers ON OFF)
+ -DJPEGXL_FORCE_SYSTEM_GTEST=ON
+ -DJPEGXL_FORCE_SYSTEM_BROTLI=ON
+ -DJPEGXL_FORCE_SYSTEM_HWY=ON
+ -DJPEGXL_FORCE_SYSTEM_LCMS=ON
+ -DJPEGXL_WARNINGS_AS_ERRORS=OFF
+
+ $(cmake_use_find_package apng PNG)
+ $(cmake_use_find_package apng ZLIB)
+ $(cmake_use_find_package doc Doxygen)
+ $(cmake_use_find_package gif GIF)
+ $(cmake_use_find_package jpeg JPEG)
+ )
+
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+ if ! use static-libs; then
+ rm "${ED}"/usr/$(get_libdir)/libjxl{,_dec}.a || die
+ fi
+}
diff --git a/media-libs/libjxl/libjxl-9999.ebuild b/media-libs/libjxl/libjxl-9999.ebuild
index a2b5eaf..60b401d 100644
--- a/media-libs/libjxl/libjxl-9999.ebuild
+++ b/media-libs/libjxl/libjxl-9999.ebuild
@@ -3,25 +3,37 @@
EAPI="7"
-inherit xdg cmake git-r3
+inherit xdg cmake
DESCRIPTION="JPEG XL image format reference implementation"
HOMEPAGE="https://github.com/libjxl/libjxl"
-EGIT_REPO_URI="https://github.com/libjxl/libjxl.git"
-EGIT_SUBMODULES=(third_party/lodepng third_party/skcms)
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/libjxl/libjxl.git"
+ EGIT_SUBMODULES=(third_party/lodepng)
+else
+ LODEPNG_COMMIT="48e5364ef48ec2408f44c727657ac1b6703185f8"
+ SRC_URI="
+ https://github.com/libjxl/libjxl/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+ https://github.com/lvandeve/lodepng/archive/${LODEPNG_COMMIT}.tar.gz -> lodepng-${LODEPNG_COMMIT}.tar.gz
+ "
+fi
LICENSE="Apache-2.0"
SLOT="0"
-IUSE="apng doc gif jpeg +man openexr static-libs test viewers"
+KEYWORDS="~amd64 ~x86"
+IUSE="apng doc gif java jpeg +man openexr static-libs test viewers"
RDEPEND="app-arch/brotli
dev-libs/highway
+ media-libs/lcms
apng? (
media-libs/libpng
sys-libs/zlib
)
gif? ( media-libs/giflib )
+ java? ( virtual/jdk )
jpeg? ( virtual/jpeg )
man? ( app-text/asciidoc )
openexr? ( media-libs/openexr:= )
@@ -37,19 +49,34 @@ DEPEND="${RDEPEND}
test? ( dev-cpp/gtest )
"
+PATCHES=("${FILESDIR}/system-lcms.patch")
+
+src_prepare() {
+ if [[ ${PV} != 9999 ]]; then
+ rmdir third_party/lodepng
+ ln -sv ../../lodepng-${LODEPNG_COMMIT} third_party/lodepng || die
+ fi
+ cmake_src_prepare
+}
+
src_configure() {
local mycmakeargs=(
-DBUILD_TESTING=$(usex test ON OFF)
-DJPEGXL_ENABLE_BENCHMARK=OFF
-DJPEGXL_ENABLE_COVERAGE=OFF
- -DJPEGXL_ENABLE_EXAMPLES=ON
+ -DJPEGXL_ENABLE_EXAMPLES=OFF
-DJPEGXL_ENABLE_FUZZERS=OFF
+ -DJPEGXL_ENABLE_JNI=$(usex java ON OFF)
-DJPEGXL_ENABLE_MANPAGES=$(usex man ON OFF)
-DJPEGXL_ENABLE_OPENEXR=$(usex openexr ON OFF)
-DJPEGXL_ENABLE_PLUGINS=OFF
-DJPEGXL_ENABLE_SJPEG=OFF
+ -DJPEGXL_ENABLE_SKCMS=OFF
-DJPEGXL_ENABLE_VIEWERS=$(usex viewers ON OFF)
+ -DJPEGXL_FORCE_SYSTEM_GTEST=ON
-DJPEGXL_FORCE_SYSTEM_BROTLI=ON
+ -DJPEGXL_FORCE_SYSTEM_HWY=ON
+ -DJPEGXL_FORCE_SYSTEM_LCMS=ON
-DJPEGXL_WARNINGS_AS_ERRORS=OFF
$(cmake_use_find_package apng PNG)
@@ -64,7 +91,6 @@ src_configure() {
src_install() {
cmake_src_install
- dobin "${BUILD_DIR}/examples/jxlinfo"
if ! use static-libs; then
rm "${ED}"/usr/$(get_libdir)/libjxl{,_dec}.a || die
fi