Skip to content

Instantly share code, notes, and snippets.

@nobu
Created August 29, 2009 01:09
Show Gist options
  • Save nobu/177348 to your computer and use it in GitHub Desktop.
Save nobu/177348 to your computer and use it in GitHub Desktop.
fix for MacPorts readline-5 on darwin 9 or later
diff -ru readline-5.orig/Portfile readline-5/Portfile
--- readline-5.orig/Portfile 2007-10-23 07:49:14.000000000 +0900
+++ readline-5/Portfile 2009-08-29 10:07:34.000000000 +0900
@@ -1,10 +1,13 @@
# $Id: Portfile 30224 2007-10-22 22:49:14Z [email protected] $
PortSystem 1.0
-name readline-5
set shortname readline
-version 5.0.005
-distname ${shortname}-5.0
+set major 5
+set minor 0
+set patchlevel 005
+name ${shortname}-${major}
+version ${major}.${minor}.${patchlevel}
+distname ${shortname}-${major}.${minor}
categories devel
maintainers nomaintainer
platforms darwin
@@ -29,14 +32,18 @@
master_sites gnu:${shortname} \
ftp://ftp.cwru.edu/pub/bash/:${shortname}
-patch_sites ftp://ftp.cwru.edu/pub/bash/readline-5.0-patches/
+patch_sites ftp://ftp.cwru.edu/pub/bash/readline-${major}.${minor}-patches/
patchfiles readline50-001 \
readline50-002 \
readline50-003 \
readline50-004 \
readline50-005
-platform darwin 8 { patchfiles-append patch-shobj-conf }
+post-patch {
+ reinplace "s|__MACPORTS_PATCHLEVEL__|${patchlevel}|" ${worksrcpath}/support/shobj-conf
+}
+
+platform darwin { patchfiles-append patch-shobj-conf }
checksums ${distname}${extract.suffix} md5 9a39d15f1ed592883f8c6671e8c13120 \
readline50-001 md5 5b47ed61b6b8413746750127c70e843d \
@@ -52,11 +59,11 @@
file delete ${destroot}${prefix}/lib/libhistory.a
file delete ${destroot}${prefix}/lib/libhistory.dylib
- file delete ${destroot}${prefix}/lib/libhistory.5.dylib
+ # file delete ${destroot}${prefix}/lib/libhistory.5.dylib
file delete ${destroot}${prefix}/lib/libreadline.a
file delete ${destroot}${prefix}/lib/libreadline.dylib
- file delete ${destroot}${prefix}/lib/libreadline.5.dylib
+ # file delete ${destroot}${prefix}/lib/libreadline.5.dylib
file rename ${destroot}${prefix}/include/readline ${destroot}${prefix}/include/readline5
}
diff -ru readline-5.orig/files/patch-shobj-conf readline-5/files/patch-shobj-conf
--- readline-5.orig/files/patch-shobj-conf 2007-01-26 11:39:47.000000000 +0900
+++ readline-5/files/patch-shobj-conf 2009-08-29 10:08:15.000000000 +0900
@@ -1,12 +1,17 @@
---- support/shobj-conf.sav 2006-05-30 06:45:41.000000000 -0400
-+++ support/shobj-conf 2006-05-30 06:46:30.000000000 -0400
-@@ -149,6 +149,9 @@
- darwin7*) SHOBJ_LDFLAGS=''
- SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
+--- support/shobj-conf.orig 2009-08-29 09:41:06.000000000 +0900
++++ support/shobj-conf 2009-08-29 09:52:42.000000000 +0900
+@@ -146,11 +146,11 @@
+ SHLIB_LIBSUFF='dylib'
+
+ case "${host_os}" in
+- darwin7*) SHOBJ_LDFLAGS=''
+- SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
++ darwin[7-9]*|darwin10*) SHOBJ_LDFLAGS=''
++ SHLIB_XLDFLAGS='-dynamiclib -install_name $(libdir)/${@:$(SHLIB_MAJOR)$(SHLIB_MINOR).$(SHLIB_LIBSUFF)=$(SHLIB_MAJOR).$(SHLIB_LIBSUFF)} -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR)__MACPORTS_PATCHLEVEL__ -compatibility_version $(SHLIB_MAJOR) -v'
;;
-+ darwin8*) SHOBJ_LDFLAGS=''
-+ SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
-+ ;;
*) SHOBJ_LDFLAGS='-dynamic'
- SHLIB_XLDFLAGS='-arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
+- SHLIB_XLDFLAGS='-arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
++ SHLIB_XLDFLAGS='-install_name $(libdir)/${@:$(SHLIB_MAJOR)$(SHLIB_MINOR).$(SHLIB_LIBSUFF)=$(SHLIB_MAJOR).$(SHLIB_LIBSUFF)} -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR)__MACPORTS_PATCHLEVEL__ -compatibility_version $(SHLIB_MAJOR) -v'
;;
+ esac
+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment