diff options
author | Tilmann Meyer | 2020-03-18 13:42:55 +0100 |
---|---|---|
committer | Tilmann Meyer | 2020-03-18 13:42:55 +0100 |
commit | 6e41b0296785c314e1a6fe62794ce3b3d5265eab (patch) | |
tree | 3d85fd4166f5785c1a8c839a56e3c509eaaa929d | |
download | aur-aarch64-linux-gnu-zstd.tar.gz |
addpkg: aarch64-linux-gnu-zstd
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | Fix-wrong-printf-escaping.patch | 40 | ||||
-rw-r--r-- | PKGBUILD | 56 |
3 files changed, 116 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..0cf0a17102c4 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = aarch64-linux-gnu-zstd + pkgdesc = Zstandard - Fast real-time compression algorithm (ARM64) + pkgver = 1.4.4 + pkgrel = 1 + url = https://www.zstd.net/ + arch = x86_64 + license = BSD + license = GPL2 + makedepends = aarch64-linux-gnu-environment + depends = aarch64-linux-gnu-zlib + depends = aarch64-linux-gnu-xz + depends = aarch64-linux-gnu-lz4 + options = !buildflags + source = https://github.com/facebook/zstd/archive/v1.4.4.tar.gz + source = Fix-wrong-printf-escaping.patch + sha256sums = a364f5162c7d1a455cc915e8e3cf5f4bd8b75d09bc0f53965b0c9ca1383c52c8 + sha256sums = bd778b14ecb8b30406ebab04f165d274a147d58b9d1e36f207906690fd072285 + +pkgname = aarch64-linux-gnu-zstd + diff --git a/Fix-wrong-printf-escaping.patch b/Fix-wrong-printf-escaping.patch new file mode 100644 index 000000000000..f487a4fdf54a --- /dev/null +++ b/Fix-wrong-printf-escaping.patch @@ -0,0 +1,40 @@ +diff --git a/programs/Makefile b/programs/Makefile +index 64dcae0..25032d9 100644 +--- a/programs/Makefile ++++ b/programs/Makefile +@@ -96,7 +96,7 @@ VOID = /dev/null + + # thread detection + NO_THREAD_MSG := ==> no threads, building without multithreading support +-HAVE_PTHREAD := $(shell printf '\#include <pthread.h>\nint main(void) { return 0; }' > have_pthread.c && $(CC) $(FLAGS) -o have_pthread$(EXT) have_pthread.c -pthread 2> $(VOID) && rm have_pthread$(EXT) && echo 1 || echo 0; rm have_pthread.c) ++HAVE_PTHREAD := $(shell printf '#include <pthread.h>\nint main(void) { return 0; }' > have_pthread.c && $(CC) $(FLAGS) -o have_pthread$(EXT) have_pthread.c -pthread 2> $(VOID) && rm have_pthread$(EXT) && echo 1 || echo 0; rm have_pthread.c) + HAVE_THREAD := $(shell [ "$(HAVE_PTHREAD)" -eq "1" -o -n "$(filter Windows%,$(OS))" ] && echo 1 || echo 0) + ifeq ($(HAVE_THREAD), 1) + THREAD_MSG := ==> building with threading support +@@ -108,7 +108,7 @@ endif + + # zlib detection + NO_ZLIB_MSG := ==> no zlib, building zstd without .gz support +-HAVE_ZLIB := $(shell printf '\#include <zlib.h>\nint main(void) { return 0; }' > have_zlib.c && $(CC) $(FLAGS) -o have_zlib$(EXT) have_zlib.c -lz 2> $(VOID) && rm have_zlib$(EXT) && echo 1 || echo 0; rm have_zlib.c) ++HAVE_ZLIB := $(shell printf '#include <zlib.h>\nint main(void) { return 0; }' > have_zlib.c && $(CC) $(FLAGS) -o have_zlib$(EXT) have_zlib.c -lz 2> $(VOID) && rm have_zlib$(EXT) && echo 1 || echo 0; rm have_zlib.c) + ifeq ($(HAVE_ZLIB), 1) + ZLIB_MSG := ==> building zstd with .gz compression support + ZLIBCPP = -DZSTD_GZCOMPRESS -DZSTD_GZDECOMPRESS +@@ -119,7 +119,7 @@ endif + + # lzma detection + NO_LZMA_MSG := ==> no liblzma, building zstd without .xz/.lzma support +-HAVE_LZMA := $(shell printf '\#include <lzma.h>\nint main(void) { return 0; }' > have_lzma.c && $(CC) $(FLAGS) -o have_lzma$(EXT) have_lzma.c -llzma 2> $(VOID) && rm have_lzma$(EXT) && echo 1 || echo 0; rm have_lzma.c) ++HAVE_LZMA := $(shell printf '#include <lzma.h>\nint main(void) { return 0; }' > have_lzma.c && $(CC) $(FLAGS) -o have_lzma$(EXT) have_lzma.c -llzma 2> $(VOID) && rm have_lzma$(EXT) && echo 1 || echo 0; rm have_lzma.c) + ifeq ($(HAVE_LZMA), 1) + LZMA_MSG := ==> building zstd with .xz/.lzma compression support + LZMACPP = -DZSTD_LZMACOMPRESS -DZSTD_LZMADECOMPRESS +@@ -130,7 +130,7 @@ endif + + # lz4 detection + NO_LZ4_MSG := ==> no liblz4, building zstd without .lz4 support +-HAVE_LZ4 := $(shell printf '\#include <lz4frame.h>\n\#include <lz4.h>\nint main(void) { return 0; }' > have_lz4.c && $(CC) $(FLAGS) -o have_lz4$(EXT) have_lz4.c -llz4 2> $(VOID) && rm have_lz4$(EXT) && echo 1 || echo 0; rm have_lz4.c) ++HAVE_LZ4 := $(shell printf '#include <lz4frame.h>\n#include <lz4.h>\nint main(void) { return 0; }' > have_lz4.c && $(CC) $(FLAGS) -o have_lz4$(EXT) have_lz4.c -llz4 2> $(VOID) && rm have_lz4$(EXT) && echo 1 || echo 0; rm have_lz4.c) + ifeq ($(HAVE_LZ4), 1) + LZ4_MSG := ==> building zstd with .lz4 compression support + LZ4CPP = -DZSTD_LZ4COMPRESS -DZSTD_LZ4DECOMPRESS diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..32778424d893 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,56 @@ +# Maintainer: Tilmann Meyer <tilmann.meyer@gmx.net> + +_target=aarch64-linux-gnu + +_pkgname=zstd +pkgname=$_target-$_pkgname +pkgver=1.4.4 +pkgrel=1 +pkgdesc='Zstandard - Fast real-time compression algorithm (ARM64)' +arch=(x86_64) +url='https://www.zstd.net/' +license=(BSD GPL2) +depends=($_target-zlib $_target-xz $_target-lz4) +makedepends=($_target-environment) +options=(!buildflags) +source=( + https://github.com/facebook/$_pkgname/archive/v$pkgver.tar.gz + 'Fix-wrong-printf-escaping.patch' +) +sha256sums=( + 'a364f5162c7d1a455cc915e8e3cf5f4bd8b75d09bc0f53965b0c9ca1383c52c8' + 'bd778b14ecb8b30406ebab04f165d274a147d58b9d1e36f207906690fd072285' +) + +_srcdir=$_pkgname-$pkgver + +strip() { + ${_target}-strip "$@" +} + +objcopy() { + ${_target}-objcopy "$@" +} + +prepare() { + cd $_srcdir + + for patch in "$srcdir/"*.patch; do + msg2 "Applying patch $patch" + patch -p1 -i "$patch" + done +} + +build() { + cd $_srcdir + + source $_target-environment + + make CC=$_target-gcc PREFIX=/usr/$_target +} + +package() { + cd $_srcdir + + make PREFIX=/usr/$_target DESTDIR="$pkgdir/" install +} |