Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Simplify patches after more thorough investigation
Browse files Browse the repository at this point in the history
  • Loading branch information
nesciens committed Aug 19, 2014
1 parent e0d9941 commit 1f85012
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 66 deletions.
69 changes: 56 additions & 13 deletions build/pkgs/readline/SPKG.txt
Expand Up @@ -30,29 +30,72 @@ Website: http://tiswww.case.edu/php/chet/readline/rltop.html
== Special Update/Build Instructions ==

We build readline using ncurses. Readline needs to be told to link
with libtinfo (part of ncurses), this is what the patch to shobj-conf
does.
with libtinfo (part of ncurses), this is what the patch
0002-ltinfo.patch does.


== Patches ==

* shobj-conf.patch: Readline's hand-crafted shared library options
are buggy (should be using libtool).
* 0001-macports.patch: Changes to shobj.conf for OS/X, from macports:
https://trac.macports.org/browser/trunk/dports/devel/readline/files/patch-shobj-conf.diff
* 0002-ltinfo.patch: We build readline using ncurses, and for that it
needs to be told to link with libtinfo (part of ncurses).


== Changelog ==

=== readline-6.3 (Erik Massop, 15 June 2014) ===
* Trac #16480: Upgrade to 6.3 (latest upstream)
* Updated shobj-conf.patch. It used to 1) add -ltinfo to SHOBJ_LIBS
for the general case, 2) add -ltinfo to SHLIB_LIBS for the general
case and for OS/X, 3) remove case freebsd*-gentoo, 4) assume elf if
/usr/bin/objformat does not exist, 5) remove numeric freebsd
versions at freebsdelf*|dragonfly*, 6) remove
MACOSX_DEPLOYMENT_TARGET, 7) do things related to -arch_only on
OS/X. I applied 1 through 6 analogously. I omitted 7, as readline
now does some handling of -arch_only itself and I will assume that
they did this correctly.
* Updated shobj-conf.patch. It used to do these things:
1. Add -ltinfo in various places, namely
i. to SHOBJ_LIBS for the general case, and
ii. to SHLIB_LIBS for the general case and for OS/X.
2. Remove case freebsd*-gentoo.
3. Remove freebsd[4-9]* at freebsdelf*|dragonfly*.
4. Assume ELF if /usr/bin/objformat does not exist on freebsd3* and
freebsdaout*.
5. Remove MACOSX_DEPLOYMENT_TARGET and do things related to
-arch_only on OS/X.

Change 1 was documented as the single behavior of shobj-conf.patch in
section Special Build/Update Instructions.

I traced the changes to the following commits/versions/tickets:
1. 2ab306ac / 6.2.p4 / #14405 (ncurses instead of termcap)
2. aa992064 / 6.1 / #9523 (upgrade to 6.1)
3. aa992064 / 6.1 / #9523 (upgrade to 6.1)
4. e43db4fb / 6.0p2 / #7821 (FreeBSD 3.x and later use ELF)
5. 791f64ee / 6.2.p0 / #11882/#11881 (upgrade to 6.2 and OS/X 10.7)
This is a patch from macports:
https://trac.macports.org/browser/trunk/dports/devel/readline/files/patch-shobj-conf.diff?rev=77217

I think these are the reasons for the changes:
1. Use ncurses instead of termcap.
2. Seems unintended. Handling of Gentoo/FreeBSD was introduced
upstream and a comment about this was accepted, but code change
on next line was not.
3. As with change 2 I see no reason for change 3 here. Perhaps, the
numeric FreeBSD versions 4-9 were lost in merging patch and
changed upstream?
4. According to the ticket, objformat was temporarily introduced in
FreeBSD 3 to ease the transition from a.out to ELF. When this
disappeared again, it made sense to change the default to ELF for
freebsd[3-9]*|freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*
|dragonfly*, as these are mostly new, ELF-only, FreeBSD versions.
5. Build on newer OS/X versions.

