# Maintainer: Daniel Bermond pkgname=astc-encoder pkgver=4.7.0 pkgrel=1 pkgdesc='A tool for compressing and decompressing images using the ASTC texture compression standard' arch=('x86_64') url='https://github.com/ARM-software/astc-encoder/' license=('Apache') depends=('gcc-libs') makedepends=('git' 'cmake' 'python') source=("git+https://github.com/ARM-software/astc-encoder.git#tag=${pkgver}" 'git+https://github.com/google/googletest.git') sha256sums=('SKIP' 'SKIP') prepare() { git -C astc-encoder submodule init git -C astc-encoder config --local submodule.Source/GoogleTest.url "${srcdir}/googletest" git -C astc-encoder -c protocol.file.allow='always' submodule update } build() { cmake -B build -S astc-encoder \ -G 'Unix Makefiles' \ -DCMAKE_BUILD_TYPE:STRING='None' \ -DCMAKE_INSTALL_PREFIX:PATH='/usr' \ -DASTCENC_SHAREDLIB:BOOL='ON' \ -DASTCENC_ISA_AVX2:BOOL='ON' \ -DASTCENC_ISA_SSE41:BOOL='ON' \ -DASTCENC_ISA_SSE2:BOOL='ON' \ -Wno-dev cmake --build build } check() { ctest --test-dir build --output-on-failure } package() { DESTDIR="$pkgdir" cmake --install build install -D -m644 astc-encoder/Source/astcenc.h -t "${pkgdir}/usr/include" ln -s astcenc-sse2 "${pkgdir}/usr/bin/astcenc" ln -s libastcenc-sse2-shared.so "${pkgdir}/usr/lib/libastcenc.so" }