mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-24 23:47:14 -08:00
media-libs/oidn: add 2.3.1 with improvements
- drop 32bit platforms as upstream does not support them https://github.com/RenderKit/oidn/blob/a21330356508383f54b15efee67dbd0fd00ee87b/README.md?plain=1#L168 - do not fortify source - remove `--force` from rm to disallow silent fail - remove addpredict if USE=cuda - it's currently set via sandbox.d file from nvidia-cuda-toolkit (thanks negril!) Closes: https://bugs.gentoo.org/895018 Closes: https://bugs.gentoo.org/926204 Signed-off-by: Filip Kobierski <fkobi@pm.me> Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com> Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
@@ -3,3 +3,4 @@ DIST oidn-1.4.3.tar.gz 54222682 BLAKE2B f9b585c318258fd78e221a453b64e83965a3e503
|
||||
DIST oidn-2.1.0.tar.gz 48977314 BLAKE2B 0fc32697df7fc6b8b367a78312a5b16ab68a5c88a2d19a8780e9de87c7e7096d7fe43dbd07928f2eba44c62fb4545338fc92f918dd4c33623259d0088a06a854 SHA512 508cb100f1a0a825774c2c01e0fc983e697341745fa0bfa48a99bfa70fc431f66fcdf17c3f170e40baefd7c3796a25d147f49cb17efbf1a1886556367c5c4566
|
||||
DIST oidn-2.2.2.tar.gz 49006605 BLAKE2B e3d32cc2112ded280e642c5d69fb2ef14db59df4f5224bff79e82ede207899c9dbfa43dc663ad9ccc15a6497e363df0b91b43660729962c410b7ec75ac1b3465 SHA512 eca18e9e22a40bc1381e75985e5f5e79f48cc6d168a2a703e54540967646487d347db290459e9a612d8ab4924e8d3c83d84664fd5318cca4f17745da1e47cf50
|
||||
DIST oidn-2.3.0.tar.gz 75300547 BLAKE2B 88a5922b4db63c48ab69047dca8d1077205a6d7a2112971badb0cd35e0b770017f5cdcc95d2ef07016fe2e990e3e5806ac6a0800b67086b958948c542f0dff6f SHA512 4f68ce3b0da37e1861090d60d7cd823046f325c45a8e2c3f4098eb3b4f7ec676d2acbb9c138ff60a9f83188dd0dcbaba42106aad96beafc5e65045c77c00f2f8
|
||||
DIST oidn-2.3.1.tar.gz 75315393 BLAKE2B d031e89924f82514994f61909d949b5dc55585cca6fbe26aba2e587f2afd03a6ae195aa93c0bbe67554224bab97ab552a4f33723786068abb82c1f6dde58e2b4 SHA512 ed3c99ba3d6634d8ca55786e4e62fe78cf6941e80736e6fcdf8e4f7b08aa45d1a546692bc64fedead31598b32b050a7d8a7e2cd1a6f3c55d645eeb175e440042
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
PYTHON_COMPAT=( python3_{10..13} )
|
||||
LLVM_COMPAT=( {15..18} )
|
||||
ROCM_VERSION=5.7
|
||||
|
||||
inherit cmake cuda llvm-r1 python-any-r1 rocm
|
||||
|
||||
DESCRIPTION="Intel® Open Image Denoise library"
|
||||
HOMEPAGE="https://www.openimagedenoise.org https://github.com/RenderKit/oidn"
|
||||
|
||||
if [[ ${PV} = *9999 ]]; then
|
||||
EGIT_REPO_URI="https://github.com/RenderKit/oidn.git"
|
||||
EGIT_BRANCH="master"
|
||||
inherit git-r3
|
||||
else
|
||||
SRC_URI="https://github.com/RenderKit/${PN}/releases/download/v${PV}/${P}.src.tar.gz -> ${P}.tar.gz"
|
||||
KEYWORDS="~amd64 -arm ~arm64 -ppc ~ppc64 -x86" # 64-bit-only
|
||||
fi
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
REQUIRED_USE="
|
||||
test? ( apps )
|
||||
"
|
||||
IUSE="apps cuda hip openimageio test"
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
RDEPEND="
|
||||
dev-cpp/tbb:=
|
||||
dev-lang/ispc
|
||||
cuda? ( dev-util/nvidia-cuda-toolkit )
|
||||
hip? ( dev-util/hip )
|
||||
openimageio? ( media-libs/openimageio:= )
|
||||
"
|
||||
DEPEND="${RDEPEND}
|
||||
$(llvm_gen_dep '
|
||||
llvm-core/clang:${LLVM_SLOT}=
|
||||
llvm-core/llvm:${LLVM_SLOT}=
|
||||
')
|
||||
"
|
||||
BDEPEND="${PYTHON_DEPS}"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-2.2.2-amdgpu-targets.patch"
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
if use cuda; then
|
||||
cuda_src_prepare
|
||||
fi
|
||||
|
||||
if use hip; then
|
||||
# https://bugs.gentoo.org/930391
|
||||
sed "/-Wno-unused-result/s:): --rocm-path=${EPREFIX}/usr/lib):" \
|
||||
-i devices/hip/CMakeLists.txt || die
|
||||
fi
|
||||
|
||||
sed -e "/^install.*llvm_macros.cmake.*cmake/d" -i CMakeLists.txt || die
|
||||
# do not fortify source -- bug 895018
|
||||
sed -e "s/-D_FORTIFY_SOURCE=2//g" -i {cmake/oidn_platform,external/mkl-dnn/cmake/SDL}.cmake || die
|
||||
|
||||
cmake_src_prepare
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DOIDN_APPS="$(usex apps)"
|
||||
|
||||
-DOIDN_DEVICE_CPU="yes"
|
||||
-DOIDN_DEVICE_CUDA="$(usex cuda)"
|
||||
-DOIDN_DEVICE_HIP="$(usex hip)"
|
||||
# -DOIDN_DEVICE_SYCL="$(usex sycl)"
|
||||
)
|
||||
|
||||
if use apps; then
|
||||
mycmakeargs+=( -DOIDN_APPS_OPENIMAGEIO="$(usex openimageio)" )
|
||||
fi
|
||||
|
||||
if use cuda; then
|
||||
export CUDAHOSTCXX="$(cuda_gccdir)"
|
||||
fi
|
||||
|
||||
if use hip; then
|
||||
mycmakeargs+=(
|
||||
-DROCM_PATH="${EPREFIX}/usr"
|
||||
-DOIDN_DEVICE_HIP_COMPILER="$(get_llvm_prefix)/bin/clang++" # use HIPHOSTCOMPILER
|
||||
-DAMDGPU_TARGETS="$(get_amdgpu_flags)"
|
||||
)
|
||||
fi
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_test() {
|
||||
"${BUILD_DIR}"/oidnTest || die "There were test faliures!"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cmake_src_install
|
||||
|
||||
if use hip || use cuda ; then
|
||||
# remove garbage in /var/tmp left by subprojects
|
||||
rm -r "${ED}"/var || die
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user