[73460] trunk/dports/devel/jam

michaelld at macports.org michaelld at macports.org
Sat Nov 13 18:27:22 PST 2010


Revision: 73460
          http://trac.macports.org/changeset/73460
Author:   michaelld at macports.org
Date:     2010-11-13 18:27:18 -0800 (Sat, 13 Nov 2010)
Log Message:
-----------
jam changes:
* add universal variant that works;
* tweaks to reduce Portfile complexity.

Modified Paths:
--------------
    trunk/dports/devel/jam/Portfile
    trunk/dports/devel/jam/files/patch-Makefile.diff

Removed Paths:
-------------
    trunk/dports/devel/jam/files/patch-Makefile-debug.diff
    trunk/dports/devel/jam/files/patch-Makefile-mw.diff

Modified: trunk/dports/devel/jam/Portfile
===================================================================
--- trunk/dports/devel/jam/Portfile	2010-11-14 02:13:59 UTC (rev 73459)
+++ trunk/dports/devel/jam/Portfile	2010-11-14 02:27:18 UTC (rev 73460)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
 # $Id$
 
 PortSystem			1.0
@@ -4,7 +5,7 @@
 name				jam
 version				2.5
 # The version didn't change, but the binary did because it was upgraded from rc3 to 2.5.
-revision			1
+revision			2
 categories			devel
 maintainers			nomaintainer
 description			a software build tool like make
@@ -25,48 +26,77 @@
 					rmd160 34497c89ca4bbd1db049627e2dfcc1287138af24
 platforms			darwin
 
+universal_variant   yes
+
 # This is a .tar file.
 extract.cmd			tar -xf 
 extract.pre_args	
 extract.post_args	
 
-# Enables optimization & Matt Armstrong memory leak patch.
+# Enables post-patch options & Matt Armstrong memory leak patch.
 patchfiles			patch-Makefile.diff \
 					patch-variable.c.diff
 
+post-patch {
+    # fix up reminder of Makefile, depending on variants
+    set EXTRA ""
+    set CFLAGS "-O3"
+    if {[variant_isset debug]} {
+        set CFLAGS "-O0"
+        set EXTRA "-sDEBUG=1"
+    } elseif {[variant_isset mw]} {
+        set CFLAGS "-opt all"
+        set EXTRA "-sCC=mwccppc"
+    }
+    reinplace "s|@CFLAGS@|${CFLAGS}|g" ${worksrcpath}/Makefile
+    reinplace "s|@EXTRA@|${EXTRA}|g" ${worksrcpath}/Makefile
+
+    # fix up Jamfile to always install to the same directory, no
+    # matter if debug or regular build
+    reinplace "s@/g@@g" ${worksrcpath}/Jamfile
+}
+
 # Jam doesn't have a configure script
-use_configure		no
+use_configure no
 
+pre-build {
+    # set archflags into CFLAGS for compiling
+    set CFLAGS ${configure.cc_archflags}
+    if {[variant_isset universal]} {
+        set CFLAGS [join ${configure.universal_archs} " -arch "]
+        set CFLAGS "-arch ${CFLAGS}"
+    }
+    build.cmd CFLAGS=\"${CFLAGS}\" ${build.cmd}
+}
+
 # Installation.
 destroot {
-	file mkdir ${destroot}${prefix}/share/doc/${name}
-	system "install -m 755 ${worksrcpath}/bin.*/jam ${destroot}${prefix}/bin/"
-	system "install -m 755 ${worksrcpath}/bin.*/mkjambase ${destroot}${prefix}/bin/"
-	xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}/
-	xinstall -m 644 ${worksrcpath}/Jam.html ${destroot}${prefix}/share/doc/${name}/
-	xinstall -m 644 ${worksrcpath}/Jambase.html ${destroot}${prefix}/share/doc/${name}/
-	xinstall -m 644 ${worksrcpath}/Jamfile.html ${destroot}${prefix}/share/doc/${name}/
-}
+    # retrieve directory name where files are installed
+    # (there is only 1 with the name "bin*")
+    set bindir [exec find ${worksrcpath} -name "bin*"]
 
-variant mw description {Use Metrowerks compiler} {
-	patchfiles			patch-Makefile-mw.diff \
-						patch-variable.c.diff
-}
+    # install binaries
+    xinstall -d -m 755 ${destroot}${prefix}/bin
+    xinstall -m 755 ${bindir}/jam ${destroot}${prefix}/bin
+    xinstall -m 755 ${bindir}/mkjambase ${destroot}${prefix}/bin
 
