[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:43:00 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=201ae6f

The following commit has been merged in the master branch:
commit 201ae6f2edfeeb4e5b4f50998629ec40facec62d
Author: Robin Mills <robin at clanmills.com>
Date:   Thu Apr 19 21:53:38 2012 +0000

    rewrote buildForMac
    added makeUniversal
---
 contrib/buildForMac   | 91 +++++++++++++++++----------------------------------
 contrib/makeUniversal | 28 ++++++++++++++++
 2 files changed, 58 insertions(+), 61 deletions(-)

diff --git a/contrib/buildForMac b/contrib/buildForMac
index d6b2f92..57488af 100755
--- a/contrib/buildForMac
+++ b/contrib/buildForMac
@@ -1,92 +1,61 @@
 #!/bin/bash
 
 ##
-# buildForMac  <configure-options>
-# example:  contrib/buildForMac --disable-shared
+# buildForMac                     <configure-options>
+# example:  contrib/buildForMac --[dis|en]able-shared
 #
-# On Lion: 
-#    contrib/buildForMac --with-zlib=/usr/lib
-#    11 == `uname -a | cut '-d ' -f 3 | cut '-d.' -f 1` 
+##
 
+##
+# test OS level (L=9 SL==10 Lion = 11, ML=12)
 LION=""
-(echo $OSTYPE | grep 11) > /dev/null
-if [ $? == 0 ]; then
+let os=$(uname -a | cut -d' ' -f 3 | cut -d'.' -f 1)
+if [ $(( os >= 11 )) ]; then
   	LION="--with-zlib=/usr/lib"
 fi
 
-# b=`basename "${PWD}"`
-
 if [ ! -d contrib ]; then
 	echo "you are in the wrong directory - please run $0 in the main directory (which includes contrib and src)"
 	exit 1
 fi
 
-TARGET="MACOSX_DEPLOYMENT_TARGET=10.5"
-version=`grep EXIV2_LTVERSION config/config.mk | cut "-d " -f 3 | cut -d: -f 1`
-lib=libexiv2.$version.dylib
-
-echo
-echo -----------------------------
-echo version = $version
-echo lib = $lib
-echo -----------------------------
-echo
-
-app=exiv2
-LIB=./src/.libs/$lib
-APP=./src/.libs/$app
-
-for option in "$@" ; do
-	if [ "$option" == --disable-shared ]; then
-		lib=libexiv2.a
-		LIB=./src/.libs/$lib
-		APP=./src/$app
-	fi
-done
-
-props() {
-	ls    -alt  $*
-	lipo  -info $*
-	otool -L    $*
-	echo ----------------------
-}
-
+if [ -z $TARGET ]; then export TARGET="MACOSX_DEPLOYMENT_TARGET=10.5" ; fi
 
+# version=$(grep EXIV2_LTVERSION config/config.mk | cut "-d " -f 3 | cut -d: -f 1)
+# lib=libexiv2.$version.dylib
 
 build() {
 	make clean
 	./configure CFLAGS="$arch" CXXFLAGS="$arch" LDFLAGS="$arch -L${PWD}/xmpsdk/src" OBJCFLAGS="$arch" OBJCXXFLAGS="$arch" $TARGET $LION "$@"
-	make        CFLAGS="$arch" CXXFLAGS="$arch" LDFLAGS="$arch -L${PWD}/xmpsdk/src" OBJCFLAGS="$arch" OBJCXXFLAGS="$arch" $TARGET 
+	make        CFLAGS="$arch" CXXFLAGS="$arch" LDFLAGS="$arch -L${PWD}/xmpsdk/src" OBJCFLAGS="$arch" OBJCXXFLAGS="$arch" $TARGET all
+	# make        CFLAGS="$arch" CXXFLAGS="$arch" LDFLAGS="$arch -L${PWD}/xmpsdk/src" OBJCFLAGS="$arch" OBJCXXFLAGS="$arch" $TARGET samples
 	if [ "$?" != "0" ]; then
 		echo build failed
 		exit
 	fi
-	props $APP
-	props $LIB
 }
 
+##
+# build one architecture at a time
 for arch in '-arch i386' '-arch x86_64' ; do
-	if [ "$arch"   == "-arch i386"   ]; then
-		build "$@"
-		rm -rf app.i386 lib.i386
-		cp                 $APP        app.i386
-		cp                 $LIB        lib.i386
-	elif [ "$arch" == "-arch x86_64" ]; then
-		build "$@"
-		rm -rf app.x86_64 lib.x86_64
-		cp                 $APP        app.x86_64
-		cp                 $LIB        lib.x86_64
-	fi
+	echo arch = $arch
+	a=${arch:5:100}
+	build "$@"
+
+	##
+	# copy .libs to .arch
+	for d in $(find . -name ".libs" -type d); do
+		D=$(dirname $d)/.$a
+# 		echo --------------
+# 		echo d = $d   D = $D
+# 		echo --------------
+		ditto $d $D
+	done 
 done
 
-LIB=./src/.libs/$lib
-APP=./src/.libs/$app
-
-env $TARGET lipo -arch i386 lib.i386 -arch x86_64 lib.x86_64 -create -output $LIB
-env $TARGET lipo -arch i386 app.i386 -arch x86_64 app.x86_64 -create -output $APP 
-
-props $LIB
-props $APP
+##
+# combine the builds into a universal
+$(dirname $0)/makeUniversal
 
 # That's all Folks!
 ##
diff --git a/contrib/makeUniversal b/contrib/makeUniversal
new file mode 100755
index 0000000..c1063cf
--- /dev/null
+++ b/contrib/makeUniversal
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+##
+# makeUniversal - combine .i386 and .x86_64 build results into .libs
+# this script is called by buildForMac
+##
+
+##
+# search for directories called .x86_64
+# run every file and lipo .x86_64/file .x86_64/file -> .libs/file
+for D in $(find . -name ".x86_64"); do
+	for F in $(find $(dirname $D)/.x86_64 -type f); do
+		f=$(echo $F | sed -E -e "s/.x86_64/.i386/")
+		U=$(echo $F | sed -E -e "s/.x86_64/.libs/")
+		if [[ -e $f && -e $F ]]; then
+			# echo $F $f -> $U
+			lipo -arch i386 $f -arch x86_64 $F -create -output $U
+			if [ $? != '0' ]; then
+				echo FAILED lipo -arch i386 $f -arch x86_64 $F -create -output $U
+			else
+				echo $U $(lipo -info $U|sed -E -e "s/Architectures in the fat file://" -e "s/ are:/ : /") $(stat $U | cut -d' ' -f 2)
+			fi
+		fi
+	done
+done
+
+# That's all Folks!
+##

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list