60 lines
1.5 KiB
Bash
60 lines
1.5 KiB
Bash
# Copyright 1999-2022 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
# Big thank you to whoever made the original waifu2x-ncnn-vulkan ebuild, which I took and modified using the existing AUR PKGBUILD as reference
|
|
# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=realesrgan-ncnn-vulkan
|
|
|
|
EAPI=8
|
|
|
|
inherit cmake
|
|
|
|
DESCRIPTION="NCNN implementation of Real-ESRGAN"
|
|
HOMEPAGE="https://github.com/xinntao/Real-ESRGAN"
|
|
SRC_URI="https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan/archive/refs/tags/v0.2.0.zip https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-ncnn-vulkan-20220424-ubuntu.zip -> ${P}.zip"
|
|
S="${WORKDIR}/Real-ESRGAN-ncnn-vulkan-0.2.0"
|
|
|
|
|
|
LICENSE="MIT"
|
|
SLOT="0"
|
|
KEYWORDS="~amd64 ~x86"
|
|
|
|
BDEPEND="app-arch/unzip"
|
|
|
|
RDEPEND="
|
|
dev-libs/ncnn:=[vulkan]
|
|
media-libs/libwebp:=
|
|
media-libs/vulkan-loader"
|
|
DEPEND="
|
|
${RDEPEND}
|
|
dev-util/glslang
|
|
dev-util/vulkan-headers"
|
|
|
|
src_prepare() {
|
|
CMAKE_USE_DIR=${S}/src
|
|
cmake_src_prepare
|
|
|
|
# Update all paths to match installation for models.
|
|
sed "/PATHSTR\|model path/s|models-|${EPREFIX}/usr/share/${PN}/models-|" \
|
|
-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
|
|
-DCMAKE_INSTALL_PREFIX=/usr
|
|
)
|
|
|
|
cmake_src_configure
|
|
}
|
|
|
|
src_install() {
|
|
dobin "${BUILD_DIR}"/realesrgan-ncnn-vulkan
|
|
|
|
insinto /usr/share/${PN}
|
|
doins -r "${WORKDIR}"/models
|
|
|
|
einstalldocs
|
|
}
|