[26788] users/pipping
source_changes at macosforge.org
source_changes at macosforge.org
Sat Jul 7 15:24:04 PDT 2007
Revision: 26788
http://trac.macosforge.org/projects/macports/changeset/26788
Author: pipping at macports.org
Date: 2007-07-07 15:24:02 -0700 (Sat, 07 Jul 2007)
Log Message:
-----------
add make_wrapper to handle config scripts that differ across trees (r48)
minor changes (r47, r49)
Modified Paths:
--------------
users/pipping/merge.rb
Added Paths:
-----------
users/pipping/build_libpng.sh
Added: users/pipping/build_libpng.sh
===================================================================
--- users/pipping/build_libpng.sh (rev 0)
+++ users/pipping/build_libpng.sh 2007-07-07 22:24:02 UTC (rev 26788)
@@ -0,0 +1,30 @@
+#! /bin/sh
+
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin
+
+TOP_DIR=/tmp
+TARGET=$TOP_DIR/libpng
+MAKEOPTS='-s -j3'
+mkdir $TARGET
+cd $TARGET
+curl -O http://switch.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.18.tar.bz2
+
+for arch in ppc i386 ppc64 x86_64; do
+ cd $TARGET
+ mkdir build_${arch}
+ tar xjf libpng-1.2.18.tar.bz2 -C build_${arch}
+ cd build_${arch}/libpng-1.2.18
+
+ export CPPFLAGS="-I/Developer/SDKs/MacOSX10.4u.sdk/usr/include -arch ${arch}"
+ export LDFLAGS="-L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib -arch ${arch}"
+
+ ./configure --quiet --host=${arch}-apple-darwin
+
+ make $MAKEOPTS
+ make $MAKEOPTS install DESTDIR=$TARGET/${arch}
+
+ cd $TARGET
+ rm -rf build_${arch}
+done
+
+rm libpng-1.2.18.tar.bz2
Property changes on: users/pipping/build_libpng.sh
___________________________________________________________________
Name: svn:executable
+ *
Modified: users/pipping/merge.rb
===================================================================
--- users/pipping/merge.rb 2007-07-07 19:40:44 UTC (rev 26787)
+++ users/pipping/merge.rb 2007-07-07 22:24:02 UTC (rev 26788)
@@ -156,12 +156,38 @@
end
end
+def make_wrapper ( filepath, args )
+# creates a wrapper for config scripts that differ across trees
+ unless ( args[:output] + filepath ).exist? and !args[:force]
+ open( args[:output] + filepath, 'w' ) {|my_file|
+ my_file.puts <<EOF
+#! /bin/sh
+
+DIR="#{filepath.dirname}"
+
+args=$@
+
+if [ "${args/-arch/}" != "$args" ]; then
+ arch=`echo "$args" | sed 's!.*-arch *\\([^ ][^ ]*\\).*!\\1!'`;
+else
+ arch=`uname -p`
+fi
+
+args=`echo $@ | sed "s!-arch *${arch}!!"`
+
+exec $DIR/${arch}/#{filepath.basename} ${args}
+EOF
+ }
+ end
+end
+
+
ORIGINAL_DIR = Pathname.pwd
processed = Set.new
# make sure we're given a valid root directory
unless arguments[:input].directory?
- raise sprintf( 'invalid input directory: %s', arguments[:input] )
+ raise 'invalid input directory: %s' % arguments[:input]
end
# make sure the requested architectures have corresponding subdirectories
@@ -227,11 +253,11 @@
# handle file type: header files
when '.h', '.hpp'
unless ( arguments[:output] + path ).exist? and !arguments[:force]
- open( arguments[:output] + path, 'w' ) {|file|
+ open( arguments[:output] + path, 'w' ) {|my_file|
ARGS.each {|arch|
- file.printf '#ifdef __%s__\n', arch
- file.puts open( arguments[:input] + arch + path, 'r' ).read
- file.puts '#endif'
+ my_file.printf "#ifdef __%s__\n", arch
+ my_file.puts open( arguments[:input] + arch + path, 'r' ).read
+ my_file.puts '#endif'
}
}
end
@@ -263,7 +289,7 @@
}
}.split( "\n" ).collect {|dep_line|
dep_line.lstrip.gsub(
- %r{ \(compatibility version \d+(\.\d+)*, current version \d+(\.\d+)*\)}, ''
+ / \(compatibility version \d+(\.\d+){2}, current version \d+(\.\d+){2}\)/, ''
)
}.reject {|dep|
dep[0..7] == '/usr/lib'
@@ -274,14 +300,22 @@
missing_in = links[my_arch]-links[ARGS[0]]
missing_out = links[ARGS[0]]-links[my_arch]
if missing_in.any? or missing_out.any?
- raise sprintf(
- 'difference in linking encountered: file %s',
- path
- )
+ raise 'difference in linking encountered: file %s' % path
end
end
}
lipo( path, ARGS, arguments )
+ when 'Bourne shell script text executable'
+ unless path.basename.to_s[-7..-1] == '-config'
+ Find.prune
+ # ERROR: no way to handle a shell script in general
+ end
+ ARGS.each {|arch|
+ copy_target=arguments[:output] + path.dirname + arch + path.basename
+ copy_target.dirname.mkpath unless arguments[:dry_run]
+ copy( arguments[:input] + arch + path, copy_target, arguments )
+ }
+ make_wrapper( path, arguments )
else
# DEBUG: unable to determine file type
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070707/8a87b5d5/attachment.html
More information about the macports-changes
mailing list