Paste details

xz en shell

markand

makefile

month

PKGNAME=xz
PKGVERSION=5.2.4
PKGREVISION=1
PKGLICENSE="LGPLv21 GPLv2 GPLv3"
PKGSUMMARY="XZ and LZMA compression tools"
PKGDOWNLOAD="https://tukaani.org/$PKGNAME/$PKGNAME-$PKGVERSION.tar.gz"
PKGOPTIONS="NLS"

: ${CHOST:=$(uname -m)-linux-musl}
: ${CBUILD:=$(uname -m)-linux-musl}
: ${CC:=clang}
: ${CFLAGS:=-O2}
: ${LDFLAGS:=}
: ${LIBS:=}
: ${NLS:=yes}

if [ "${NLS:-yes}" = "yes" ]; then
	PKGDEPENDS="core/gettext:build $PKGDEPENDS"
	with_nls="--enable-nls"
else
	with_nls="--disable-nls"
fi

build()
{
	rm -rf $PKGNAME-$PKGVERSION
	tar xvf $PKGNAME-$PKGVERSION.tar.gz
	cd $PKGNAME-$PKGVERSION

	CC="$CC" \
	CFLAGS="$CFLAGS" \
	LDFLAGS="$LDFLAGS" \
	LIBS="$LIBS" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix= \
		--disable-static \
		--enable-shared \
		$with_nls
	make
	make install DESTDIR=$DESTDIR
	rm -f $DESTDIR/lib/liblzma.la

	cd ..
	rm -rf $PKGNAME-$PKGVERSION
}