[72330] trunk/dports/devel/ncursesw

jmr at macports.org jmr at macports.org
Sun Oct 10 20:54:23 PDT 2010


Revision: 72330
          http://trac.macports.org/changeset/72330
Author:   jmr at macports.org
Date:     2010-10-10 20:54:21 -0700 (Sun, 10 Oct 2010)
Log Message:
-----------
ncursesw: apply patches from Apple (fixes #22046), and massively simplify portfile by not using muniversal, which also fixes building with some universal_archs that can't run on the build machine (#25350)

Modified Paths:
--------------
    trunk/dports/devel/ncursesw/Portfile

Added Paths:
-----------
    trunk/dports/devel/ncursesw/files/hex.diff
    trunk/dports/devel/ncursesw/files/include_curses.head.ed
    trunk/dports/devel/ncursesw/files/ungetch_guard.diff

Modified: trunk/dports/devel/ncursesw/Portfile
===================================================================
--- trunk/dports/devel/ncursesw/Portfile	2010-10-11 03:37:31 UTC (rev 72329)
+++ trunk/dports/devel/ncursesw/Portfile	2010-10-11 03:54:21 UTC (rev 72330)
@@ -1,10 +1,10 @@
 # $Id$
 
 PortSystem		1.0
-PortGroup               muniversal 1.0
 
 name			ncursesw
 version			5.7
+revision        1
 categories		devel
 platforms		darwin freebsd
 maintainers		jmr openmaintainer
@@ -25,6 +25,9 @@
 				sha1	8233ee56ed84ae05421e4e6d6db6c1fe72ee6797 \
 				rmd160	a19ca026d32255f5a4d22eb006d65182041e0234
 
+# from http://www.opensource.apple.com/source/ncurses/ncurses-27/patches/
+patchfiles      hex.diff ungetch_guard.diff
+
 configure.cppflags
 configure.ldflags
 configure.args	--enable-widec \
@@ -45,92 +48,13 @@
 }
 
 if {[variant_isset universal]} {
-	merger_arch_compiler yes
+    configure.args-append --with-chtype=int
 
-	pre-destroot {
-		global merger_dont_diff merger_destroot_env
-
-		# These tests must be done in pre-destroot to ensure universal_archs_to_use has the correct values.
-		if { [llength ${universal_archs_to_use}] > 2 } {
-			lappend merger_dont_diff ${prefix}/include/${name}/curses.h
-		}
-
-		# The destroot phase needs to run the just built tic program.
-		#     Setting the PATH variable allows tic to be found.
-		#     tic links against shared libraries, which are found only after setting DYLD_LIBRARY_PATH.
-		set need_cross  "no"
-		set have_run    "no"
-		if { ${os.arch}=="i386" } {
-			# Determine if any cross-compiling is required.
-			foreach arch ${universal_archs_to_use} {
-				if { ${arch}=="ppc64" || (${os.major} >= 10 && ${arch}=="ppc") } {
-					set need_cross "yes"
-				}
-			}
-
-			# Find an architecture whose binaries will run on this platform.
-			foreach arch ${universal_archs_to_use} {
-				if { ${arch}=="i386" || ${arch}=="x86_64" || (${os.major} < 10 && ${arch}=="ppc") } {
-					if { ${os.major} >= 10 } {
-						set merger_destroot_env(ppc)     "DYLD_LIBRARY_PATH=${worksrcpath}-${arch}/lib PATH=${worksrcpath}-${arch}/progs:$env(PATH)"
-					}
-					set merger_destroot_env(ppc64)    "DYLD_LIBRARY_PATH=${worksrcpath}-${arch}/lib PATH=${worksrcpath}-${arch}/progs:$env(PATH)"
-					set have_run  "yes"
-					break
-				}
-			}
-		} else {
-			# Determine if any cross-compiling is required
-			foreach arch ${universal_archs_to_use} {
-				if { ${arch}=="i386" || ${arch}=="x86_64" } {
-					set need_cross "yes"
-				}
-			}
-
-			# Find an architecture whose binaries will run on this platform.
-			foreach arch ${universal_archs_to_use} {
-				if { ${arch}=="ppc" || ${arch}=="ppc64" } {
-					set merger_destroot_env(i386)    "DYLD_LIBRARY_PATH=${worksrcpath}-${arch}/lib PATH=${worksrcpath}-${arch}/progs:$env(PATH)"
-					set merger_destroot_env(x86_64)  "DYLD_LIBRARY_PATH=${worksrcpath}-${arch}/lib PATH=${worksrcpath}-${arch}/progs:$env(PATH)"
-					set have_run  "yes"
-					break
-				}
-			}
-		}
-
-		if { ${need_cross}=="yes" && ${have_run}=="no" } {
-			return -code error "At least one of the universal_archs values must run on your host architecture."
-		}
+    # check that this doesn't start breaking anything with new versions
+	post-configure {
+	    reinplace s/1UL/1U/g "${worksrcpath}/include/curses.head"
+	    system "cd ${worksrcpath} && ed - include/curses.head < ${filespath}/include_curses.head.ed"
 	}
-
-	# When cross-compiling, force configure script to assume file system is the same on build and host architectures.
-	#     We can not use --enable-mixed-case=[yes,no] since HFS+ case sensitivity is not known.
-	patchfiles-append  patch-configure.diff
-
-	# Build process requires compiler and pre-processor to build binaries which run on build architecture.
-	lappend cross_configure_args  --with-build-cc='${configure.cc}'
-	lappend cross_configure_args  --with-build-cpp='${configure.cpp}'
-
-	# Unless, _XOPEN_SOURCE_EXTENDED is defined, include/curses.h will not include some system header files,
-	#     which in turn will cause problems with ncurses/curses.priv.h.
-	lappend cross_configure_args  --with-build-cppflags=-D_XOPEN_SOURCE_EXTENDED
-
-	# Configure script attempts to run a test program which allocates a chunk of memory and writes to it.
-	#     If cross-compiling, default does not assume the program would succeed (safest option).
-	lappend cross_configure_args  --enable-big-core
-
-	# For chtype, configure script chooses between int and long for smallest data type which can hold, up to version 5.7, 31 bits.
-	#     If sizeof(unsigned long)==sizeof(unsigned int), configure script chooses long.
-	# For booltype, configure script tries to find data type xxx with sizeof(bool)==sizeof(xxx).
-	if { ${os.arch}=="i386" } {
-		if { ${os.major} >= 10 } {
-			set merger_configure_args(ppc)   "${cross_configure_args} --with-chtype=long  --with-bool='unsigned int'"
-		}
-		set merger_configure_args(ppc64)   "${cross_configure_args} --with-chtype=int  --with-bool='unsigned char'"
-	} else {
-		set merger_configure_args(i386)    "${cross_configure_args} --with-chtype=long --with-bool='unsigned char'"
-		set merger_configure_args(x86_64)  "${cross_configure_args} --with-chtype=int  --with-bool='unsigned char'"
-	}
 }
 
 use_parallel_build	yes

Added: trunk/dports/devel/ncursesw/files/hex.diff
===================================================================
--- trunk/dports/devel/ncursesw/files/hex.diff	                        (rev 0)
+++ trunk/dports/devel/ncursesw/files/hex.diff	2010-10-11 03:54:21 UTC (rev 72330)
@@ -0,0 +1,21 @@
+diff -Nru ./misc/terminfo.src ../ncurses-5.4+hex/misc/terminfo.src
+--- ./misc/terminfo.src	2004-01-17 17:37:18.000000000 -0800
++++ ../ncurses-5.4+hex/misc/terminfo.src	2004-11-27 15:10:30.000000000 -0800
+@@ -5754,7 +5754,7 @@
+ # hp2621 with function labels. Most of the time they are off,
+ # but inside vi, the function key labels appear. You have to
+ # hold down shift to get them to xmit.
+-hp2621|hp2621a|hp2621A|2621|2621a|2621A|hp2621-wl|2621-wl|hp 2621 w/labels,
++hp2621|hp2621a|2621|2621a|hp2621-wl|2621-wl|hp 2621 w/labels,
+ 	is2=\E&jA\r, rmkx=\E&jA, use=hp2621-fl,
+ hp2621-fl|hp 2621,
+ 	xhp@, xon,
+@@ -6247,7 +6247,7 @@
+ 	ri=\Ej, rmir=\Er, rmso=\EG0$<10/>, rmul=\EG0$<10/>,
+ 	sgr0=\EG0$<10/>, smir=\Eq, smso=\EG4$<10/>,
+ 	smul=\EG8$<10/>, tbc=\E0, vpa=\E[%p1%{32}%+%c,
+-hp70092|hp70092a|hp70092A|HP 700/92,
++hp70092|hp70092a|HP 700/92,
+ 	am, da, db, xhp,
+ 	cols#80, lh#2, lines#24, lm#0, lw#8, nlab#8,
+ 	acsc=0cjgktlrmfn/q\,t5u6v8w7x., bel=^G, blink=\E&dA,

Added: trunk/dports/devel/ncursesw/files/include_curses.head.ed
===================================================================
--- trunk/dports/devel/ncursesw/files/include_curses.head.ed	                        (rev 0)
+++ trunk/dports/devel/ncursesw/files/include_curses.head.ed	2010-10-11 03:54:21 UTC (rev 72330)
@@ -0,0 +1,8 @@
+/typedef.*NCURSES_BOOL;/c
+#if defined(__LP64__) || !defined(__POWERPC__)
+typedef unsigned char NCURSES_BOOL;
+#else
+typedef unsigned int NCURSES_BOOL;
+#endif
+.
+w

Added: trunk/dports/devel/ncursesw/files/ungetch_guard.diff
===================================================================
--- trunk/dports/devel/ncursesw/files/ungetch_guard.diff	                        (rev 0)
+++ trunk/dports/devel/ncursesw/files/ungetch_guard.diff	2010-10-11 03:54:21 UTC (rev 72330)
@@ -0,0 +1,13 @@
+--- ncurses/base/lib_ungetch.c	2002-08-24 15:08:48.000000000 -0700
++++ ncurses/base/lib_ungetch.c	2008-03-25 13:49:35.000000000 -0700
+@@ -61,6 +61,10 @@
+ {
+     int rc = ERR;
+ 
++    if (!sp) {
++	    returnCode(ERR);
++    }
++
+     if (tail != -1) {
+ 	if (head == -1) {
+ 	    head = 0;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20101010/3c6b4a4c/attachment.html>


More information about the macports-changes mailing list