summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/newt
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/newt')
-rw-r--r--meta/recipes-extended/newt/files/cross_ar.patch51
-rw-r--r--meta/recipes-extended/newt/files/fix_SHAREDDIR.patch29
-rw-r--r--meta/recipes-extended/newt/files/fix_python_fpic.patch24
-rw-r--r--meta/recipes-extended/newt/files/remove_slang_include.patch16
-rw-r--r--meta/recipes-extended/newt/libnewt-python_0.52.14.bb27
-rw-r--r--meta/recipes-extended/newt/libnewt_0.52.14.bb49
6 files changed, 196 insertions, 0 deletions
diff --git a/meta/recipes-extended/newt/files/cross_ar.patch b/meta/recipes-extended/newt/files/cross_ar.patch
new file mode 100644
index 0000000000..f67239abda
--- /dev/null
+++ b/meta/recipes-extended/newt/files/cross_ar.patch
@@ -0,0 +1,51 @@
1Fix cross link using autoconf detected AR
2
3If building on 32bit host and creating 64bit libraries, the target
4package builds should not invoke the 32bit hosts's ar. Specifically
5you will get an error message like:
6
7x86_64-linux-gcc -m64 --sysroot=/opt/qemux86-64/tmp/sysroots/qemux86-64 -g -o test test.o libnewt.a -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -lslang
8libnewt.a: could not read symbols: Archive has no index; run ranlib to add one
9collect2: error: ld returned 1 exit status
10
11Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
12
13Upstream-Status: Pending
14
15---
16 Makefile.in | 3 ++-
17 configure.ac | 4 ++++
18 2 files changed, 6 insertions(+), 1 deletion(-)
19
20--- a/Makefile.in
21+++ b/Makefile.in
22@@ -7,6 +7,7 @@ CFLAGS = @CFLAGS@
23 LDFLAGS = @LDFLAGS@
24 CPPFLAGS = -D_GNU_SOURCE @CPPFLAGS@
25 GNU_LD = @GNU_LD@
26+AR = @AR@
27
28 VERSION = @VERSION@
29 TAG = r$(subst .,-,$(VERSION))
30@@ -95,7 +96,7 @@ whiptcl.so: $(WHIPTCLOBJS) $(LIBNEWTSH)
31 $(CC) -shared $(SHCFLAGS) $(LDFLAGS) -o whiptcl.so $(WHIPTCLOBJS) -L. -lnewt $(LIBTCL) -lpopt $(LIBS)
32
33 $(LIBNEWT): $(LIBOBJS)
34- ar rv $@ $^
35+ $(AR) rv $@ $^
36
37 newt.o $(SHAREDDIR)/newt.o: newt.c Makefile
38
39--- a/configure.ac
40+++ b/configure.ac
41@@ -14,6 +14,10 @@ AC_PROG_CC
42 AC_PROG_INSTALL
43 AC_PROG_LN_S
44 AC_PROG_GREP
45+AN_MAKEVAR([AR], [AC_PROG_AR])
46+AN_PROGRAM([ar], [AC_PROG_AR])
47+AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
48+AC_PROG_AR
49
50 # Are we using GNU ld?
51 AC_MSG_CHECKING([for GNU ld])
diff --git a/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch b/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch
new file mode 100644
index 0000000000..7795260388
--- /dev/null
+++ b/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch
@@ -0,0 +1,29 @@
1Upstream-Status: Pending
2
3Author: dexuan.cui@intel.com
4Date: Fri Apr 15 16:17:39 CST 2011
5
6The patch fixes a parallel-make issue: when generating $(SHAREDDIR)/%.o, we should
7ensure the directory ${SHAREDDIR} exists.
8
9We need to push the patch to upstream.
10
11Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
12
13--- a/Makefile.in
14+++ b/Makefile.in
15@@ -114,12 +114,12 @@
16
17 sharedlib: $(LIBNEWTSH)
18
19-$(LIBNEWTSH): $(SHAREDDIR) $(SHAREDOBJS)
20+$(LIBNEWTSH): $(SHAREDOBJS)
21 $(CC) -shared -o $(LIBNEWTSH) $(SHLIBFLAGS) $(SHAREDOBJS) $(LDFLAGS) $(LIBS)
22 ln -fs $(LIBNEWTSONAME) libnewt.so
23 ln -fs $(LIBNEWTSH) $(LIBNEWTSONAME)
24
25-$(SHAREDDIR)/%.o : %.c
26+$(SHAREDDIR)/%.o : %.c $(SHAREDDIR)
27 $(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
28
29 install: $(LIBNEWT) install-sh whiptail
diff --git a/meta/recipes-extended/newt/files/fix_python_fpic.patch b/meta/recipes-extended/newt/files/fix_python_fpic.patch
new file mode 100644
index 0000000000..3ef94e0c56
--- /dev/null
+++ b/meta/recipes-extended/newt/files/fix_python_fpic.patch
@@ -0,0 +1,24 @@
1Fix relocations warning when compile python module
2
3After enable python support in newt, bitbake complains warning:
4
5WARNING: QA Issue: ELF binary '/mnt/sda10/poky-all-platform/build/tmp/work/i586-poky-linux/libnewt/0.52.14-r2/packages-split/libnewt-python/usr/lib/python2.7/site-packages/_snackmodule.so' has relocations in .text
6
7Add flag -fPIC to compile _snackmodule.so to fix the warning.
8
9Signed-off-by: Kang Kai <kai.kang@windriver.com>
10
11Upstream-Status: Pending
12
13---
14--- newt-0.52.14/Makefile.in 2012-12-04 17:27:27.578915801 +0800
15+++ newt-0.52.14/Makefile.in.new 2012-12-04 17:28:43.274918472 +0800
16@@ -84,7 +84,7 @@
17 PIFLAGS=`$$ver-config --includes`; \
18 PLDFLAGS=`$$ver-config --ldflags`; \
19 PLFLAGS=`$$ver-config --libs`; \
20- $(CC) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c ;\
21+ $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c ;\
22 $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS);\
23 done || :
24 touch $@
diff --git a/meta/recipes-extended/newt/files/remove_slang_include.patch b/meta/recipes-extended/newt/files/remove_slang_include.patch
new file mode 100644
index 0000000000..a2634ec75b
--- /dev/null
+++ b/meta/recipes-extended/newt/files/remove_slang_include.patch
@@ -0,0 +1,16 @@
1
2Upstream-Status: Pending
3
4Index: git/Makefile.in
5===================================================================
6--- git.orig/Makefile.in
7+++ git/Makefile.in
8@@ -5,7 +5,7 @@ CC = @CC@
9 CPP = @CPP@
10 CFLAGS = @CFLAGS@
11 LDFLAGS = @LDFLAGS@
12-CPPFLAGS = -D_GNU_SOURCE -I/usr/include/slang @CPPFLAGS@
13+CPPFLAGS = -D_GNU_SOURCE @CPPFLAGS@
14 GNU_LD = @GNU_LD@
15
16 VERSION = @VERSION@
diff --git a/meta/recipes-extended/newt/libnewt-python_0.52.14.bb b/meta/recipes-extended/newt/libnewt-python_0.52.14.bb
new file mode 100644
index 0000000000..871b1958eb
--- /dev/null
+++ b/meta/recipes-extended/newt/libnewt-python_0.52.14.bb
@@ -0,0 +1,27 @@
1require recipes-extended/newt/libnewt_${PV}.bb
2
3SUMMARY .= " - python"
4DEPENDS = "libnewt python"
5RDEPENDS_${PN} += "python-core"
6
7inherit pythonnative python-dir
8
9EXTRA_OECONF += "--with-python"
10EXTRA_OEMAKE += "PYTHONVERS=${PYTHON_DIR}"
11
12
13do_compile () {
14 VERSION="$(sed -n 's/^VERSION = //p' Makefile)"
15 oe_runmake "LIBNEWTSH=${STAGING_LIBDIR}/libnewt.so.$VERSION" _snackmodule.so
16}
17
18do_install () {
19 install -d ${D}${PYTHON_SITEPACKAGES_DIR}
20 install -m 0755 ${PYTHON_DIR}/_snackmodule.so ${D}${PYTHON_SITEPACKAGES_DIR}/
21 install -m 0644 snack.py ${D}${PYTHON_SITEPACKAGES_DIR}/
22}
23
24PACKAGES_remove = "whiptail"
25
26FILES_${PN} = "${PYTHON_SITEPACKAGES_DIR}/*"
27FILES_${PN}-dbg += "${PYTHON_SITEPACKAGES_DIR}/.debug/"
diff --git a/meta/recipes-extended/newt/libnewt_0.52.14.bb b/meta/recipes-extended/newt/libnewt_0.52.14.bb
new file mode 100644
index 0000000000..65bcf40428
--- /dev/null
+++ b/meta/recipes-extended/newt/libnewt_0.52.14.bb
@@ -0,0 +1,49 @@
1SUMMARY = "A library for text mode user interfaces"
2
3DESCRIPTION = "Newt is a programming library for color text mode, widget based user \
4interfaces. Newt can be used to add stacked windows, entry widgets, \
5checkboxes, radio buttons, labels, plain text fields, scrollbars, \
6etc., to text mode user interfaces. This package also contains the \
7shared library needed by programs built with newt, as well as a \
8/usr/bin/dialog replacement called whiptail. Newt is based on the \
9slang library."
10
11HOMEPAGE = "https://fedorahosted.org/newt/"
12SECTION = "libs"
13
14LICENSE = "LGPLv2"
15LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605"
16
17# slang needs to be >= 2.2
18DEPENDS = "slang popt"
19
20PR = "r2"
21
22SRC_URI = "https://fedorahosted.org/releases/n/e/newt/newt-${PV}.tar.gz \
23 file://remove_slang_include.patch \
24 file://fix_SHAREDDIR.patch \
25 file://cross_ar.patch \
26 file://fix_python_fpic.patch"
27
28SRC_URI[md5sum] = "eb78c6bb658b92ec7198908b5b8d0e37"
29SRC_URI[sha256sum] = "f70f4f58baa60388ddf2e39249ffb00898fb40f2b2767e42e2ab51fe4b40978e"
30
31S = "${WORKDIR}/newt-${PV}"
32
33EXTRA_OECONF = "--without-tcl --without-python"
34
35inherit autotools-brokensep
36
37export STAGING_INCDIR
38export STAGING_LIBDIR
39
40export BUILD_SYS
41export HOST_SYS
42
43PACKAGES_prepend = "whiptail "
44
45do_configure_prepend() {
46 sh autogen.sh
47}
48
49FILES_whiptail = "${bindir}/whiptail"