From: <har...@us...> - 2008-08-28 13:45:19
|
Revision: 3369 http://hugin.svn.sourceforge.net/hugin/?rev=3369&view=rev Author: harryvanderwolf Date: 2008-08-28 13:45:15 +0000 (Thu, 28 Aug 2008) Log Message: ----------- move scripted build directory to mac development directory instead of mac platform tools Added Paths: ----------- hugin/trunk/mac/scripted_universal_build/ hugin/trunk/mac/scripted_universal_build/00-Readme.txt hugin/trunk/mac/scripted_universal_build/01-Compile_hugin.sh hugin/trunk/mac/scripted_universal_build/02-Make_bundle.sh hugin/trunk/mac/scripted_universal_build/03-localise-bundle.sh hugin/trunk/mac/scripted_universal_build/04-create_dmg_gz.sh hugin/trunk/mac/scripted_universal_build/bundle_constants.txt hugin/trunk/mac/scripted_universal_build/hugin_config.h Added: hugin/trunk/mac/scripted_universal_build/00-Readme.txt =================================================================== --- hugin/trunk/mac/scripted_universal_build/00-Readme.txt (rev 0) +++ hugin/trunk/mac/scripted_universal_build/00-Readme.txt 2008-08-28 13:45:15 UTC (rev 3369) @@ -0,0 +1,50 @@ +BUILDING A UNIVERSAL HUGIN BUNDLE WITH SCRIPTS + +*** +This is in alpha stage. +*** + +INTRODUCTION +Until now the way to build a Universal Hugin bundle was to do it via Xcode. +Recently Ippei Ukai, the creator of the XCode project, udapted the XCode project +with functionality that is not suported on tiger (at least it seams like that). +Leopard uses XCode 3.0, whereas Tiger uses 2.5 (or 2.4.1). Apple said that +as long as you did not use the extra functionality of 3.0, the XCode projects +are backwards compatible. This is not true however for the Hugin project. +That's why I built a scripted version. + +PREREQUISITES +1. You need to have XCode installed +2. You need to have cmake installed +3. You need to have subversion (SVN) installed +4. You need to have built the dependent libraries and binaries + with the scripts in the <hugin_trunk>/mac/ExternalPrograms directory. +5. You need to have a correct SetEnv-universal.txt available (which is a + prerequisite for 4 anyway) and you need to have a configured + bundle_constants.txt (in this directory). + +HOWTO BUILD A UNIVERSAL HUGIN BUNDLE +1. Build all libraries and binaries from <hugin_trunk>/mac/ExternalPrograms. + +2. Compile Hugin + cd into the hugin main source directory. From that directory you need to + run the script: ./mac/scripted_universal_build/01-Compile_hugin.sh + Wait till it's finished (and that will take quite some time). + +3. Build Universal portable bundle + Cd into the mac/scripted_universal_build directory and issue the + command: ./02-Make_bundle.sh + +4. Add localisation and help to the bundle. + From the mac/scripted_universal_build directory issue the + command: ./03-localise-bundle.sh + + After this step you have a fully portable Hugin bundle. + +5. Make archive for upload + From the mac/scripted_universal_build directory issue the + command: ./04-create_dmg_tgz.sh + +This will finish it up. Share your bundle with the community. + + Added: hugin/trunk/mac/scripted_universal_build/01-Compile_hugin.sh =================================================================== --- hugin/trunk/mac/scripted_universal_build/01-Compile_hugin.sh (rev 0) +++ hugin/trunk/mac/scripted_universal_build/01-Compile_hugin.sh 2008-08-28 13:45:15 UTC (rev 3369) @@ -0,0 +1,281 @@ +# -------------------- +# Hugin 0.7.0 +# -------------------- +# $Id: 01-compile_hugin.sh 1905 2007-02-05 00:11:26Z ippei $ +# script skeleton by Ippei Ukai +# cmake part Harry van der Wolf + +# NOTE: This script needs to be run from the hugin source directory + +# prepare +source ./mac/ExternalPrograms/scripts/SetEnv-universal.txt; + +# export ="/PATH2HUGIN/mac/ExternalPrograms/repository" \ +# ARCHS="ppc i386" \ +# ppcTARGET="powerpc-apple-darwin8" \ +# i386TARGET="i386-apple-darwin8" \ +# ppcMACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \ +# i386MACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \ +# ppcONLYARG="-mcpu=G3 -mtune=G4" \ +# i386ONLYARG="-mfpmath=sse -msse2 -mtune=pentium-m -ftree-vectorize" \ +# ppc64ONLYARG="-mcpu=G5 -mtune=G5 -ftree-vectorize" \ +# OTHERARGs=""; + + + +# init + +let NUMARCH="0" + +for i in $ARCHS +do + NUMARCH=$(($NUMARCH + 1)) +done + +mkdir -p "$REPOSITORYDIR/bin"; +mkdir -p "$REPOSITORYDIR/lib"; +mkdir -p "$REPOSITORYDIR/include"; + + +HUGINVER_FULL="0.0" + +# compile + +for ARCH in $ARCHS +do + + mkdir -p "$REPOSITORYDIR/arch/$ARCH/bin"; + mkdir -p "$REPOSITORYDIR/arch/$ARCH/lib"; + mkdir -p "$REPOSITORYDIR/arch/$ARCH/include"; + + ARCHARGs="" + MACSDKDIR="" + + if [ $ARCH = "i386" -o $ARCH = "i686" ] + then + TARGET=$i386TARGET + MACSDKDIR=$i386MACSDKDIR + ARCHARGs="$i386ONLYARG" + elif [ $ARCH = "ppc" -o $ARCH = "ppc750" -o $ARCH = "ppc7400" ] + then + TARGET=$ppcTARGET + MACSDKDIR=$ppcMACSDKDIR + ARCHARGs="$ppcONLYARG" + elif [ $ARCH = "ppc64" -o $ARCH = "ppc970" ] + then + TARGET=$ppc64TARGET + MACSDKDIR=$ppc64MACSDKDIR + ARCHARGs="$ppc64ONLYARG" + elif [ $ARCH = "x86_64" ] + then + TARGET=$x64TARGET + MACSDKDIR=$x64MACSDKDIR + ARCHARGs="$x64ONLYARG" + fi + + mkdir -p $ARCH; + cd $ARCH; + rm CMakeCache.txt; + + # We do not want any interruption from pkg-configs, wx-configs and so on + # from MacPorts or Fink, who's paths were added to the PATH + #export PATH=/bin:/sbin:/usr/bin:/usr/sbin:$REPOSITORYDIR/bin + + # If you are on Tiger and you have dowloaded the binary subversion from + # Martin Ott's webpage, you also need to add /usr/local/bin + # In that case uncomment the line below and outcomment the above PATH statement + export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:$REPOSITORYDIR/bin + +# export CMAKE_INCLUDE_PATH="$CMAKE_INCLUDE_PATH:$REPOSITORYDIR/lib/wx/include/mac-unicode-release-2.8"; + + export PKG_CONFIG_PATH="$REPOSITORYDIR/lib/pkgconfig"; + +cmake \ + -DCMAKE_BUILD_TYPE="Release" \ + -DCMAKE_INSTALL_PREFIX="$REPOSITORYDIR/arch/$ARCH" \ + -DCMAKE_OSX_ARCHITECTURES="$TARGET" \ + -DCMAKE_OSX_SYSROOT="$MACSDKDIR"\ + -DCMAKE_C_FLAGS="-arch $ARCH -O2 -dead_strip -I/usr/include -I$REPOSITORYDIR/include" \ + -DCMAKE_CXX_FLAGS="-arch $ARCH -O2 -dead_strip -I/usr/include -I$REPOSITORYDIR/include" \ + -DCMAKE_LDFLAGS="-L/usr/lib -L$REPOSITORYDIR/lib -dead_strip -prebind -liconv" \ + -DEXIV2_INCLUDE_DIR=$REPOSITORYDIR/include \ + -DEXIV2_LIBRARIES=$REPOSITORYDIR/lib/libexiv2.dylib \ + -DOPENEXR_INCLUDE_DIR=$REPOSITORYDIR/include/OpenEXR \ + ..; + +# -DCMAKE_C_FLAGS="-arch $ARCH -O2 -dead_strip -I/usr/include -I$REPOSITORYDIR/include -I$REPOSITORYDIR/lib/wx/include/mac-unicode-release-2.8" \ +# -DCMAKE_CXX_FLAGS="-arch $ARCH -O2 -dead_strip -I/usr/include -I$REPOSITORYDIR/include -I$REPOSITORYDIR/lib/wx/include/mac-unicode-release-2.8" \ + + + + # patch hugin_config.h + cp "../platforms/mac/scripted_universal_build/hugin_config.h" "src/hugin_config.h" + + make; + make install; + + cd .. + +done + +# Correct install_names in Hugin and HuginStitchProject binaries +for ARCH in $ARCHS +do + echo "$ARCH" + bins="$REPOSITORYDIR/arch/$ARCH/Application/Hugin.app/Contents/MacOS/Hugin $REPOSITORYDIR/arch/$ARCH/Application/HuginStitchProject.app/Contents/MacOS/HuginStitchProject" + for exec_file in $bins + do + lib_path="`otool -L $exec_file 2>/dev/null | fgrep compatibility | cut -d\( -f1 | grep $ARCH`" + for lib in $lib_path + do + echo $lib + libbase="`echo $lib | sed -e 's/ (.*$//' -e 's/^.*\///'`" + echo " Changing install name for: $libbase" + install_name_tool -change "$lib" "$REPOSITORYDIR/lib/$libbase" $exec_file + done + done +done + +# Correct install_names in nona, hugin_hdrmerge and pto2mk binaries +for ARCH in $ARCHS +do + echo "$ARCH" + bins="$REPOSITORYDIR/arch/$ARCH/bin/nona $REPOSITORYDIR/arch/$ARCH/bin/hugin_hdrmerge $REPOSITORYDIR/arch/$ARCH/bin/pto2mk" + for exec_file in $bins + do + lib_path="`otool -L $exec_file 2>/dev/null | fgrep compatibility | cut -d\( -f1 | grep libhugin`" + for lib in $lib_path + do + echo $lib + libbase="`echo $lib | sed -e 's/ (.*$//' -e 's/^.*\///'`" + echo " Changing install name for: $libbase" + install_name_tool -change "$lib" "$REPOSITORYDIR/lib/$libbase" $exec_file + done + done +done + +# merge execs +echo "merge executables from Hugin" + +for program in bin/vig_optimize bin/tca_correct bin/pto2mk bin/nona bin/fulla bin/autooptimiser bin/align_image_stack bin/nona_gui bin/matchpoint bin/hugin_hdrmerge +do + + LIPOARGs="" + + for ARCH in $ARCHS + do + + LIPOARGs="$LIPOARGs $REPOSITORYDIR/arch/$ARCH/$program" + + if [ $NUMARCH -eq 1 ] + then + mv "$REPOSITORYDIR/arch/$ARCH/$program" "$REPOSITORYDIR/$program"; + strip "$REPOSITORYDIR/$program"; + break; + else + lipo $LIPOARGs -create -output "$REPOSITORYDIR/$program"; + strip "$REPOSITORYDIR/$program"; + fi + + done + +done + + +# merge libhugin*.dylibs +echo "Merging the libhugin*.dylibs" + +for liba in lib/libhuginANN.$HUGINVER_FULL.dylib lib/libhuginbase.$HUGINVER_FULL.dylib lib/libhuginjhead.$HUGINVER_FULL.dylib lib/libhuginvigraimpex.$HUGINVER_FULL.dylib +do + + if [ $NUMARCH -eq 1 ] + then + mv "$REPOSITORYDIR/arch/$ARCHS/$liba" "$REPOSITORYDIR/$liba"; + if [[ $liba == *.a ]] + then + ranlib "$REPOSITORYDIR/$liba"; + fi + continue + fi + + LIPOARGs="" + + for ARCH in $ARCHS + do + LIPOARGs="$LIPOARGs $REPOSITORYDIR/arch/$ARCH/$liba" + done + + lipo $LIPOARGs -create -output "$REPOSITORYDIR/$liba"; + if [[ $liba == *.a ]] + then + ranlib "$REPOSITORYDIR/$liba"; + fi + +done + + +if [ -f "$REPOSITORYDIR/lib/libhuginANN.$HUGINVER_FULL.dylib" ] +then + install_name_tool -id "$REPOSITORYDIR/lib/libhuginANN.$HUGINVER_FULL.dylib" "$REPOSITORYDIR/lib/libhuginANN.$HUGINVER_FULL.dylib" + ln -sfn libhuginANN.$HUGINVER_FULL.dylib $REPOSITORYDIR/lib/libhuginANN.dylib; +fi + +if [ -f "$REPOSITORYDIR/lib/libhuginbase.$HUGINVER_FULL.dylib" ] +then + install_name_tool -id "$REPOSITORYDIR/lib/libhuginbase.$HUGINVER_FULL.dylib" "$REPOSITORYDIR/lib/libhuginbase.$HUGINVER_FULL.dylib" + ln -sfn libhuginbase.$HUGINVER_FULL.dylib $REPOSITORYDIR/lib/libhuginbase.dylib; +fi + +if [ -f "$REPOSITORYDIR/lib/libhuginjhead.$HUGINVER_FULL.dylib" ] +then + install_name_tool -id "$REPOSITORYDIR/lib/libhuginjhead.$HUGINVER_FULL.dylib" "$REPOSITORYDIR/lib/libhuginjhead.$HUGINVER_FULL.dylib" + ln -sfn libhuginjhead.$HUGINVER_FULL.dylib $REPOSITORYDIR/lib/libhuginjhead.dylib; +fi + +if [ -f "$REPOSITORYDIR/lib/libhuginvigraimpex.$HUGINVER_FULL.dylib" ] +then + install_name_tool -id "$REPOSITORYDIR/lib/libhuginvigraimpex.$HUGINVER_FULL.dylib" "$REPOSITORYDIR/lib/libhuginvigraimpex.$HUGINVER_FULL.dylib" + ln -sfn libhuginvigraimpex.$HUGINVER_FULL.dylib $REPOSITORYDIR/lib/libhuginvigraimpex.dylib; +fi + + + +# merge minimal bundles to universal minimal bundle +# echo "merge minimal bundles to universal minimal bundles" + + + +for ARCH in $ARCHS +do + mkdir -p "$REPOSITORYDIR/Application" + rm -rf "$REPOSITORYDIR/Application/Hugin.app" + rm -rf "$REPOSITORYDIR/Application/HuginStichProject.app" + + cp -R "$REPOSITORYDIR/arch/$ARCH/Application/Hugin.app" "$REPOSITORYDIR/Application/" + cp -R "$REPOSITORYDIR/arch/$ARCH/Application/HuginStitchProject.app" "$REPOSITORYDIR/Application/" + break; +done + + +for program in Application/Hugin.app/Contents/MacOS/Hugin Application/HuginStitchProject.app/Contents/MacOS/HuginStitchProject +do + + if [ $NUMARCH -eq 1 ] + then + mv "$REPOSITORYDIR/arch/$ARCHS/$program" "$REPOSITORYDIR/$program"; + strip "$REPOSITORYDIR/$program"; + continue + fi + + LIPOARGs="" + + for ARCH in $ARCHS + do + LIPOARGs="$LIPOARGs $REPOSITORYDIR/arch/$ARCH/$program" + done + + lipo $LIPOARGs -create -output "$REPOSITORYDIR/$program"; + + strip "$REPOSITORYDIR/$program"; + +done Property changes on: hugin/trunk/mac/scripted_universal_build/01-Compile_hugin.sh ___________________________________________________________________ Added: svn:executable + * Added: hugin/trunk/mac/scripted_universal_build/02-Make_bundle.sh =================================================================== --- hugin/trunk/mac/scripted_universal_build/02-Make_bundle.sh (rev 0) +++ hugin/trunk/mac/scripted_universal_build/02-Make_bundle.sh 2008-08-28 13:45:15 UTC (rev 3369) @@ -0,0 +1,138 @@ +#!/bin/sh +# 02-Make_bundle.sh +# Harry van der Wolf, 2008 + +# Set correct environment +source ../ExternalPrograms/scripts/SetEnv-universal.txt +source ./bundle_constants.txt + +# take care of build directory +mkdir -p build + +# Set some variables +H_app="build/Hugin.app" +H_binary="$H_app/Contents/MacOS/Hugin" +RES_dir="$H_app/Contents/Resources" +HSP_app="$RES_dir/HuginStitchProject.app" +HSP_binary="$HSP_app/Contents/MacOS/HuginStitchProject" +dylib_dir="$REPOSITORYDIR/lib" +old_install_name_dirname="$REPOSITORYDIR/lib" +dylib_install_loc="Libraries" +new_install_name_dirname="@executable_path/../$dylib_install_loc" +exiftoolDir="$EXIFTOOL_DIR" + + + +# Copy minimal bundles to build directory +echo "Copy minimal bundles to build directory" +rm -rf build/Hugin.app + +cp -R "$REPOSITORYDIR/Application/Hugin.app" "build" +cp -R "$REPOSITORYDIR/Application/HuginStitchProject.app" "$RES_dir" + + +# Copy binaries in relevant bundle +H_bins="autopano-sift-c autopano matchpoint panomatic" +HSP_bins="PTmasker PTroller PTblender PTmender enblend enfuse gnumake hugin_hdrmerge nona pto2mk" + +#for bins in $H_bins +#do +# echo "Copying $bins into bundle" +# cp -Rf $REPOSITORYDIR/bin/$bins "$RES_dir" +#done + +for bins in $HSP_bins +do + echo "Copying $bins into bundle" + cp -Rf $REPOSITORYDIR/bin/$bins "$HSP_app/Contents/MacOS" +done + + +# Copy necessary libraries into bundle +# Find out libs we need and loop until no changes. +echo "" +echo "Find the libraries we need and loop until no new ones are added." + +mkdir -p $H_app/Contents/$dylib_install_loc + +a=1 +nfiles=0 +endl=true +while $endl; do + echo "Looking for dependencies and copying them into the bundle. Round " $a + libs="`otool -L $dylib_dir/* $RES_dir/* $H_binary $HSP_app/Contents/MacOS/* 2>/dev/null | fgrep compatibility | cut -d\( -f1 | grep "$REPOSITORYDIR" | sort | uniq`" + cp -f $libs $H_app/Contents/$dylib_install_loc + let "a+=1" + nnfiles=`ls $H_app/Contents/$dylib_install_loc | wc -l` + if [ $nnfiles = $nfiles ]; then + endl=false + else + nfiles=$nnfiles + fi +done +echo "finished copying necessary libs from $REPOSITORYDIR" + + + +# replace old install_name_dirname to new install_name_dirname +echo "replace old install_name_dirname to new install_name_dirname" +binaries="$H_app/Contents/$dylib_install_loc/*.dylib $RES_dir/* $H_binary $HSP_app/Contents/MacOS/*" + +for exec_file in $binaries +do + + echo "Processing: $exec_file" + + if [[ $exec_file = *.dylib ]] + then + for lib in $(otool -D $exec_file | grep $old_install_name_dirname | sed -e 's/ (.*$//' -e 's/^.*\///') + do + echo " Changing own install name." + install_name_tool -id "$new_install_name_dirname/$lib" $exec_file + done + fi + + for lib in $(otool -L $exec_file | grep $old_install_name_dirname | sed -e 's/ (.*$//' -e 's/^.*\///') + do + echo " Changing install name for: $lib" + install_name_tool -change "$old_install_name_dirname/$lib" "$new_install_name_dirname/$lib" $exec_file + done + +done + +# Copy "control point" scripts into bundle +H_scripts="autopano-complete-mac.sh matchpoint-complete-mac.sh" +#for scripts in $H_scripts +#do +# echo "Copying $scripts into bundle" +# cp -Rf "../../../mac/$scripts" "$RES_dir" +#done + +# Copy Exiftool into the bundle +echo "" +echo "# Now copying Exiftool into the bundle. There is no error checking. If exiftool is" +echo "# not available your bundle will function just as well but without that functionality." +echo "" +rm -rf $RES_dir/ExifTool; +mkdir -p $RES_dir/ExifTool; + +cp $exiftoolDir/exiftool $RES_dir/ExifTool/; +cp -r $exiftoolDir/lib $RES_dir/ExifTool/; + + + +# Embed HuginStitchProject inside Hugin +rm -Rf "$HSP_app/Contents/$dylib_install_loc" +ln -s "../../../$dylib_install_loc" "$HSP_app/Contents/$dylib_install_loc" + +if (file "$HSP_app/Contents/Resources" | grep -q -v "symbolic link") +then + cp -r "$HSP_app/Contents/Resources"/* "$H_app/Contents/Resources/" +fi +rm -Rf "$HSP_app/Contents/Resources" +ln -s "../../../Resources" "$HSP_app/Contents/Resources" + +# Copy Info.plists into bundle +cp ../Hugin-Info.plist $H_app/Contents/Info.plist +cp ../hugin_stitch_project-Info.plist $HSP_app/Contents/Info.plist + Property changes on: hugin/trunk/mac/scripted_universal_build/02-Make_bundle.sh ___________________________________________________________________ Added: svn:executable + * Added: hugin/trunk/mac/scripted_universal_build/03-localise-bundle.sh =================================================================== --- hugin/trunk/mac/scripted_universal_build/03-localise-bundle.sh (rev 0) +++ hugin/trunk/mac/scripted_universal_build/03-localise-bundle.sh 2008-08-28 13:45:15 UTC (rev 3369) @@ -0,0 +1,157 @@ +#!/bin/sh +# 03-localise-bundle.sh +# Harry van der Wolf, 2008 +# This file is almost completely copied from Ippei Ukai's localisation scripts + +# Set correct environment +source ../ExternalPrograms/scripts/SetEnv-universal.txt +source ./bundle_constants.txt + + # We do not want any interruption from pkg-configs, wx-configs and so on + # from MacPorts or Fink, who's paths were added to the PATH + #export PATH=/bin:/sbin:/usr/bin:/usr/sbin:$REPOSITORYDIR/bin + + # If you are on Tiger and you have dowloaded the binary subversion from + # Martin Ott's webpage, you also need to add /usr/local/bin + # In that case uncomment the line below and outcomment the above PATH statement + export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:$REPOSITORYDIR/bin + + + +# Set some variables +H_app="build/Hugin.app" +wxWidgetsLocaleDir="$WX_LOCALE_DIR" +huginBuilder="$HUGIN_BUILDER" +resdir="$H_app/Contents/Resources" +huginsrcdir="../../../src/hugin1/hugin" +xrcsrcdir="$huginsrcdir/xrc" +translationsdir="../../../src/translations" + + + +####### +# First patch xrc + +rm -fR $resdir/xrc +echo "" +echo "copying xrc folder to $resdir/xrc" +cp -R $xrcsrcdir $resdir/ +echo "removing extra files from xrc folder" +for DIR in $resdir/xrc "$resdir/xrc/??*" "$resdir/xrc/??*/??*" +do + rm -fR $DIR/.svn + rm -f $DIR/.??* + rm -fR $DIR/CVS + rm -f $DIR/Makefil* + rm -f $DIR/CMake* +done + +echo "patching $resdir/xrc/cp_editor_panel.xrc to use wxChoice instead of wxNotebook" +mv $resdir/xrc/cp_editor_panel.xrc $resdir/xrc/cp_editor_panel.xrc-bk +sed -e s/wxNotebook/wxChoice/ -e s/cp_editor_left_tab/cp_editor_left_choice/ -e s/cp_editor_right_tab/cp_editor_right_choice/ $resdir/xrc/cp_editor_panel.xrc-bk > $resdir/xrc/cp_editor_panel.xrc +rm $resdir/xrc/cp_editor_panel.xrc-bk + +echo "patching $resdir/xrc/main_frame.xrc to have no border around the tab control." +mv $resdir/xrc/main_frame.xrc $resdir/xrc/main_frame.xrc-bk +sed -e s/wxALL// $resdir/xrc/main_frame.xrc-bk > $resdir/xrc/main_frame.xrc +rm $resdir/xrc/main_frame.xrc-bk + +#echo "generating about.htm from about.htm.in" +#sed -e "s/\${HUGIN_PACKAGE_VERSION}/$huginVer/g" \ +# -e "s/\${HUGIN_BUILDER}/$huginBuilder/g" \ +# $resdir/xrc/data/about.htm.in > $resdir/xrc/data/about.htm +#rm $resdir/xrc/data/about.htm.in + +cp $REPOSITORYDIR/share/hugin/xrc/data/about.htm $resdir/xrc/data/about.htm + + +######## +# Add localisation +echo "" +echo "Adding localisation files to the bundle" +for lang in "en" $(ls $translationsdir/*.po | sed -e "s/^.*\///g" -e "s/\.po//g") +do + + echo + echo "Language: $lang" + + localisedresdir="$resdir/$lang.lproj" + localedir="$localisedresdir/locale" + + rm -fR $localisedresdir + echo "deleting $localisedresdir" + + mkdir "$localisedresdir" + echo "making $localisedresdir" + mkdir "$localedir" + echo "making $localedir" + + if [ $lang = "en" ] + then + continue + fi + + echo "$lang/hugin.mo from $lang.po" + msgfmt -v -o "$localedir/hugin.mo" "$translationsdir/$lang.po" + + echo "$lang/wxstd.mo from $wxWidgetsLocaleDir/$lang.po" + if [ -f "$wxWidgetsLocaleDir/$lang.po" ] + then + msgfmt -v -o "$localedir/wxstd.mo" "$wxWidgetsLocaleDir/$lang.po" + else + echo "$lang.po not found;" + parentLang=`echo $lang|sed s/_.*//` + echo "$lang/wxstd.mo from $wxWidgetsLocaleDir/$parentLang.po" + if [ -f "$wxWidgetsLocaleDir/$parentLang.po" ] + then + msgfmt -v -o "$localedir/wxstd.mo" "$wxWidgetsLocaleDir/$parentLang.po" + else + echo "$parentLang.po not found;" + fi + fi + + for file in `ls $xrcsrcdir/data | grep _$lang.htm` + do + echo copying $file to $localisedresdir/`echo $file|sed s/_$lang//` + echo rewriting \'src=\"\' to \'src=\"../xrc/data/\' + sed s/src\=\"/src\=\"..\\/xrc\\/data\\// "$xrcsrcdir/data/$file" > $localisedresdir/`echo $file|sed s/_$lang//` + done + + for file in `ls $xrcsrcdir/data | grep _$lang.html` + do + echo copying $file to $localisedresdir/`echo $file|sed s/_$lang//` + echo rewriting \'src=\"\' to \'src=\"../xrc/data/\' + sed s/src\=\"/src\=\"..\\/xrc\\/data\\// "$xrcsrcdir/data/$file" > $localisedresdir/`echo $file|sed s/_$lang//` + done + + +done + +######## +# Install and "correct" help files +echo "" +echo "Install help files and change HTML src paths" +for helplang in "en_EN fr_FR" +do + + localisedresdir="$resdir/$(echo en_EN | grep -o '^[^_]*').lproj" + + if [ -d "$xrcsrcdir/data/help_$helplang" ] + then + echo "moving help_$helplang to $localisedresdir/help" + cp -R "$resdir/xrc/data/help_$helplang" "$localisedresdir/help" + for file in `ls $localisedresdir/help | grep .html` + do + echo rewriting \'src=\"../help_common\' to \'src=\"../../xrc/data/help_common\' + sed s/src\=\"..\\/help_common/src\=\"..\\/..\\/xrc\\/data\\/help_common/ "$localisedresdir/help/$file" > $localisedresdir/help/$file-copy + mv $localisedresdir/help/$file-copy $localisedresdir/help/$file + done + fi + +done + +echo "" +echo "All done. You should now have a working and fully portable Universal bundle." +echo "" +echo "" + Property changes on: hugin/trunk/mac/scripted_universal_build/03-localise-bundle.sh ___________________________________________________________________ Added: svn:executable + * Added: hugin/trunk/mac/scripted_universal_build/04-create_dmg_gz.sh =================================================================== --- hugin/trunk/mac/scripted_universal_build/04-create_dmg_gz.sh (rev 0) +++ hugin/trunk/mac/scripted_universal_build/04-create_dmg_gz.sh 2008-08-28 13:45:15 UTC (rev 3369) @@ -0,0 +1,51 @@ +#!/bin/sh +# 04-create_dmg_tgz.sh +# Harry van der Wolf, 2008 + +# Make a compressed image and gzip that for higher compression + +mkdir -p archives + +if [ $# -ne 1 ]; then + echo "" + echo 1>&2 "" + echo "You need to specify a name for the archive to be created. Please do not add an extention." + echo "Like ./04-create_dmg_tgz.sh hugin0.7_svn1234_20080810" + echo "" + exit 127 +fi + +archive=$1 + +echo "# Creating directory $archive in archives. Hugin.app and some more will be copied into this" +echo "# directory and from this directory the $archive.dmg and $archive.dmg.gz will be created" +rm -rf archives/$archive +mkdir -p archives/$archive + +# copy Hugin.app +cp -R build/Hugin.app archives/$archive/Hugin.app + +# I always copy some Docs and and the relevant License files into the bundle. +# Comment these lines out if you don't want to do that +cd archives +cp -R Docs $archive +cp -R Licenses $archive +cp *.webloc $archive +cp "Read me first (Mac).rtf" $archive +cp "Pre-release Note.txt" $archive + +# Temporarily copy autopano-sift-c.autocp in +cp -R Autopano-SIFT $archive + + + + +# Create .dmg from folder +hdiutil create -srcfolder "$archive" "$archive.dmg" + +# Gzip to compress it even a little further +gzip -9 "$archive.dmg" + +echo "Done. Your $archive.dmg.gz has been created in the directory archives" + + Property changes on: hugin/trunk/mac/scripted_universal_build/04-create_dmg_gz.sh ___________________________________________________________________ Added: svn:executable + * Added: hugin/trunk/mac/scripted_universal_build/bundle_constants.txt =================================================================== --- hugin/trunk/mac/scripted_universal_build/bundle_constants.txt (rev 0) +++ hugin/trunk/mac/scripted_universal_build/bundle_constants.txt 2008-08-28 13:45:15 UTC (rev 3369) @@ -0,0 +1,21 @@ +# Configuration for scripted build of universal Hugin.app +# Copyright (c) 2008, Harry van der Wolf + +# This config file contains some constants to be able to build the bundle + +# YOU NEED TO SPECIFY WHERE YOU HAVE ExifTool +# This needs to be the absolute path +EXIFTOOL_DIR="$REPOSITORYDIR/../Image-ExifTool-7.25" + +# Specify where your WxWidgets (a.k.a WxMac a.k.a. wxWindows) locale directory is +# Note: this is inside your wxWidgets source directory +WX_LOCALE_DIR="$REPOSITORYDIR/../wxMac-2.8.8/locale" + +# Type your name into this variable +HUGIN_BUILDER="spiderman" + +export EXIFTOOL_DIR; +export WX_LOCALE_DIR; +export HUGIN_BUILDER; + + Added: hugin/trunk/mac/scripted_universal_build/hugin_config.h =================================================================== --- hugin/trunk/mac/scripted_universal_build/hugin_config.h (rev 0) +++ hugin/trunk/mac/scripted_universal_build/hugin_config.h 2008-08-28 13:45:15 UTC (rev 3369) @@ -0,0 +1,62 @@ +#ifndef __CONFIG_H__ + +/* Define to 1 if you have the <pano12/queryfeature.h> header file. */ +#define HAVE_PANO12_QUERYFEATURE_H 1 + +/* various libraries. For compatability with the old source code + * most cmake variables are defined under a second name as well */ + +/* Define if you have JPEG library */ +#define JPEG_FOUND 1 +/* Define if you have JPEG library (old style) */ +#ifdef JPEG_FOUND +#define HasJPEG 1 +#endif + +/* Define if you have PNG library */ +#define PNG_FOUND 1 +#ifdef PNG_FOUND +#define HasPNG 1 +#endif + +/* Define if you have TIFF library */ +#define TIFF_FOUND 1 +#ifdef TIFF_FOUND +#define HasTIFF 1 +#endif + +/* Define if you have OpenEXR library */ +#define OPENEXR_FOUND 1 +#ifdef OPENEXR_FOUND +#define HasEXR 1 +#endif + +/* Define if you have Panotools library (pano13) */ +/* #undef TLALLI_FOUND 1 */ +#define PANO13_FOUND 1 +#define PANO12_FOUND 1 + +#ifdef TLALLI_FOUND +#define HasTLALLI 1 +#elif defined PANO13_FOUND +#define HasPANO13 1 +#elif defined PANO12_FOUND +#define HasPANO12 1 +#endif + +/* locate of the xrc files, as defined during configuration */ +#define INSTALL_LOCALE_DIR "" + +/* Location for XRC files and other data, as defined during configuration*/ +#define INSTALL_XRC_DIR "" + +/* Use exiv2, if found */ +#define EXIV2_FOUND 1 +#ifdef EXIV2_FOUND +#define HUGIN_USE_EXIV2 1 +#endif + +/* Build a fully self contained OSX bundle (with embedded ressources) */ +#define MAC_SELF_CONTAINED_BUNDLE 1 + +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |