diff --git a/libs/newt/Makefile b/libs/newt/Makefile new file mode 100644 index 000000000..75fdb145b --- /dev/null +++ b/libs/newt/Makefile @@ -0,0 +1,74 @@ +# +# Copyright (C) 2006-2011 OpenWrt.org +# Copyright (C) 2011 SMBPhone Inc. +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=newt +PKG_VERSION:=0.52.12 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://fedorahosted.org/releases/n/e/newt/ +PKG_MD5SUM:=51b04128d9e1bf000fa769c417b74486 + +include $(INCLUDE_DIR)/package.mk + +define Package/libnewt + URL:=http://fedorahosted.org/newt/ + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Not Erik's Windowing Toolkit + DEPENDS:= +libslang2 +libpopt +endef + +define Package/libnewt/description + Programming library for colour text mode widget-based user interfaces, + based on S-Lang. +endef + +define Package/whiptail + URL:=http://fedorahosted.org/newt/ + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Dialog boxes from shell scripts + DEPENDS:= +libnewt +endef + +define Package/whiptail/description + A lightweight replacement for the dialog command (dialog boxes from shell + scripts), based on libnewt. +endef + +TARGET_CFLAGS += $(FPIC) -I$(STAGING_DIR)/usr/include -L$(STAGING_DIR)/usr/lib + +CONFIGURE_ARGS += \ + --disable-nls \ + --without-tcl \ + --without-gpm-support + +define Package/libnewt/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libnewt.so* $(1)/usr/lib/ +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/newt.h $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libnewt.{a,so*} $(1)/usr/lib/ +endef + +define Package/whiptail/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/whiptail $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libnewt)) +$(eval $(call BuildPackage,whiptail)) + diff --git a/libs/newt/patches/100-compile-fix-broken-makefile.patch b/libs/newt/patches/100-compile-fix-broken-makefile.patch new file mode 100644 index 000000000..5fc45b8fb --- /dev/null +++ b/libs/newt/patches/100-compile-fix-broken-makefile.patch @@ -0,0 +1,60 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -4,7 +4,7 @@ LIBTCL = -ltcl8.4 + CC = @CC@ + CPP = @CPP@ + CFLAGS = @CFLAGS@ +-CPPFLAGS = -D_GNU_SOURCE -I/usr/include/slang @CPPFLAGS@ ++CPPFLAGS = -D_GNU_SOURCE @CPPFLAGS@ + + SHLIBFLAGS= -Wl,--version-script,newt.0.52.ver + VERSION = @VERSION@ +@@ -53,19 +53,19 @@ endif + all: $(TARGET) _snackmodule.so + + test: test.o $(LIBNEWT) +- $(CC) -g -o test test.o $(LIBNEWT) $(LIBS) ++ $(CC) $(CFLAGS) -g -o test test.o $(LIBNEWT) $(LIBS) + + testgrid: testgrid.o $(LIBNEWT) +- $(CC) -g -o testgrid testgrid.o $(LIBNEWT) $(LIBS) ++ $(CC) $(CFLAGS) -g -o testgrid testgrid.o $(LIBNEWT) $(LIBS) + + testtree: testtree.o $(LIBNEWT) +- $(CC) -g -o testtree testtree.o $(LIBNEWT) $(LIBS) ++ $(CC) $(CFLAGS) -g -o testtree testtree.o $(LIBNEWT) $(LIBS) + + showchars: showchars.o $(LIBNEWT) +- $(CC) -g -o showchars showchars.o $(LIBNEWT) $(LIBS) ++ $(CC) $(CFLAGS) -g -o showchars showchars.o $(LIBNEWT) $(LIBS) + + showkey: showkey.o $(LIBNEWT) +- $(CC) -g -o showkey showkey.o $(LIBNEWT) $(LIBS) ++ $(CC) $(CFLAGS) -g -o showkey showkey.o $(LIBNEWT) $(LIBS) + + _snackmodule.so: snackmodule.c $(LIBNEWTSH) + for ver in $(PYTHONVERS) ; do \ +@@ -76,7 +76,7 @@ _snackmodule.so: snackmodule.c $(LIBNE + touch $@ + + whiptail: $(NDIALOGOBJS) $(LIBNEWTSH) +- $(CC) -g -o whiptail $(NDIALOGOBJS) -L . -lnewt $(LIBS) -lpopt ++ $(CC) $(CFLAGS) -g -o whiptail $(NDIALOGOBJS) -L . -lnewt $(LIBS) -lpopt + + whiptcl.so: $(WHIPTCLOBJS) $(LIBNEWTSH) + $(CC) -shared $(SHCFLAGS) -o whiptcl.so $(WHIPTCLOBJS) -L . -lnewt $(LIBTCL) -lpopt +@@ -102,12 +102,12 @@ $(SHAREDDIR): + sharedlib: $(LIBNEWTSH) + + $(LIBNEWTSH): $(SHAREDDIR) $(SHAREDOBJS) +- $(CC) -shared -o $(LIBNEWTSH) $(SHLIBFLAGS) -Wl,-soname,$(LIBNEWTSONAME) $(SHAREDOBJS) $(LIBS) ++ $(CC) $(CFLAGS) -shared -o $(LIBNEWTSH) $(SHLIBFLAGS) -Wl,-soname,$(LIBNEWTSONAME) $(SHAREDOBJS) $(LIBS) + ln -fs $(LIBNEWTSONAME) libnewt.so + ln -fs $(LIBNEWTSH) $(LIBNEWTSONAME) + + $(SHAREDDIR)/%.o : %.c +- $(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< ++ $(CC) $(CFLAGS) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< + + install: $(LIBNEWT) install-sh whiptail + [ -d $(instroot)/$(bindir) ] || install -m 755 -d $(instroot)/$(bindir)