diff options
Diffstat (limited to 'media-libs/libjxl')
-rw-r--r-- | media-libs/libjxl/Manifest | 7 | ||||
-rw-r--r-- | media-libs/libjxl/files/libjxl-0.7.0-atomic.patch | 136 | ||||
-rw-r--r-- | media-libs/libjxl/libjxl-0.7.0_pre20220311.ebuild | 4 | ||||
-rw-r--r-- | media-libs/libjxl/libjxl-0.7.0_pre20220329.ebuild | 80 | ||||
-rw-r--r-- | media-libs/libjxl/libjxl-9999.ebuild | 7 |
5 files changed, 227 insertions, 7 deletions
diff --git a/media-libs/libjxl/Manifest b/media-libs/libjxl/Manifest index 11db8a9376a7..73942bfa3965 100644 --- a/media-libs/libjxl/Manifest +++ b/media-libs/libjxl/Manifest @@ -1,4 +1,7 @@ +AUX libjxl-0.7.0-atomic.patch 4461 BLAKE2B e2c1edf952ba13d2ffb55c1e1122a4ed8ae692155e770e3a64b9ccfe7100395f44f2d0a84bac99a73c99630a8f9891906bdff54514f386f92b6ab2bf6cdb367a SHA512 68d70ed26eec2038c287fc1e0124f7e3ef62277aa7621706aab390616f4a1f5fe23a2675ed996c6c73d117e41e81c4c556efd30887ecbfeada7fd1e4ed7914b6 DIST libjxl-0.7.0_pre20220311.tar.gz 17322724 BLAKE2B a3cf970ea3db67e0890e94a5c74ea66610d4fed608fa3d079e6934a1d5f2bdc3ef4264c1df85e4b4efcd22c060087c712009f6c4a6b69a41f6e96ff3674c6de5 SHA512 f3e46ddea462b31de6df3c615c3cd628adc58c7ff41588e2ec4cc8929590c9272603a66ed4620b9ba550d85b3d1a6da3f51b1c4f8650ef8901347fea8af5d474 -EBUILD libjxl-0.7.0_pre20220311.ebuild 2041 BLAKE2B df2cf000bbea7746788b04b88c2826dd10d1be2998f856746a15dc0af44e7436f506be0fc8f5254e52df79e3e5e578cefc1c6837bbc59f5f7f7847c4b36607a2 SHA512 7f65d81181a3c4472c8f9686ba504ffa524f1ee331b6999e5ac2c1f3ed9be33a9e70b9e295bf4496cfff9f8557991cf962829aae25b20e3d479019f7fc314bfc -EBUILD libjxl-9999.ebuild 2007 BLAKE2B 48c2a0965cc8db89d318f616fc93128e9e998f5535a74dcf3235a423adc04408972edee79a046b868958d39e83a2c2508e345d5af544cd709994058810546496 SHA512 5ab1f5b1dd76cef89ba945e5c3ed6b8837c87f137fedb60be68591dfe904b1cadeae27806dfd409151d698146ae52a0014b676ccc9489c8e281fa18de308025c +DIST libjxl-0.7.0_pre20220329.tar.gz 21282311 BLAKE2B 8ced9811adba47e5ccac4d55cb7133a863bedceebeb51e649fa79ecb17b785e747532f1f36fd39e3627d0a29406f5f403dee8fa42a9958c713c1296c2f83260a SHA512 deb17dd2eb3e2c39d624d97c6959940aee5beafcb009f6cb2ac14dd83c73d2601df8c81f6cec5d8032d9e66d1fdabfe620dcbf9bfa5e90eb9978265896816242 +EBUILD libjxl-0.7.0_pre20220311.ebuild 2131 BLAKE2B 9292dbc20406ba9544c66d5658b1d782d7b601b29f87b585426adc400fd1dad883003ce730f7db96b75fe8715c48ca7160492155e7088929b050c58367c97b63 SHA512 c625e4a3151f68986c3632b27f2c730084756b293e6a4d50c17d192c445ce925a37ad88da18dbcca4c684f53e504880768ee3def4cceca14dbf870f0aa1f9e7c +EBUILD libjxl-0.7.0_pre20220329.ebuild 1973 BLAKE2B 0bd9bdf88b23e9e511f1e9cfb1608b160e1c441806cbdedcf2809eb65aa7e3578172986b6bffa5397d32baa8a53f57e22677beacc3f64f097a8ec68606d63a15 SHA512 581844e5aeee26cdd1a670c45a1f3fcc4416428382577458f7f72afae24149184fa51ac3369c83e33933d4c9c7887bedb58f2f1b05d13822b5b04167ed07eacb +EBUILD libjxl-9999.ebuild 2024 BLAKE2B 73aabbd86aa96d03d516a3699f069d9d3a625d84aae2e76683230b6a4dce99f3e68ec4661e3ed74c9b466001289a0ba789527c926c08feb8a1704412b73ed761 SHA512 7fa2de19a8876d6f567f8e1c12411a7b9349cd7938fe200f9eeb966bd3f8f76c7fddc70dde65d2279e72306a584f12f12eede1a45cfa3e92fbfb84978b1dde7b MISC metadata.xml 736 BLAKE2B b4c49d06f4888fe4714add21be0d8c8b0e5961a03307165384692a07dda463cc0438dfe5a99a878555e5d15f0ad56fe4c66c4dd39c90603147150b4d9d3e088b SHA512 feb1910542331c2c3e8769e172081d59c20bfa082cb353787cb718dbd562114210e5da38c5dd87bba9f11ee5756f426c71b835cd178c5d2bd7bfd661cbeb10ce diff --git a/media-libs/libjxl/files/libjxl-0.7.0-atomic.patch b/media-libs/libjxl/files/libjxl-0.7.0-atomic.patch new file mode 100644 index 000000000000..44d76fcfb10f --- /dev/null +++ b/media-libs/libjxl/files/libjxl-0.7.0-atomic.patch @@ -0,0 +1,136 @@ +include following patches : + +fde214c5f4dc5ffd0360401a68df33182edf9226 Refactor c11/atomic patch for riscv64 +326711f86719e6ce7b0422a7970ce8f8b1598f25 Make sure to list Threads::Threads in JPEGXL_DEC_INTERNAL_LIBS +b12bb7a5f37d6bcaf134cfab7828ae08c4a0e60d Remove duplicate reference to hwy library +87fe7c16e1fb2e21b6a1dca26782950ae1559d99 libjxl implementation rely on c11 atomics + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fc1bbac..cce9748 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -191,6 +191,15 @@ endif() # JPEGXL_STATIC + set(THREADS_PREFER_PTHREAD_FLAG YES) + find_package(Threads REQUIRED) + ++# These settings are important to drive check_cxx_source_compiles ++# See CMP0067 (min cmake version is 3.10 anyway) ++set(CMAKE_CXX_STANDARD 11) ++set(CMAKE_CXX_EXTENSIONS OFF) ++set(CMAKE_CXX_STANDARD_REQUIRED YES) ++ ++# Atomics ++find_package(Atomics REQUIRED) ++ + if(JPEGXL_STATIC) + if (MINGW) + # In MINGW libstdc++ uses pthreads directly. When building statically a +@@ -298,10 +307,6 @@ endif () # !MSVC + + include(GNUInstallDirs) + +-set(CMAKE_CXX_STANDARD 11) +-set(CMAKE_CXX_EXTENSIONS OFF) +-set(CMAKE_CXX_STANDARD_REQUIRED YES) +- + add_subdirectory(third_party) + + # Copy the JXL license file to the output build directory. +diff --git a/cmake/FindAtomics.cmake b/cmake/FindAtomics.cmake +new file mode 100644 +index 0000000..9a6cdc3 +--- /dev/null ++++ b/cmake/FindAtomics.cmake +@@ -0,0 +1,53 @@ ++# Original issue: ++# * https://gitlab.kitware.com/cmake/cmake/-/issues/23021#note_1098733 ++# ++# For reference: ++# * https://gcc.gnu.org/wiki/Atomic/GCCMM ++# ++# riscv64 specific: ++# * https://lists.debian.org/debian-riscv/2022/01/msg00009.html ++# ++# ATOMICS_FOUND - system has c++ atomics ++# ATOMICS_LIBRARIES - libraries needed to use c++ atomics ++ ++include(CheckCXXSourceCompiles) ++ ++# RISC-V only has 32-bit and 64-bit atomic instructions. GCC is supposed ++# to convert smaller atomics to those larger ones via masking and ++# shifting like LLVM, but it’s a known bug that it does not. This means ++# anything that wants to use atomics on 1-byte or 2-byte types needs ++# -latomic, but not 4-byte or 8-byte (though it does no harm). ++set(atomic_code ++ " ++ #include <atomic> ++ #include <cstdint> ++ std::atomic<uint8_t> n8 (0); // riscv64 ++ std::atomic<uint64_t> n64 (0); // armel, mipsel, powerpc ++ int main() { ++ ++n8; ++ ++n64; ++ return 0; ++ }") ++ ++check_cxx_source_compiles("${atomic_code}" ATOMICS_LOCK_FREE_INSTRUCTIONS) ++ ++if(ATOMICS_LOCK_FREE_INSTRUCTIONS) ++ set(ATOMICS_FOUND TRUE) ++ set(ATOMICS_LIBRARIES) ++else() ++ set(CMAKE_REQUIRED_LIBRARIES "-latomic") ++ check_cxx_source_compiles("${atomic_code}" ATOMICS_IN_LIBRARY) ++ set(CMAKE_REQUIRED_LIBRARIES) ++ if(ATOMICS_IN_LIBRARY) ++ set(ATOMICS_LIBRARY atomic) ++ include(FindPackageHandleStandardArgs) ++ find_package_handle_standard_args(Atomics DEFAULT_MSG ATOMICS_LIBRARY) ++ set(ATOMICS_LIBRARIES ${ATOMICS_LIBRARY}) ++ unset(ATOMICS_LIBRARY) ++ else() ++ if(Atomics_FIND_REQUIRED) ++ message(FATAL_ERROR "Neither lock free instructions nor -latomic found.") ++ endif() ++ endif() ++endif() ++unset(atomic_code) +diff --git a/lib/jxl.cmake b/lib/jxl.cmake +index 97dfd73..8f69894 100644 +--- a/lib/jxl.cmake ++++ b/lib/jxl.cmake +@@ -346,6 +346,8 @@ set(JPEGXL_DEC_INTERNAL_LIBS + brotlidec-static + brotlicommon-static + hwy ++ Threads::Threads ++ ${ATOMICS_LIBRARIES} + ) + + if(JPEGXL_ENABLE_PROFILER) +@@ -355,7 +357,6 @@ endif() + set(JPEGXL_INTERNAL_LIBS + ${JPEGXL_DEC_INTERNAL_LIBS} + brotlienc-static +- Threads::Threads + ) + + # strips the -static suffix from all the elements in LIST +@@ -467,7 +468,7 @@ add_library(jxl_dec-static STATIC + $<TARGET_OBJECTS:jxl_dec-obj> + ) + target_link_libraries(jxl_dec-static +- PUBLIC ${JPEGXL_COVERAGE_FLAGS} ${JPEGXL_DEC_INTERNAL_LIBS} hwy) ++ PUBLIC ${JPEGXL_COVERAGE_FLAGS} ${JPEGXL_DEC_INTERNAL_LIBS}) + target_include_directories(jxl_dec-static PUBLIC + "${PROJECT_SOURCE_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}/include" +@@ -488,7 +489,7 @@ endif() + # to do, remove $<TARGET_OBJECTS:jxl_dec-obj> here and depend on jxl_dec-static + add_library(jxl-static STATIC ${JPEGXL_INTERNAL_OBJECTS}) + target_link_libraries(jxl-static +- PUBLIC ${JPEGXL_COVERAGE_FLAGS} ${JPEGXL_INTERNAL_LIBS} hwy) ++ PUBLIC ${JPEGXL_COVERAGE_FLAGS} ${JPEGXL_INTERNAL_LIBS}) + target_include_directories(jxl-static PUBLIC + "${PROJECT_SOURCE_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}/include" diff --git a/media-libs/libjxl/libjxl-0.7.0_pre20220311.ebuild b/media-libs/libjxl/libjxl-0.7.0_pre20220311.ebuild index 1afe0678670a..9c909deddbe6 100644 --- a/media-libs/libjxl/libjxl-0.7.0_pre20220311.ebuild +++ b/media-libs/libjxl/libjxl-0.7.0_pre20220311.ebuild @@ -10,7 +10,7 @@ DESCRIPTION="JPEG XL image format reference implementation" HOMEPAGE="https://github.com/libjxl/libjxl" SRC_URI="https://api.github.com/repos/libjxl/libjxl/tarball/3f8e77fcfabe8ca8ddee6be4e662de525667c570 -> ${P}.tar.gz" -KEYWORDS="~amd64 ~x86" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86" LICENSE="BSD" SLOT="0" @@ -30,6 +30,8 @@ DEPEND="app-arch/brotli:=[${MULTILIB_USEDEP}] RDEPEND="${DEPEND}" +PATCHES=( "${FILESDIR}/${PN}-0.7.0-atomic.patch" ) + S="${WORKDIR}/libjxl-libjxl-3f8e77f" multilib_src_configure() { diff --git a/media-libs/libjxl/libjxl-0.7.0_pre20220329.ebuild b/media-libs/libjxl/libjxl-0.7.0_pre20220329.ebuild new file mode 100644 index 000000000000..5407dd894d8b --- /dev/null +++ b/media-libs/libjxl/libjxl-0.7.0_pre20220329.ebuild @@ -0,0 +1,80 @@ +# Copyright 2021-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake-multilib + +DESCRIPTION="JPEG XL image format reference implementation" +HOMEPAGE="https://github.com/libjxl/libjxl" + +SRC_URI="https://api.github.com/repos/libjxl/libjxl/tarball/fde214c5f4dc5ffd0360401a68df33182edf9226 -> ${P}.tar.gz" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86" + +LICENSE="BSD" +SLOT="0" +IUSE="examples openexr" + +DEPEND="app-arch/brotli:=[${MULTILIB_USEDEP}] + dev-cpp/gflags:=[${MULTILIB_USEDEP}] + >=dev-cpp/highway-0.16.0[${MULTILIB_USEDEP}] + media-libs/giflib:=[${MULTILIB_USEDEP}] + >=media-libs/lcms-2.13:=[${MULTILIB_USEDEP}] + media-libs/libpng:=[${MULTILIB_USEDEP}] + sys-libs/zlib[${MULTILIB_USEDEP}] + virtual/jpeg[${MULTILIB_USEDEP}] + >=x11-misc/shared-mime-info-2.2 + openexr? ( media-libs/openexr:= ) +" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/libjxl-libjxl-fde214c" + +multilib_src_configure() { + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=ON + -DBUILD_TESTING=OFF + -DJPEGXL_ENABLE_BENCHMARK=OFF + -DJPEGXL_ENABLE_COVERAGE=OFF + -DJPEGXL_ENABLE_FUZZERS=OFF + -DJPEGXL_ENABLE_SJPEG=OFF + -DJPEGXL_WARNINGS_AS_ERRORS=OFF + + -DJPEGXL_ENABLE_SKCMS=OFF + -DJPEGXL_ENABLE_VIEWERS=OFF + -DJPEGXL_ENABLE_PLUGINS=OFF + -DJPEGXL_FORCE_SYSTEM_BROTLI=ON + -DJPEGXL_FORCE_SYSTEM_HWY=ON + -DJPEGXL_FORCE_SYSTEM_LCMS2=ON + -DJPEGXL_ENABLE_DOXYGEN=OFF + -DJPEGXL_ENABLE_MANPAGES=OFF + -DJPEGXL_ENABLE_JNI=OFF + -DJPEGXL_ENABLE_TCMALLOC=OFF + ) + + if multilib_is_native_abi; then + mycmakeargs+=( + -DJPEGXL_ENABLE_TOOLS=ON + -DJPEGXL_ENABLE_EXAMPLES=$(usex examples) + -DJPEGXL_ENABLE_OPENEXR=$(usex openexr) + ) + else + mycmakeargs+=( + -DJPEGXL_ENABLE_TOOLS=OFF + -DJPEGXL_ENABLE_EXAMPLES=OFF + -DJPEGXL_ENABLE_OPENEXR=OFF + ) + fi + + cmake_src_configure +} + +multilib_src_install() { + cmake_src_install + + if use examples && multilib_is_native_abi; then + dobin "${BUILD_DIR}/jxlinfo" + fi + + find "${D}" -name '*.a' -delete || die +} diff --git a/media-libs/libjxl/libjxl-9999.ebuild b/media-libs/libjxl/libjxl-9999.ebuild index 1a2abbce5e64..0dcf64fe11d8 100644 --- a/media-libs/libjxl/libjxl-9999.ebuild +++ b/media-libs/libjxl/libjxl-9999.ebuild @@ -3,8 +3,7 @@ EAPI=8 -CMAKE_ECLASS=cmake -inherit cmake-multilib git-r3 xdg +inherit cmake-multilib git-r3 DESCRIPTION="JPEG XL image format reference implementation" HOMEPAGE="https://github.com/libjxl/libjxl" @@ -23,7 +22,7 @@ DEPEND="app-arch/brotli:=[${MULTILIB_USEDEP}] media-libs/libpng:=[${MULTILIB_USEDEP}] sys-libs/zlib[${MULTILIB_USEDEP}] virtual/jpeg[${MULTILIB_USEDEP}] - x11-misc/shared-mime-info + >=x11-misc/shared-mime-info-2.2 gdk-pixbuf? ( dev-libs/glib:2 x11-libs/gdk-pixbuf:2 @@ -31,7 +30,6 @@ DEPEND="app-arch/brotli:=[${MULTILIB_USEDEP}] gimp210? ( >=media-gfx/gimp-2.10.28:0/2 ) openexr? ( media-libs/openexr:= ) " - RDEPEND="${DEPEND}" multilib_src_configure() { @@ -62,6 +60,7 @@ multilib_src_configure() { -DJPEGXL_ENABLE_PLUGINS=ON -DJPEGXL_ENABLE_PLUGIN_GDKPIXBUF=$(usex gdk-pixbuf) -DJPEGXL_ENABLE_PLUGIN_GIMP210=$(usex gimp210) + -DJPEGXL_ENABLE_PLUGIN_MIME=OFF ) else mycmakeargs+=( |