Index: files/patch-frameworks-dir.diff
===================================================================
--- files/patch-frameworks-dir.diff	(révision 0)
+++ files/patch-frameworks-dir.diff	(révision 0)
@@ -0,0 +1,11 @@
+--- AquaTerm.xcodeproj/project.pbxproj.orig	2008-11-19 15:21:16.000000000 +0100
++++ AquaTerm.xcodeproj/project.pbxproj	2008-11-19 15:28:51.000000000 +0100
+@@ -792,7 +792,7 @@
+ 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ 				GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
+ 				INFOPLIST_FILE = "AquaTerm.framework-Info.plist";
+-				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
++				INSTALL_PATH = "$(FRAMEWORKS_DIR)";
+ 				MACOSX_DEPLOYMENT_TARGET = 10.1;
+ 				OTHER_CFLAGS = "";
+ 				OTHER_LDFLAGS = (
Index: files/patch-disable-universal.diff
===================================================================
--- files/patch-disable-universal.diff	(révision 0)
+++ files/patch-disable-universal.diff	(révision 0)
@@ -0,0 +1,90 @@
+--- AquaTerm.xcodeproj/project.pbxproj.orig	2008-11-16 20:16:34.000000000 +0100
++++ AquaTerm.xcodeproj/project.pbxproj	2008-11-16 20:17:02.000000000 +0100
+@@ -740,10 +740,6 @@
+ 		CB699C7E08953AAD00C4B248 /* Development */ = {
+ 			isa = XCBuildConfiguration;
+ 			buildSettings = {
+-				ARCHS = (
+-					ppc,
+-					i386,
+-				);
+ 				COPY_PHASE_STRIP = NO;
+ 				DYLIB_COMPATIBILITY_VERSION = 1;
+ 				DYLIB_CURRENT_VERSION = 1;
+@@ -780,10 +776,6 @@
+ 		CB699C7F08953AAD00C4B248 /* Deployment */ = {
+ 			isa = XCBuildConfiguration;
+ 			buildSettings = {
+-				ARCHS = (
+-					ppc,
+-					i386,
+-				);
+ 				COPY_PHASE_STRIP = NO;
+ 				DYLIB_COMPATIBILITY_VERSION = 1;
+ 				DYLIB_CURRENT_VERSION = 1;
+@@ -816,10 +808,6 @@
+ 		CB699C8008953AAD00C4B248 /* BuildStyle */ = {
+ 			isa = XCBuildConfiguration;
+ 			buildSettings = {
+-				ARCHS = (
+-					ppc,
+-					i386,
+-				);
+ 				DYLIB_COMPATIBILITY_VERSION = 1;
+ 				DYLIB_CURRENT_VERSION = 1;
+ 				FRAMEWORK_VERSION = A;
+@@ -849,10 +837,6 @@
+ 		CB699C8108953AAD00C4B248 /* Default */ = {
+ 			isa = XCBuildConfiguration;
+ 			buildSettings = {
+-				ARCHS = (
+-					ppc,
+-					i386,
+-				);
+ 				DYLIB_COMPATIBILITY_VERSION = 1;
+ 				DYLIB_CURRENT_VERSION = 1;
+ 				FRAMEWORK_VERSION = A;
+@@ -882,10 +866,6 @@
+ 		CB699C8308953AAD00C4B248 /* Development */ = {
+ 			isa = XCBuildConfiguration;
+ 			buildSettings = {
+-				ARCHS = (
+-					ppc,
+-					i386,
+-				);
+ 				BUILD_VARIANTS = normal;
+ 				COPY_PHASE_STRIP = NO;
+ 				DEPLOYMENT_POSTPROCESSING = NO;
+@@ -924,10 +904,6 @@
+ 		CB699C8408953AAD00C4B248 /* Deployment */ = {
+ 			isa = XCBuildConfiguration;
+ 			buildSettings = {
+-				ARCHS = (
+-					ppc,
+-					i386,
+-				);
+ 				BUILD_VARIANTS = normal;
+ 				COPY_PHASE_STRIP = NO;
+ 				DEPLOYMENT_POSTPROCESSING = NO;
+@@ -963,10 +939,6 @@
+ 		CB699C8508953AAD00C4B248 /* BuildStyle */ = {
+ 			isa = XCBuildConfiguration;
+ 			buildSettings = {
+-				ARCHS = (
+-					ppc,
+-					i386,
+-				);
+ 				BUILD_VARIANTS = normal;
+ 				DEPLOYMENT_POSTPROCESSING = NO;
+ 				FRAMEWORK_SEARCH_PATHS = /Volumes/Ior/Source/aquaterm/build;
+@@ -999,10 +971,6 @@
+ 		CB699C8608953AAD00C4B248 /* Default */ = {
+ 			isa = XCBuildConfiguration;
+ 			buildSettings = {
+-				ARCHS = (
+-					ppc,
+-					i386,
+-				);
+ 				BUILD_VARIANTS = normal;
+ 				DEPLOYMENT_POSTPROCESSING = NO;
+ 				FRAMEWORK_SEARCH_PATHS = /Volumes/Ior/Source/aquaterm/build;
Index: Portfile
===================================================================
--- Portfile	(révision 42337)
+++ Portfile	(copie de travail)
@@ -1,108 +1,50 @@
 # $Id$
 
 PortSystem		1.0
+PortGroup		xcode 1.0
 
 name			aquaterm
 version			1.0.1
+revision		1
 categories		aqua math science
 maintainers		davidm@astro.berkeley.edu
 description		AquaTerm is a viewer that displays vector graphics on Mac OS X
 long_description	AquaTerm is a viewer app that displays vector \
 					graphics.  Other apps connect to AquaTerm using a \
 					simple remote object messaging protocol.  By adding \
-					"adapters" to legacy code very little coding is \
+					\"adapters\" to legacy code very little coding is \
 					needed to bring it to OS X.
 platforms		darwin
 homepage		http://aquaterm.sourceforge.net/
 master_sites	sourceforge
 distname		${name}_src.${version}
-checksums		md5 aquaterm_src.1.0.1.tar.gz e9d3ecdfe770d6f09a748add9886d1a9 \
-				sha1 aquaterm_src.1.0.1.tar.gz d5770bb3a95cfae21c5c39c96171a52d9af8ae24 \
-				rmd160 aquaterm_src.1.0.1.tar.gz 24410589dd8c3071b6e0d5e652b7d92933d86b5f
-worksrcdir		.
 
-patch {
-	# Change default location of AquaTerm.app to avoid requiring the
-	# use of AQUATERM_PATH.
-	reinplace "s|AquaTerm.app|MacPorts/AquaTerm.app|g" \
-		${workpath}/aquaterm/AQTClientManager.m
-}
+checksums		md5 e9d3ecdfe770d6f09a748add9886d1a9 \
+				sha1 d5770bb3a95cfae21c5c39c96171a52d9af8ae24 \
+				rmd160 24410589dd8c3071b6e0d5e652b7d92933d86b5f
 
-configure {
-	reinplace "s|/Users/per/Documents/Source/aquaterm/||" \
-		${workpath}/${name}/AquaTerm.pbproj/project.pbxproj
-	reinplace "s|/tmp/AquaTerm.dst||" \
-		${workpath}/${name}/AquaTerm.pbproj/project.pbxproj
-	reinplace "s|/usr/local/lib|${prefix}/lib|" \
-		${workpath}/${name}/AquaTerm.pbproj/project.pbxproj
-	file mkdir ${workpath}/${name}/build/include
-	system "cd ${workpath}/${name} &&
-	    ln -s ../.. build/include/aquaterm"
+worksrcdir		${name}
 
-	reinplace "s|/usr/local|${prefix}|g" \
-		${workpath}/adapters/pgplot/ChangeLog \
-		${workpath}/adapters/pgplot/g77_gcc_AQT.conf \
-		${workpath}/adapters/pgplot/xlf_gcc_AQT.conf
-	reinplace "s|\$(HOME)|${prefix}|g" \
-		${workpath}/adapters/c/Makefile \
-		${workpath}/adapters/fortran/Makefile
-	reinplace "s|/*<PREFIX>|${prefix}|g" \
-		${workpath}/adapters/pgplot/g77_cc_AQT.conf \
-		${workpath}/adapters/pgplot/g77_gcc_AQT.conf \
-		${workpath}/adapters/pgplot/xlf_gcc_AQT.conf
-	reinplace "s|/sw|${prefix}|g" \
-		${workpath}/adapters/pgplot/ReadMe
-}
+patchfiles		patch-frameworks-dir.diff \
+                patch-disable-universal.diff
 
-set xcodebuilddir build/Deployment
-platform darwin 7 {
-	 post-extract {
-	 	      cd ${workpath}/${name}
-	 	      file link -symbolic AquaTermFwk-Info.plist AquaTerm.framework-Info.plist
-	}
-	set xcodebuilddir build
-}
+xcode.target	AquaTerm
 
-platform darwin 8 {
-	if {$xcodeversion != "2.1"} {
-	    set xcodebuilddir build
-	}
+# Can be removed once MacPorts 1.7.0 is released
+if {![info exists applications_dir]} {
+	set applications_dir /Applications/MacPorts
 }
-
-build.type		pbx
-build.dir		${workpath}/${name}
-build.target	-buildstyle Deployment -target AquaTerm
-post-build {
-	system "install_name_tool -id ${prefix}/lib/libaquaterm.1.dylib \
-		${workpath}/${name}/${xcodebuilddir}/AquaTerm.framework/Versions/Current/AquaTerm"
-	system "install_name_tool -change /Library/Frameworks/AquaTerm.framework/Versions/A/AquaTerm ${prefix}/lib/libaquaterm.1.dylib \
-		${workpath}/${name}/${xcodebuilddir}/AquaTerm.app/Contents/MacOS/AquaTerm"
+if {![info exists frameworks_dir]} {
+	set frameworks_dir ${prefix}/Library/Frameworks
 }
 
-destroot {
-	xinstall -d -m 0755 ${destroot}/Applications/MacPorts
-	xinstall -d -m 0755 ${destroot}/Library/Frameworks
-	xinstall -d -m 0755 ${destroot}${prefix}/include/${name}
-	xinstall -d -m 0755 ${destroot}${prefix}/share/${name}
+xcode.build.settings	USER_APPS_DIR=${applications_dir} \
+						FRAMEWORKS_DIR=${frameworks_dir}
 
-	xinstall -m 0644 -W ${workpath}/${name} AQTAdapter.h aquaterm.h \
-		${destroot}${prefix}/include/${name}
+xcode.destroot.type		mixed
+xcode.destroot.settings USER_APPS_DIR=${applications_dir} \
+						FRAMEWORKS_DIR=${frameworks_dir}
 
-	system "cd ${workpath}/${name}/${xcodebuilddir} &&
-	    ln AquaTerm.framework/Versions/Current/AquaTerm libaquaterm.${version}.dylib &&
-	    ln -s libaquaterm.${version}.dylib ${destroot}${prefix}/lib/libaquaterm.dylib &&
-	    ln -s libaquaterm.${version}.dylib ${destroot}${prefix}/lib/libaquaterm.1.dylib"
-	    
-	xinstall -m 0755 ${workpath}/${name}/${xcodebuilddir}/libaquaterm.${version}.dylib \
-	    ${destroot}${prefix}/lib
-	copy ${workpath}/${name}/${xcodebuilddir}/AquaTerm.app \
-	    ${destroot}/Applications/MacPorts
-	copy ${workpath}/${name}/${xcodebuilddir}/AquaTerm.framework \
-	    ${destroot}/Library/Frameworks
-
-	
-	foreach f {c fortran gnuplot pgplot plplot} {
-	    copy ${workpath}/adapters/$f ${destroot}${prefix}/share/${name}
-	}
+variant universal {
+	patchfiles-delete	patch-disable-universal.diff
 }
-
