diff lib/ncurses/ncurses.sh @ 140:ef65bd5eb573

lib: merge .sh and .info
author David Demelier <markand@malikania.fr>
date Mon, 11 Mar 2019 16:33:11 +0100
parents 3fd04524c63d
children 7c631ce1660f
line wrap: on
line diff
--- a/lib/ncurses/ncurses.sh	Mon Mar 11 15:49:38 2019 +0100
+++ b/lib/ncurses/ncurses.sh	Mon Mar 11 16:33:11 2019 +0100
@@ -15,46 +15,68 @@
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #
 
+PKGNAME=ncurses
+PKGVERSION=6.1
+PKGREVISION=1
+PKGLICENSE="MIT"
+PKGSUMMARY="curses library"
+PKGDOWNLOAD="https://ftp.gnu.org/pub/gnu/$PKGNAME/$PKGNAME-$PKGVERSION.tar.gz"
+
+: ${CHOST:=$(uname -m)-linux-musl}
+: ${CBUILD:=$(uname -m)-linux-musl}
 : ${CC:=gcc}
 : ${CFLAGS:=-O2}
-
-source ./ncurses.info
+: ${LDFLAGS:=}
+: ${LIBS:=}
 
-set -ex
-
-rm -rf $PKGNAME-$PKGVERSION
-tar xvaf $PKGNAME-$PKGVERSION.tar.gz
-pushd $PKGNAME-$PKGVERSION
+build()
+{
+	rm -rf $PKGNAME-$PKGVERSION
+	tar xvaf $PKGNAME-$PKGVERSION.tar.gz
+	pushd $PKGNAME-$PKGVERSION
 
-# wide version
-mkdir wide-build && pushd wide-build
-CC="$CC" CFLAGS="$CFLAGS" ../configure \
-	--enable-pc-files \
-	--enable-widec \
-	--prefix=/usr \
-	--without-ada \
-	--with-pkg-config-libdir=/usr/lib/pkgconfig \
-	--with-shared \
-	--without-debug
-make
-make install DESTDIR=$DESTDIR
-rm -f $DESTDIR/usr/lib/lib{menuw,ncursesw,panelw,formw}.a
-popd
+	# wide version
+	mkdir wide-build && pushd wide-build
+	CC="$CC" \
+	CFLAGS="$CFLAGS" \
+	LDFLAGS="$LDFLAGS" \
+	LIBS="$LIBS" \
+	../configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--target=$CTARGET \
+		--prefix=/usr
+		--enable-pc-files \
+		--enable-widec \
+		--prefix=/usr \
+		--without-ada \
+		--with-pkg-config-libdir=/usr/lib/pkgconfig \
+		--with-shared \
+		--without-debug
+	make
+	make install DESTDIR=$DESTDIR
+	rm -f $DESTDIR/usr/lib/lib{menuw,ncursesw,panelw,formw}.a
+	popd
 
-# normal version
-mkdir normal-build && pushd normal-build
-CC="$CC" CFLAGS="$CFLAGS" ../configure \
-	--enable-pc-files \
-	--prefix=/usr \
-	--without-ada \
-	--with-pkg-config-libdir=/usr/lib/pkgconfig \
-	--with-shared \
-	--without-debug
-make
-make install DESTDIR=$DESTDIR
-rm -f $DESTDIR/usr/lib/lib{menu,ncurses,panel,form}.a
-ln -sf libncurses.so $DESTDIR/usr/lib/libcurses.so
-popd
+	# normal version
+	mkdir normal-build && pushd normal-build
+	CC="$CC" \
+	CFLAGS="$CFLAGS" \
+	LDFLAGS="$LDFLAGS" \
+	LIBS="$LIBS" \
+	../configure \
+		--enable-pc-files \
+		--prefix=/usr \
+		--without-ada \
+		--with-pkg-config-libdir=/usr/lib/pkgconfig \
+		--with-shared \
+		--without-debug
+	make
+	make install DESTDIR=$DESTDIR
+	rm -f $DESTDIR/usr/lib/lib{menu,ncurses,panel,form}.a
+	ln -sf libncurses.so $DESTDIR/usr/lib/libcurses.so
+	popd
 
-popd
-rm -rf $PKGNAME-$PKGVERSION
+	popd
+	rm -rf $PKGNAME-$PKGVERSION
+}