changeset 86:b00538982dce

core/attr: add NLS option and cleanup
author David Demelier <markand@malikania.fr>
date Thu, 07 Mar 2019 20:21:00 +0100
parents 23a0cb054ba8
children c0dbe649efd4
files core/attr/attr.info core/attr/attr.sh
diffstat 2 files changed, 26 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/core/attr/attr.info	Thu Mar 07 20:19:00 2019 +0100
+++ b/core/attr/attr.info	Thu Mar 07 20:21:00 2019 +0100
@@ -21,3 +21,8 @@
 PKGLICENSE="GPLv2+"
 PKGSUMMARY="extended attribute support library"
 PKGDOWNLOAD="https://download.savannah.gnu.org/releases/$PKGNAME/$PKGNAME-$PKGVERSION.tar.gz"
+PKGOPTIONS="NLS"
+
+if [ "${NLS:-yes}" = "yes" ]; then
+	PKGDEPENDS="core/gettext $PKGDEPENDS"
+fi
--- a/core/attr/attr.sh	Thu Mar 07 20:19:00 2019 +0100
+++ b/core/attr/attr.sh	Thu Mar 07 20:21:00 2019 +0100
@@ -15,24 +15,35 @@
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #
 
+: ${CHOST:=$(uname -m)-linux-musl}
+: ${CBUILD:=$(uname -m)-linux-musl}
+: ${CC:=gcc}
+: ${CFLAGS:=-O2}
+
 source ./attr.info
 
-case $(uname -m) in
-x86_64)
-	CFLAGS="-O2 -fPIC"
-	;;
-*)
-	CFLAGS="-O2"
-	;;
-esac
+set -ex
 
-set -e
+if [ "${NLS:-yes}" = "no" ]; then
+	with_nls="--disable-nls"
+else
+	with_nls="--enable-nls"
+fi
 
 rm -rf $PKGNAME-$PKGVERSION
 tar xvaf $PKGNAME-$PKGVERSION.tar.gz
 pushd $PKGNAME-$PKGVERSION
 
-CFLAGS="$CFLAGS" ./configure --prefix=/usr --sysconfdir=/etc
+CC="$CC" \
+CFLAGS="$CFLAGS" \
+./configure \
+	--build=${CBUILD} \
+	--host=${CHOST} \
+	--prefix=/usr \
+	--sysconfdir=/etc \
+	--disable-static \
+	--enable-shared \
+	${with_nls}
 make
 make install DESTDIR=$DESTDIR
 rm -f $DESTDIR/usr/lib/libattr.la