Skip to content

Commit 04d6cbd

Browse files
committed
Refactor ncurses installation to build only the wide version and update readline patch to use ncursesw with proper linker flags
1 parent 8d64b41 commit 04d6cbd

File tree

2 files changed

+7
-40
lines changed

2 files changed

+7
-40
lines changed

build/pkgs/ncurses/spkg-install.in

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,9 @@ fi
77

88
cd src
99

10-
# Ncurses cannot build narrow and wide (unicode, --enable-widec)
11-
# versions in one go. Need to compile twice. Note that Python's curses
12-
# module will want the wide version, and readline the narrow version.
13-
14-
###################################################
15-
mkdir narrow
16-
cd narrow
17-
ln -s ../configure .
18-
19-
echo "Configuring ncurses (narrow)..."
20-
sdh_configure --with-termlib \
21-
--with-shared \
22-
--without-normal \
23-
--without-ada \
24-
--disable-rpath-hack \
25-
--enable-overwrite \
26-
--with-pkg-config-libdir="$SAGE_LOCAL/lib/pkgconfig" \
27-
--enable-pc-files \
28-
--without-cxx \
29-
--without-cxx-binding \
30-
"$DEBUG_CONFIGURE_FLAG"
31-
32-
echo "Building ncurses (narrow)..."
33-
sdh_make
34-
35-
echo "Installing ncurses (narrow)..."
36-
sdh_make_install
37-
38-
cd .. # leave narrow
39-
40-
###################################################
41-
mkdir wide
42-
cd wide
43-
ln -s ../configure .
10+
# Build only the wide (unicode, --enable-widec) version of ncurses.
11+
# Python's curses module wants the wide version.
12+
# Readline should also work with wide version via compatibility symlinks.
4413

4514
echo "Configuring ncurses (wide)..."
4615
sdh_configure --with-termlib \
@@ -49,6 +18,7 @@ sdh_configure --with-termlib \
4918
--without-normal \
5019
--without-ada \
5120
--disable-rpath-hack \
21+
--enable-overwrite \
5222
--with-pkg-config-libdir="$SAGE_LOCAL/lib/pkgconfig" \
5323
--enable-pc-files \
5424
--without-cxx \
@@ -61,7 +31,4 @@ sdh_make
6131
echo "Installing ncurses (wide)..."
6232
sdh_make_install
6333

64-
cd .. # leave wide
65-
6634
# Note: Symbolic links for compatibility are created in spkg-postinst
67-
# after the files have been moved to their final location.

build/pkgs/readline/patches/0002-ltinfo.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
SHOBJ_LDFLAGS=
66
SHOBJ_XLDFLAGS=
77
-SHOBJ_LIBS=
8-
+SHOBJ_LIBS='$(TERMCAP_LIB)'
8+
+SHOBJ_LIBS='-Wl,--no-as-needed -lncursesw -Wl,--as-needed'
99

1010
SHLIB_XLDFLAGS=
1111
-SHLIB_LIBS=
12-
+SHLIB_LIBS='$(TERMCAP_LIB)'
12+
+SHLIB_LIBS='-Wl,--no-as-needed -lncursesw -Wl,--as-needed'
1313

1414
SHLIB_DOT='.'
1515
SHLIB_LIBPREF='lib'
@@ -18,7 +18,7 @@
1818
esac
1919

2020
- SHLIB_LIBS='-lncurses' # see if -lcurses works on MacOS X 10.1
21-
+ SHLIB_LIBS='$(TERMCAP_LIB)'
21+
+ SHLIB_LIBS='-Wl,--no-as-needed -lncursesw -Wl,--as-needed'
2222
;;
2323

2424
openbsd*|netbsd*|mirbsd*)

0 commit comments

Comments
 (0)