summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-01-13 10:13:33 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2012-01-18 12:08:17 +0000
commit849b3b8bf815ba5e6b6d6071f459962b1055836c (patch)
tree3478ca4a31998a422a0a0e07ac513b82f39c83f4
parent546cc79fd08426014265f5ed131b69cc1977f43d (diff)
downloadncurses-849b3b8bf815ba5e6b6d6071f459962b1055836c.tar.gz
Add required explicit steps to morph
ncurses does not appear to build shared, wide-character libraries by default adds extra install steps in a separate script as it is more readable than embedding steps into the morph
-rw-r--r--ncurses-morph-postinstall.sh33
-rw-r--r--ncurses.morph11
2 files changed, 43 insertions, 1 deletions
diff --git a/ncurses-morph-postinstall.sh b/ncurses-morph-postinstall.sh
new file mode 100644
index 0000000..9dd00fc
--- /dev/null
+++ b/ncurses-morph-postinstall.sh
@@ -0,0 +1,33 @@
+#/usr/bin/env sh
+# lfs recommends some alterations for software that looks for
+# libcurses instead of libncurses
+# it's more convenient to have this in a separate file than the
+# morph as less strings have to be escaped and comments are possible
+
+# some software expects to find libcurses in /lib
+mkdir -pv "$DESTDIR/lib"
+mv -v "$DESTDIR"/usr/lib/libncursesw.so.5* "$DESTDIR"/lib
+ln -sfv ../../lib/libncursesw.so.5 "$DESTDIR"/usr/lib/libncursesw.so
+
+# some linker tricks for libraries that look for non-wide character
+# versions of ncurses
+for lib in ncurses form panel menu; do
+ # remove non-wide shared object
+ rm -vf "$DESTDIR/usr/lib/lib${lib}.so"
+ # use a linker script to find the wide character variant
+ echo "INPUT(-l${lib}w)" >"$DESTDIR/usr/lib/lib${lib}.so"
+ # symlink the non-shared library
+ ln -sfv "lib${lib}w.a" "$DESTDIR/usr/lib/lib${lib}.a"
+done
+ln -sfv libncurses++w.a "$DESTDIR/usr/lib/libncurses++.a"
+
+# redirect software that looks for libcurses
+rm -vf "$DESTDIR/usr/lib/libcursesw.so"
+echo "INPUT(-lncursesw)" >"$DESTDIR/usr/lib/libcursesw.so"
+ln -sfv libncurses.so "$DESTDIR/usr/lib/libcurses.so"
+ln -sfv libncursesw.a "$DESTDIR/usr/lib/libcursesw.a"
+ln -sfv libncurses.a "$DESTDIR/usr/lib/libcurses.a"
+
+# install documentation
+mkdir -pv "$DESTDIR/usr/share/doc/ncurses"
+cp -v -R doc/* "$DESTDIR/usr/share/doc/ncurses"
diff --git a/ncurses.morph b/ncurses.morph
index ca11e36..2a917d9 100644
--- a/ncurses.morph
+++ b/ncurses.morph
@@ -1,5 +1,14 @@
{
"name": "ncurses",
"kind": "chunk",
- "build-system": "autotools"
+ "configure-commands": [
+ "./configure --with-shared --without-debug --enable-widec"
+ ],
+ "build-commands": [
+ "make"
+ ],
+ "install-commands": [
+ "make install",
+ "sh ncurses-morph-postinstall.sh"
+ ]
}