Skip to content

Commit

Permalink
Merge branch 'strip_frameworks'
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed Mar 22, 2011
2 parents a1460e1 + 8dd5f40 commit bf4bb09
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 10 deletions.
28 changes: 18 additions & 10 deletions support/osx.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
${PROG}: Showtime.app

all: frameworks

clean: Showtime.app-clean

frameworks:

Showtime.app-clean:
rm -rf ${APPDIR}

Expand All @@ -13,29 +17,33 @@ Showtime.app: \

.PHONY: ${APPDIR}/Contents/MacOS
${APPDIR}/Contents/MacOS:
mkdir -p $@
@mkdir -p $@

$(APPDIR)/Contents/Info.plist: support/osx/Info.plist
mkdir -p `dirname $@`
cp $< $@
@mkdir -p `dirname $@`
@cp $< $@

$(APPDIR)/Contents/Resources/hts.icns: support/osx/hts.icns
mkdir -p `dirname $@`
cp $< $@
@mkdir -p `dirname $@`
@cp $< $@

$(APPDIR)/Contents/Resources/MainMenu.nib: support/osx/MainMenu.xib
mkdir -p `dirname $@`
ibtool --compile $@ $<
@mkdir -p `dirname $@`
@ibtool --compile $@ $<

ifdef SPOTIFY_FRAMEWORK
Showtime.app: $(APPDIR)/Contents/Frameworks/libspotify.framework/libspotify
frameworks: $(APPDIR)/Contents/Frameworks/libspotify.framework/libspotify

$(APPDIR)/Contents/Frameworks/libspotify.framework/libspotify:
mkdir -p `dirname $@`
cp -a \
@echo "Copying and stripping spotify framework"
@mkdir -p `dirname $@`
@cp -a \
"${SPOTIFY_FRAMEWORK}/Versions" \
"${SPOTIFY_FRAMEWORK}/libspotify" \
"`dirname $@`"
@support/osx_striparch.sh \
${PROG} \
"`dirname $@`/Versions/Current/libspotify"
endif

.PHONY: Showtime.dmg
Expand Down
31 changes: 31 additions & 0 deletions support/osx_striparch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

if [ "$2" = "" ] ; then
echo "Usage: $0 binary-for-archs binary-to-strip"
exit
fi

ARCHS=""
while read l ; do
echo $l | grep -q "architectures"
if [ "$?" = "0" ] ; then
continue
fi

ARCH=`echo $l | sed 's/.*executable \(.*\)/\1/'`
ARCHS="$ARCH $ARCHS"
done < <(file $1)

i=0
for arch in $ARCHS ; do
a[$i]=-extract
a[$(($i+1))]=$arch
i=$((i+2))
done
a[$i]=-output
a[$(($i+1))]=$2
a[$(($i+2))]=$2

lipo ${a[@]}


0 comments on commit bf4bb09

Please sign in to comment.