[75884] trunk/dports/devel/nu

ryandesign at macports.org ryandesign at macports.org
Fri Feb 11 15:45:22 PST 2011


Revision: 75884
          http://trac.macports.org/changeset/75884
Author:   ryandesign at macports.org
Date:     2011-02-11 15:45:20 -0800 (Fri, 11 Feb 2011)
Log Message:
-----------
nu: update to 0.4.0 (fixes build failure reported in #24013); now use MacPorts libffi and libedit; dynamically link to pcre; ensure we're UsingTheRightCompiler and arch and sdk; indicate license

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

Added Paths:
-----------
    trunk/dports/devel/nu/files/patch-Makefile.diff
    trunk/dports/devel/nu/files/patch-Nukefile.diff

Removed Paths:
-------------
    trunk/dports/devel/nu/files/patch-Nukefile
    trunk/dports/devel/nu/files/patch-libffi-single-arch

Modified: trunk/dports/devel/nu/Portfile
===================================================================
--- trunk/dports/devel/nu/Portfile	2011-02-11 23:07:51 UTC (rev 75883)
+++ trunk/dports/devel/nu/Portfile	2011-02-11 23:45:20 UTC (rev 75884)
@@ -3,9 +3,11 @@
 PortSystem 1.0
 
 name                nu
-version             0.3.3
+version             0.4.0
 categories          devel
 maintainers         nomaintainer
+license             Apache-2.0
+
 description         Nu is an interpreted object-oriented lisp-like language written in Objective-C.
 long_description    \
     Nu is an interpreted object-oriented language. \
@@ -21,14 +23,18 @@
 distname            Nu-${version}
 extract.suffix      .tgz
 
-checksums           md5 45eabf715d3c09b41b5b07c9c93c0a7e \
-                    sha1 c00a2bbc039c438eeb0b16abf4a5f4379a3c48ff
+checksums           sha1    02e0df424f18a6c6c3c3221699014018cabcd8bc \
+                    rmd160  31aa22c7a4dddd1135a55f6bdaf27b1f485ded43
 
-patchfiles          patch-libffi-single-arch patch-Nukefile
+patchfiles          patch-Makefile.diff patch-Nukefile.diff
 
-depends_build       port:pcre bin:rake:rb-rake
+depends_build       port:pkgconfig
 
+depends_lib         port:libffi port:pcre port:libedit
+
 use_configure       no
+variant universal {}
+
 test.run            yes
 test.cmd            nuke
 
@@ -36,36 +42,32 @@
 livecheck.url       http://programming.nu/downloads
 livecheck.regex     {Nu-([\d.]+).tgz}
 
-variant universal {
-    patchfiles-delete patch-libffi-single-arch
-    patchfiles-delete patch-Nukefile
-}
-
 post-patch {
-    # fix the tools
-    reinplace s|/usr/local|$prefix| ${worksrcpath}/tools/nubile
-    
-    # fix the examples
-    reinplace s|/usr/local|$prefix| ${worksrcpath}/examples/NuAnywhere/nu-anywhere
+    if {[variant_isset universal]} {
+        set archs ${configure.universal_archs}
+    } else {
+        set archs ${configure.build_arch}
+    }
+    reinplace "s|@ARCHS@|[join ${archs} {" "}]|g" ${worksrcpath}/Nukefile
+    reinplace "s|@CC@|${configure.cc}|g" ${worksrcpath}/Nukefile
+    reinplace "s|@SDKROOT@|${configure.sdkroot}|g" ${worksrcpath}/Nukefile
+    reinplace "s|/usr/local|${prefix}|g" \
+        ${worksrcpath}/tools/nubile \
+        ${worksrcpath}/examples/NuAnywhere/nu-anywhere
 }
 
 pre-build {
-    if {${os.platform} == "darwin" && ${os.major} == 8} {
-        ui_info "$UI_PREFIX Building libffi"
-        system "cd ${worksrcpath}/libffi && rake"
-    }
+    system "cd ${worksrcpath} && make PREFIX=${prefix} CC=${configure.cc}"
 }
 
-build {
-    system "cd ${worksrcpath} && PREFIX=${prefix} rake"
-    system "cd ${worksrcpath} && PREFIX=${prefix} ./mininush tools/nuke"
-}
+build.cmd           "./mininush tools/nuke"
+build.target
+build.env           PREFIX=${prefix}
 
 pre-destroot {
     file mkdir ${destroot}/Library/Frameworks
 }
 
-destroot.cmd        "./mininush tools/nuke"
-destroot.destdir    ""
-destroot.env-append PREFIX=${prefix}
-destroot.env-append DESTDIR=${destroot}
+destroot.destdir
+destroot.env-append PREFIX=${prefix} \
+                    DESTDIR=${destroot}

Added: trunk/dports/devel/nu/files/patch-Makefile.diff
===================================================================
--- trunk/dports/devel/nu/files/patch-Makefile.diff	                        (rev 0)
+++ trunk/dports/devel/nu/files/patch-Makefile.diff	2011-02-11 23:45:20 UTC (rev 75884)
@@ -0,0 +1,30 @@
+--- Makefile.orig	2009-11-17 19:12:00.000000000 -0600
++++ Makefile	2011-02-11 15:06:37.000000000 -0600
+@@ -9,23 +9,16 @@
+ PREFIX ?= /usr/local
+ 
+ ifeq ($(SYSTEM), Darwin)
+-	ifeq ($(shell test -e /usr/lib/libffi.dylib && echo yes), yes)
+-		# Use the libffi that ships with OS X.
+-		FFI_LIB = -L/usr/lib -lffi
+-		FFI_INCLUDE = -I/usr/include/ffi
++	ifeq ($(shell test -e /Developer/SDKs/MacOSX10.5.sdk && echo yes), yes)
+ 		LEOPARD_CFLAGS = -DLEOPARD_OBJC2
+ 	else
+-		# Use the libffi that is distributed with Nu.
+-		FFI_LIB = -L./libffi -lffi
+-		FFI_INCLUDE = -I./libffi/include
+ 		LEOPARD_CFLAGS =
+ 	endif
+-
+-else # Linux
+-	FFI_LIB=-lffi
+-	FFI_INCLUDE=
+ endif
+ 
++FFI_LIB := $(shell pkg-config libffi --libs)
++FFI_INCLUDE := $(shell pkg-config libffi --cflags)
++
+ INCLUDES = $(FFI_INCLUDE) -I./include
+ 
+ ifeq ($(SYSTEM), Darwin)

Deleted: trunk/dports/devel/nu/files/patch-Nukefile
===================================================================
--- trunk/dports/devel/nu/files/patch-Nukefile	2011-02-11 23:07:51 UTC (rev 75883)
+++ trunk/dports/devel/nu/files/patch-Nukefile	2011-02-11 23:45:20 UTC (rev 75884)
@@ -1,11 +0,0 @@
---- Nukefile.old	2009-04-03 21:30:32.000000000 -0700
-+++ Nukefile	2009-04-03 21:36:20.000000000 -0700
-@@ -92,7 +92,7 @@
-          (then (set @arch '("ppc" "i386")))) ;; build a universal binary
- 
- ;; or set this to just build for your chosen platform
--;; (set @arch '("i386"))
-+(set @arch nil)
- 
- (ifDarwin
-          (then (set @ldflags

Copied: trunk/dports/devel/nu/files/patch-Nukefile.diff (from rev 75873, trunk/dports/devel/nu/files/patch-Nukefile)
===================================================================
--- trunk/dports/devel/nu/files/patch-Nukefile.diff	                        (rev 0)
+++ trunk/dports/devel/nu/files/patch-Nukefile.diff	2011-02-11 23:45:20 UTC (rev 75884)
@@ -0,0 +1,64 @@
+--- Nukefile.orig	2011-02-11 14:53:39.000000000 -0600
++++ Nukefile	2011-02-11 15:04:28.000000000 -0600
+@@ -52,14 +52,6 @@
+ (if (NSFileManager directoryExistsNamed:"#{@prefix}/include") (@inc_dirs addObject:"#{@prefix}/include"))
+ (if (NSFileManager directoryExistsNamed:"#{@prefix}/lib") (@lib_dirs addObject:"#{@prefix}/lib"))
+ 
+-(ifDarwin
+-         (then (if (NSFileManager fileExistsNamed:"/usr/lib/libffi.dylib")
+-                   (then ;; Use the libffi that ships with OS X.
+-                         (@inc_dirs addObject:"/usr/include/ffi"))
+-                   (else ;; Use the libffi that is distributed with Nu.
+-                         (@inc_dirs addObject:"./libffi/include")
+-                         (@lib_dirs addObject:"./libffi")))))
+-
+ (set @pcre_prefix "")
+ (let ((pcre_config ((NSString stringWithShellCommand:"which pcre-config 2>/dev/null") chomp)))
+      (if pcre_config
+@@ -78,18 +70,11 @@
+ (set @dylib "libNu")
+ 
+ ;; build configuration
+-(set @cc "gcc")
+-(set @leopard "")
+-(set @sdk
+-     (cond ((NSFileManager directoryExistsNamed:"/Developer/SDKs/MacOSX10.6.sdk")
+-            (set @leopard "-DLEOPARD_OBJC2 -D__OBJC2__")
+-            ("-isysroot /Developer/SDKs/MacOSX10.6.sdk"))
+-           ((NSFileManager directoryExistsNamed:"/Developer/SDKs/MacOSX10.5.sdk")
+-            (set @leopard "-DLEOPARD_OBJC2 -D__OBJC2__")
+-            ("-isysroot /Developer/SDKs/MacOSX10.5.sdk"))
+-           ((NSFileManager directoryExistsNamed:"/Developer/SDKs/MacOSX10.4u.sdk")
+-            ("-isysroot /Developer/SDKs/MacOSX10.4u.sdk"))
+-           (else "")))
++(set @cc "@CC@")
++(if (NSFileManager directoryExistsNamed:"/Developer/SDKs/MacOSX10.5.sdk")
++    (then (set @leopard "-DLEOPARD_OBJC2 -D__OBJC2__"))
++    (else (set @leopard "")))
++(set @sdk "@SDKROOT@")
+ 
+ (ifDarwin
+          (then (set @cflags "-Wall -g -O2 -DDARWIN -DMACOSX #{@sdk} #{@leopard} -std=gnu99")
+@@ -99,7 +84,7 @@
+                (set @mflags ((NSString stringWithShellCommand:"gnustep-config --objc-flags") chomp))))
+ 
+ (ifDarwin
+-         (then (set @arch '("ppc" "i386")))) ;; build a universal binary
++         (then (set @arch '("@ARCHS@")))) ;; build a universal binary
+ ;; or set this to just build for your chosen platform
+ ;;(set @arch '("i386"))
+ 
+@@ -107,12 +92,7 @@
+      ((@inc_dirs map: (do (inc) " -I#{inc}")) join))
+ (set @ldflags
+      ((list
+-           (cond  ;; statically link in pcre since most people won't have it..
+-(t nil)
+-                  ((NSFileManager fileExistsNamed:"#{@pcre_prefix}/lib/libpcre.a") "#{@pcre_prefix}/lib/libpcre.a")
+-                  ((NSFileManager fileExistsNamed:"/usr/lib/libpcre.a") "/usr/lib/libpcre.a")
+-                  ((NSFileManager fileExistsNamed:"#{@prefix}/lib/libpcre.a") "#{@prefix}/lib/libpcre.a")
+-                  (else (NSException raise:"NukeBuildError" format:"Can't find static pcre library (libpcre.a).")))
++           ("#{@pcre_prefix}/lib/libpcre.dylib")
+            ((@frameworks map: (do (framework) " -framework #{framework}")) join)
+            ((@libs map: (do (lib) " -l#{lib}")) join)
+            (ifDarwin

Deleted: trunk/dports/devel/nu/files/patch-libffi-single-arch
===================================================================
--- trunk/dports/devel/nu/files/patch-libffi-single-arch	2011-02-11 23:07:51 UTC (rev 75883)
+++ trunk/dports/devel/nu/files/patch-libffi-single-arch	2011-02-11 23:45:20 UTC (rev 75884)
@@ -1,11 +0,0 @@
---- libffi/Rakefile.old	2007-10-01 06:52:29.000000000 -0400
-+++ libffi/Rakefile	2007-10-01 06:52:37.000000000 -0400
-@@ -17,7 +17,7 @@
- 
- @cc = "gcc"
- 
-- at arch = "-arch i386 -arch ppc"
-+ at arch = ""
- 
- @cflags = "-g -O3 -Wall -DMACOSX -Iinclude -I. -Isrc"
- 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110211/c9d1ad08/attachment-0001.html>


More information about the macports-changes mailing list