-variant debug description {Build with no optimization and debug options} {
-	patchfiles			patch-Makefile-debug.diff \
-						patch-variable.c.diff
+    # install library
+    xinstall -d -m 755 ${destroot}${prefix}/lib
+    xinstall -m 644 ${bindir}/libjam.a ${destroot}${prefix}/lib
 
-	destroot {
-		file mkdir ${destroot}${prefix}/share/doc/${name}
-		system "install -m 755 ${worksrcpath}/bin.*/g/jam ${destroot}${prefix}/bin/"
-		system "install -m 755 ${worksrcpath}/bin.*/g/mkjambase ${destroot}${prefix}/bin/"
-		xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}/
-		xinstall -m 644 ${worksrcpath}/Jambase.html ${destroot}${prefix}/share/doc/${name}/
-		xinstall -m 644 ${worksrcpath}/Jamfile.html ${destroot}${prefix}/share/doc/${name}/
-	}
+    # install documents
+	xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
+    xinstall -m 644 -W ${worksrcpath} \
+        Jam.html Jambase.html Jamfile.html README RELNOTES \
+        ${destroot}${prefix}/share/doc/${name}
 }
 
+variant mw conflicts debug \
+description {Use Metrowerks compiler} {}
+
+variant debug conflicts mw \
+description {Build with debug options but no optimization} {}
+
 livecheck.type	md5
 livecheck.url	ftp://ftp.perforce.com/jam/
 livecheck.md5	37e6a5b6516a680c7178b72021d3b706

Deleted: trunk/dports/devel/jam/files/patch-Makefile-debug.diff
===================================================================
--- trunk/dports/devel/jam/files/patch-Makefile-debug.diff	2010-11-14 02:13:59 UTC (rev 73459)
+++ trunk/dports/devel/jam/files/patch-Makefile-debug.diff	2010-11-14 02:27:18 UTC (rev 73460)
@@ -1,11 +0,0 @@
---- Makefile	Wed Apr 23 06:45:50 2003
-+++ Makefile.new	Mon Jun 16 12:00:19 2003
-@@ -59,7 +59,7 @@
- 	rules.c scan.c search.c timestamp.c variable.c
- 
- all: $(EXENAME)
--	$(EXENAME)
-+	$(EXENAME) -sCCFLAGS=-O0 -sDEBUG=1
- 
- $(EXENAME):
- 	$(CC) $(TARGET) $(CFLAGS) $(SOURCES) $(LINKLIBS)

Deleted: trunk/dports/devel/jam/files/patch-Makefile-mw.diff
===================================================================
--- trunk/dports/devel/jam/files/patch-Makefile-mw.diff	2010-11-14 02:13:59 UTC (rev 73459)
+++ trunk/dports/devel/jam/files/patch-Makefile-mw.diff	2010-11-14 02:27:18 UTC (rev 73460)
@@ -1,11 +0,0 @@
---- Makefile	Wed Apr 23 06:45:50 2003
-+++ Makefile.new	Mon Jun 16 12:00:19 2003
-@@ -59,7 +59,7 @@
- 	rules.c scan.c search.c timestamp.c variable.c
- 
- all: $(EXENAME)
--	$(EXENAME)
-+	$(EXENAME) -sCCFLAGS="-opt all" -sCC=mwccppc
- 
- $(EXENAME):
- 	$(CC) $(TARGET) $(CFLAGS) $(SOURCES) $(LINKLIBS)

Modified: trunk/dports/devel/jam/files/patch-Makefile.diff
===================================================================
--- trunk/dports/devel/jam/files/patch-Makefile.diff	2010-11-14 02:13:59 UTC (rev 73459)
+++ trunk/dports/devel/jam/files/patch-Makefile.diff	2010-11-14 02:27:18 UTC (rev 73460)
@@ -1,11 +1,20 @@
---- Makefile	Wed Apr 23 06:45:50 2003
-+++ Makefile.new	Mon Jun 16 12:00:19 2003
+--- Makefile.orig	2010-11-13 20:47:18.000000000 -0500
++++ Makefile	2010-11-13 20:47:45.000000000 -0500
+@@ -1,7 +1,7 @@
+ # Makefile for jam
+ 
+ CC = cc
+-CFLAGS =
++#CFLAGS =
+ EXENAME = ./jam0
+ TARGET = -o $(EXENAME)
+ 
 @@ -59,7 +59,7 @@
  	rules.c scan.c search.c timestamp.c variable.c
  
  all: $(EXENAME)
 -	$(EXENAME)
-+	$(EXENAME) -sCCFLAGS=-O3
++	$(EXENAME) -sCCFLAGS="@CFLAGS@ $(CFLAGS)" @EXTRA@
  
  $(EXENAME):
  	$(CC) $(TARGET) $(CFLAGS) $(SOURCES) $(LINKLIBS)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20101113/43cd8dd7/attachment.html>


More information about the macports-changes mailing list