summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Karbowski <slashbeast@gentoo.org>2022-11-21 21:23:18 +0100
committerPiotr Karbowski <slashbeast@gentoo.org>2022-11-21 21:24:19 +0100
commit12d056ad1cb5c87e1bb0098ebf76feea16caf526 (patch)
treee5ee0cab33dccec981da38d18d50acf662c39db5 /media-gfx
parentdev-python/meson-python: fix tomli dep (diff)
downloadgentoo-12d056ad1cb5c87e1bb0098ebf76feea16caf526.tar.gz
gentoo-12d056ad1cb5c87e1bb0098ebf76feea16caf526.tar.bz2
gentoo-12d056ad1cb5c87e1bb0098ebf76feea16caf526.zip
media-gfx/realesrgan-ncnn-vulkan: new package.
Signed-off-by: Piotr Karbowski <slashbeast@gentoo.org>
Diffstat (limited to 'media-gfx')
-rw-r--r--media-gfx/realesrgan-ncnn-vulkan/Manifest2
-rw-r--r--media-gfx/realesrgan-ncnn-vulkan/metadata.xml11
-rw-r--r--media-gfx/realesrgan-ncnn-vulkan/realesrgan-ncnn-vulkan-0.2.0.ebuild56
3 files changed, 69 insertions, 0 deletions
diff --git a/media-gfx/realesrgan-ncnn-vulkan/Manifest b/media-gfx/realesrgan-ncnn-vulkan/Manifest
new file mode 100644
index 000000000000..82a91a75b8ae
--- /dev/null
+++ b/media-gfx/realesrgan-ncnn-vulkan/Manifest
@@ -0,0 +1,2 @@
+DIST Real-ESRGAN-v0.2.5.0-models.tar.xz 39195532 BLAKE2B 3ff956be8a4a8890cc7b42f9e5f9e12d769f83f918762b75fd3d31e4659b793eca8d107b89fb39b8d601d14775f448ef35de3e9f437d51efb841a910fb56f88b SHA512 f1ede62854d76b6bf2278e074a21893ad4010a8327fb6744bc4af63717a0dfa342f618bfa916886f6e05a31e71feed3c1244395572688d6d531feec08431aace
+DIST realesrgan-ncnn-vulkan-0.2.0.tar.gz 138744 BLAKE2B ec74388e789efbf6ea82a88428ff5745aa65d38b3d490b80858f91e21ff0f50333f791dadf2a626a4bee1ca88c808e41a413afce1f85d5a82aa824ecab673838 SHA512 5c845ad2fbea45eba1899582f3ca69bea679107cc4b3c49a94649b5a954117269a5b7d65ffeb8943531c71fff2ca749c06d0e3e0fd9c155ad3196f48c548d7cd
diff --git a/media-gfx/realesrgan-ncnn-vulkan/metadata.xml b/media-gfx/realesrgan-ncnn-vulkan/metadata.xml
new file mode 100644
index 000000000000..c611331d3419
--- /dev/null
+++ b/media-gfx/realesrgan-ncnn-vulkan/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>slashbeast@gentoo.org</email>
+ <name>Piotr Karbowski</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">xinntao/Real-ESRGAN-ncnn-vulkan</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/media-gfx/realesrgan-ncnn-vulkan/realesrgan-ncnn-vulkan-0.2.0.ebuild b/media-gfx/realesrgan-ncnn-vulkan/realesrgan-ncnn-vulkan-0.2.0.ebuild
new file mode 100644
index 000000000000..71a046f87d9e
--- /dev/null
+++ b/media-gfx/realesrgan-ncnn-vulkan/realesrgan-ncnn-vulkan-0.2.0.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="NCNN implementation of Real-ESRGAN"
+HOMEPAGE="https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan"
+SRC_URI="
+ https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+ https://dev.gentoo.org/~slashbeast/distfiles/${PN}/Real-ESRGAN-v0.2.5.0-models.tar.xz
+"
+
+LICENSE="MIT BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+ dev-libs/ncnn:=[vulkan]
+ media-libs/libwebp:=
+ media-libs/vulkan-loader"
+DEPEND="
+ ${RDEPEND}
+ dev-util/glslang
+ dev-util/vulkan-headers"
+
+S="${WORKDIR}/Real-ESRGAN-ncnn-vulkan-${PV}"
+
+src_prepare() {
+ rm -rf "src/libwebp" "src/ncnn"
+
+ CMAKE_USE_DIR=${S}/src
+ cmake_src_prepare
+
+ # Update all paths to match installation for models.
+ sed "s%PATHSTR(\"models\")%PATHSTR(\"${EPREFIX}/usr/share/${PN}/models\")%g" \
+ -i src/main.cpp || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DGLSLANG_TARGET_DIR="${ESYSROOT}"/usr/$(get_libdir)/cmake
+ -DUSE_SYSTEM_NCNN=ON
+ -DUSE_SYSTEM_WEBP=ON
+ )
+
+ cmake_src_configure
+}
+
+src_install() {
+ dobin "${BUILD_DIR}"/realesrgan-ncnn-vulkan
+
+ insinto /usr/share/${PN}/models
+ doins -r ../models/.
+}