diff options
author | Daniel Bermond | 2020-12-18 06:53:40 +0000 |
---|---|---|
committer | Daniel Bermond | 2020-12-18 06:53:40 +0000 |
commit | 410bde6486f13177a9b08ae6cf4ef12763181ff5 (patch) | |
tree | 90c91a33f580e10c9fca63dc72a31fbd1f59e836 | |
download | aur-410bde6486f13177a9b08ae6cf4ef12763181ff5.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 15 | ||||
-rw-r--r-- | 010-astc-encoder-use-arch-flags.patch | 36 | ||||
-rw-r--r-- | PKGBUILD | 29 |
3 files changed, 80 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..231b6613d00c --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,15 @@ +pkgbase = astc-encoder + pkgdesc = A tool for compressing and decompressing images using the ASTC texture compression standard + pkgver = 2.1 + pkgrel = 1 + url = https://github.com/ARM-software/astc-encoder/ + arch = x86_64 + license = Apache + depends = gcc-libs + source = https://github.com/ARM-software/astc-encoder/archive/2.1/astc-encoder-2.1.tar.gz + source = 010-astc-encoder-use-arch-flags.patch + sha256sums = 655bf72ff09d6337e6e9cbce217c5cdf53437acdcfacc2b6005db774433f64a8 + sha256sums = 578e63355d8455312561d5667f714ab8f97491ae0327b9756de02b83546b01d1 + +pkgname = astc-encoder + diff --git a/010-astc-encoder-use-arch-flags.patch b/010-astc-encoder-use-arch-flags.patch new file mode 100644 index 000000000000..e93fdafa4b7d --- /dev/null +++ b/010-astc-encoder-use-arch-flags.patch @@ -0,0 +1,36 @@ +--- a/Source/Makefile ++++ b/Source/Makefile +@@ -190,28 +190,28 @@ export BUILD + # Build rules for the command line wrapper + + $(BINARY): $(EXTERNAL_OBJECTS) $(OBJECTS) +- @$(CXX) -o $@ $^ $(CXXFLAGS) -lpthread ++ @$(CXX) -o $@ $^ $(CPPFLAGS) $(CXXFLAGS) -lpthread $(LDFLAGS) + @echo "[Link] $@ (using $(VEC) $(BUILD))" + + # Note: ensure NDEBUG is undefined; all three libraries are weak at runtime + # handling of corrupt files, relying on asserts to handle bad file input. + # Compiling with NDEBUG is a potential security risk. + stb_image-$(BINARY).o: stb_image.h +- @$(CXX) -c -x c++ -o $@ $< $(CXXFLAGS_EXTERNAL) -DSTB_IMAGE_IMPLEMENTATION \ ++ @$(CXX) -c -x c++ -o $@ $< $(CPPFLAGS) $(CXXFLAGS_EXTERNAL) -DSTB_IMAGE_IMPLEMENTATION \ + -DSTBI_NO_PSD -DSTBI_NO_GIF -DSTBI_NO_PIC -DSTBI_NO_PNM -UNDEBUG + @echo "[C++] $<" + + stb_image_write-$(BINARY).o: stb_image_write.h +- @$(CXX) -c -x c++ -o $@ $< $(CXXFLAGS_EXTERNAL) -DSTB_IMAGE_WRITE_IMPLEMENTATION \ ++ @$(CXX) -c -x c++ -o $@ $< $(CPPFLAGS) $(CXXFLAGS_EXTERNAL) -DSTB_IMAGE_WRITE_IMPLEMENTATION \ + -UNDEBUG + @echo "[C++] $<" + + tinyexr-$(BINARY).o: tinyexr.h +- @$(CXX) -c -x c++ -o $@ $< $(CXXFLAGS) -DTINYEXR_IMPLEMENTATION -UNDEBUG ++ @$(CXX) -c -x c++ -o $@ $< $(CPPFLAGS) $(CXXFLAGS) -DTINYEXR_IMPLEMENTATION -UNDEBUG + @echo "[C++] $<" + + $(OBJECTS): %-$(BINARY).o: %.cpp $(HEADERS) +- @$(CXX) -c -o $@ $(abspath $<) $(CXXFLAGS) ++ @$(CXX) -c -o $@ $(abspath $<) $(CPPFLAGS) $(CXXFLAGS) + @echo "[C++] $<" + + # ================================================== diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..b836b96153ce --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,29 @@ +# Maintainer: Daniel Bermond <dbermond@archlinux.org> + +pkgname=astc-encoder +pkgver=2.1 +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') +source=("https://github.com/ARM-software/astc-encoder/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz" + '010-astc-encoder-use-arch-flags.patch') +sha256sums=('655bf72ff09d6337e6e9cbce217c5cdf53437acdcfacc2b6005db774433f64a8' + '578e63355d8455312561d5667f714ab8f97491ae0327b9756de02b83546b01d1') + +prepare() { + patch -d "${pkgname}-${pkgver}" -Np1 -i "${srcdir}/010-astc-encoder-use-arch-flags.patch" +} + +build() { + make -C "${pkgname}-${pkgver}/Source" APP='astcenc' VEC='sse2' + make -C "${pkgname}-${pkgver}/Source" APP='astcenc' VEC='sse4.2' + make -C "${pkgname}-${pkgver}/Source" APP='astcenc' VEC='avx2' +} + +package() { + install -D -m755 "${pkgname}-${pkgver}/Source"/astcenc-{sse2,sse4.2,avx2} -t "${pkgdir}/usr/bin" + ln -s astcenc-sse2 "${pkgdir}/usr/bin/astcenc" +} |