### this file is sourced not run
PKGVER=1.9.2
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=lz4-$PKGVER.tar.gz
MD5SUM=3898c56c82fb3d9455aefd48db48eaad
SRC_URL=https://github.com/lz4/lz4/archive/v${PKGVER}.tar.gz
BUNDLE=

SLACKREQ=''
SLACKDESC="liblz4: liblz4 $PKGVER (Fast compression program)
liblz4: 
liblz4: LZ4 is lossless compression algorithm, providing compression speed at 
liblz4: 400 MB/s per core, scalable with multi-cores CPU. It also features an 
liblz4: extremely fast decoder, with speed in multiple GB/s per core, 
liblz4: typically reaching RAM speed limits on multi-core systems.
liblz4: 
liblz4: https://lz4.github.io/lz4/
liblz4: 
liblz4: 
liblz4: 
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	rm -f /usr/bin/*lz4*
	cd /tmp/lz4*
	export CFLAGS="$CFLAGS -fPIC"
	MAKEFLAGS="$MAKEFLAGS PREFIX=/usr LIBDIR=/usr/$LIBDIR"

	# In v1.9.2 building via the main Makefile produces liblz4.a that breaks
	# linking, while building libarchive (only x86_64):
	# liblz4.a(lz4.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
	make $MAKEFLAGS -C lib &&
	make $MAKEFLAGS -C programs lz4 lz4c &&
	make $MAKEFLAGS install &&

	rm -rf /usr/$LIBDIR/liblz4.so* # don't want the shared library
	pkg_build_slackdesc &&
	
	true
}
