summaryrefslogtreecommitdiff
path: root/games-util/basis_universal/basis_universal-1.16.3-r1.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'games-util/basis_universal/basis_universal-1.16.3-r1.ebuild')
-rw-r--r--games-util/basis_universal/basis_universal-1.16.3-r1.ebuild44
1 files changed, 44 insertions, 0 deletions
diff --git a/games-util/basis_universal/basis_universal-1.16.3-r1.ebuild b/games-util/basis_universal/basis_universal-1.16.3-r1.ebuild
new file mode 100644
index 000000000000..d5ffebc5b256
--- /dev/null
+++ b/games-util/basis_universal/basis_universal-1.16.3-r1.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake toolchain-funcs
+
+DESCRIPTION="Basis Universal GPU Texture Codec"
+HOMEPAGE="https://github.com/BinomialLLC/basis_universal"
+# dist .zip is just a exe for windows
+SRC_URI="https://github.com/BinomialLLC/basis_universal/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0 zstd? ( BSD )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="cpu_flags_x86_sse4_1 opencl zstd"
+
+# zstd is bundled, see https://github.com/BinomialLLC/basis_universal/pull/228
+DEPEND="
+ opencl? ( virtual/opencl )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.16.3-respect-CFLAGS.patch
+ "${FILESDIR}"/${PN}-1.16.3-fix-RPATH.patch
+ "${FILESDIR}"/${PN}-1.16.3-SSE4.1-AVX-checks.patch
+)
+
+src_configure() {
+ local x64=ON
+ if $(tc-getCC) -dM -E -x c - < <(echo 'int main() { }') | grep -qi "#define __PTRDIFF_WIDTH__ 32" ; then
+ x64=OFF
+ fi
+
+ local mycmakeargs=(
+ -DBUILD_X64=${x64}
+ -DOPENCL=$(usex opencl)
+ -DSSE=$(usex cpu_flags_x86_sse4_1)
+ -DZSTD=$(usex zstd)
+ )
+
+ cmake_src_configure
+}