Here is what I have done to these changes:
1. Moved to 0002-ltinfo.patch.
2. Discarded as I see no good reason.
3. Discarded as I see no good reason.
4. Discarded as this case became much more restricted, namely
freebsd3*|freebsdaout*. For the latter, with a.out in its name,
using ELF as the default makes no sense to me. Moreover ELF-based
FreeBSD 3 should probably have objformat anyway, so that the
default is not used. Hence I think it's better to follow upstream
here.
5. Used new patch from macports in 0001-macports.patch:
https://trac.macports.org/browser/trunk/dports/devel/readline/files/patch-shobj-conf.diff?rev=118664

=== readline-6.2.p4 (Volker Braun, 3 April 2013) ===
* Do not build static libraries
Expand Down
18 changes: 18 additions & 0 deletions build/pkgs/readline/patches/0001-macports.patch
@@ -0,0 +1,18 @@
--- old/support/shobj-conf 2014-02-23 19:06:29.000000000 -0700
+++ new/support/shobj-conf 2014-04-07 09:23:17.000000000 -0700
@@ -189,13 +189,13 @@
darwin[1-7].*)
SHOBJ_STATUS=unsupported
SHOBJ_LDFLAGS='-dynamic'
- SHLIB_XLDFLAGS='-arch_only `/usr/bin/arch` -install_name $(libdir)/`echo $@ | sed "s:\\..*::"`.$(SHLIB_MAJOR).$(SHLIB_LIBSUFF) -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
+ SHLIB_XLDFLAGS='-install_name $(libdir)/`echo $@ | sed "s:\\..*::"`.$(SHLIB_MAJOR).$(SHLIB_LIBSUFF) -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
;;
# Darwin 8 == Mac OS X 10.4; Mac OS X 10.N == Darwin N+4
*)
case "${host_os}" in
darwin[89]*|darwin1[012]*)
- SHOBJ_ARCHFLAGS='-arch_only `/usr/bin/arch`'
+ SHOBJ_ARCHFLAGS=
;;
*) # Mac OS X 10.9 (Mavericks) and later
SHOBJ_ARCHFLAGS=
24 changes: 24 additions & 0 deletions build/pkgs/readline/patches/0002-ltinfo.patch
@@ -0,0 +1,24 @@
--- src/support/shobj-conf 2014-02-24 03:06:29.000000000 +0100
+++ new/support/shobj-conf 2014-06-15 14:04:15.561786158 +0200
@@ -39,10 +39,10 @@
SHOBJ_LD=
SHOBJ_LDFLAGS=
SHOBJ_XLDFLAGS=
-SHOBJ_LIBS=
+SHOBJ_LIBS='-ltinfo'

SHLIB_XLDFLAGS=
-SHLIB_LIBS=
+SHLIB_LIBS='-ltinfo'

SHLIB_DOT='.'
SHLIB_LIBPREF='lib'
@@ -209,7 +209,7 @@
;;
esac

- SHLIB_LIBS='-lncurses' # see if -lcurses works on MacOS X 10.1
+ SHLIB_LIBS='-ltinfo -lncurses' # see if -lcurses works on MacOS X 10.1
;;

openbsd*|netbsd*|mirbsd*)
53 changes: 0 additions & 53 deletions build/pkgs/readline/patches/shobj-conf.patch

This file was deleted.

1 change: 1 addition & 0 deletions build/pkgs/readline/spkg-install
Expand Up @@ -92,6 +92,7 @@ case "$UNAME" in
OpenBSD)
# Untested. (David Kirkby, 11th November 2010)
# Extension changed from 6.1 to 6.2; still untested. (October 2011)
# Extension changed from 6.2 to 6.3; still untested. (June 2014)
DYLIB_NAME=libreadline.so.6.3;;
FreeBSD)
DYLIB_NAME=libreadline.so.6;;
Expand Down

0 comments on commit 1f85012

Please sign in to comment.