]> git.sesse.net Git - vlc/blob - extras/package/macosx/package.mak
macosx: remove the intermediate VLC-tmp.app after creating either VLC.app or VLC...
[vlc] / extras / package / macosx / package.mak
1 if HAVE_DARWIN
2 if BUILD_MACOSX_VLC_APP
3 # Create the MacOS X app
4 noinst_DATA = VLC.app
5 endif
6 endif
7
8 # This is just for development purposes.
9 # The resulting VLC.app will only run in this tree.
10 VLC.app: VLC-tmp.app
11         rm -Rf $@
12         cp -R VLC-tmp.app $@
13         $(INSTALL) -m 0755 $(top_builddir)/bin/.libs/vlc $@/Contents/MacOS/VLC
14         $(LN_S) -f ../../../modules $@/Contents/MacOS/plugins
15         rm -Rf VLC-tmp.app
16
17 # VLC-release.app for packaging and giving it to your friends
18 # use package-macosx to get a nice dmg
19 VLC-release.app: VLC-tmp.app
20         rm -Rf $@
21         cp -R VLC-tmp.app $@
22         PRODUCT="$@" ACTION="release-makefile" src_dir=$(srcdir) build_dir=$(top_builddir) sh $(srcdir)/projects/macosx/framework/Pre-Compile.sh
23         find $@ -type d -exec chmod ugo+rx '{}' \;
24         find $@ -type f -exec chmod ugo+r '{}' \;
25         rm -Rf $@/Contents/Frameworks/BGHUDAppKit.framework/Resources/
26         rm -Rf VLC-tmp.app
27
28 # common target to a VLC bundle used by both the dev and the release build
29 VLC-tmp.app: vlc
30         $(AM_V_GEN)(cd src && $(MAKE) $(AM_MAKEFLAGS) install $(silentstd))
31         (cd lib && $(MAKE) $(AM_MAKEFLAGS) install $(silentstd))
32         rm -Rf "$(top_builddir)/tmp" "$@"
33         mkdir -p "$(top_builddir)/tmp/extras/package/macosx"
34         cd $(srcdir)/extras/package/macosx; cp -R Resources README.MacOSX.rtf $(abs_top_builddir)/tmp/extras/package/macosx/
35         mkdir -p $(abs_top_builddir)/tmp/extras/package/macosx/vlc.xcodeproj/
36         sed -e s,../../../contrib,$(CONTRIB_DIR),g $(srcdir)/extras/package/macosx/vlc.xcodeproj/project.pbxproj \
37         > $(abs_top_builddir)/tmp/extras/package/macosx/vlc.xcodeproj/project.pbxproj
38         REVISION=`(git --git-dir=$(srcdir)/.git describe --always || echo exported)` && \
39             sed "s/#REVISION#/$$REVISION/g" $(top_builddir)/extras/package/macosx/Info.plist \
40         > $(top_builddir)/tmp/extras/package/macosx/Info.plist
41         cp -R $(top_builddir)/extras/package/macosx/Resources $(top_builddir)/tmp/extras/package/macosx/
42         cd "$(srcdir)"; cp AUTHORS COPYING THANKS $(abs_top_builddir)/tmp/
43         mkdir -p $(top_builddir)/tmp/modules/audio_output
44         mkdir -p $(top_builddir)/tmp/modules/gui/macosx
45         cd "$(srcdir)/modules/gui/macosx/" && cp *.h *.m $(abs_top_builddir)/tmp/modules/gui/macosx/
46         cd $(top_builddir)/tmp/extras/package/macosx && \
47                 xcodebuild -target vlc SYMROOT=../../../build DSTROOT=../../../build $(silentstd)
48         cp -R -L $(top_builddir)/tmp/build/Default/VLC.bundle $@
49         mkdir -p $@/Contents/Frameworks && cp -R -L $(CONTRIB_DIR)/Growl.framework $@/Contents/Frameworks/
50         mkdir -p $@/Contents/MacOS/share/locale/
51         cp -r $(srcdir)/share/lua $@/Contents/MacOS/share/
52         $(INSTALL) -m 644 $(srcdir)/share/vlc512x512.png $@/Contents/MacOS/share/vlc512x512.png
53         cat $(top_srcdir)/po/LINGUAS | while read i; do \
54           $(INSTALL) -d $@/Contents/MacOS/share/locale/$${i}/LC_MESSAGES ; \
55           $(INSTALL) $(srcdir)/po/$${i}.gmo $@/Contents/MacOS/share/locale/$${i}/LC_MESSAGES/vlc.mo; \
56           mkdir -p $@/Contents/Resources/$${i}.lproj/ ; \
57           $(LN_S) -f ../English.lproj/InfoPlist.strings ../English.lproj/MainMenu.nib \
58                 $@/Contents/Resources/$${i}.lproj/ ; \
59         done
60         printf "APPLVLC#" >| $@/Contents/PkgInfo
61
62 package-macosx: VLC-release.app
63         mkdir -p "$(top_builddir)/vlc-$(VERSION)/Goodies/"
64         cp -R "$(top_builddir)/VLC-release.app" "$(top_builddir)/vlc-$(VERSION)/VLC.app"
65         cd $(srcdir); cp AUTHORS COPYING README THANKS NEWS $(abs_top_builddir)/vlc-$(VERSION)/Goodies/
66         cp -R  $(srcdir)/extras/package/macosx/Delete_Preferences.app $(top_builddir)/vlc-$(VERSION)/Goodies/Delete\ VLC\ Preferences.app
67         cp $(srcdir)/extras/package/macosx/README.MacOSX.rtf $(top_builddir)/vlc-$(VERSION)/Read\ Me.rtf
68         mkdir -p $(top_builddir)/vlc-$(VERSION)/.background/
69         cp $(srcdir)/extras/package/macosx/Resources/about_bg.png $(top_builddir)/vlc-$(VERSION)/.background/background.png
70         $(LN_S) -f /Applications $(top_builddir)/vlc-$(VERSION)/
71         rm -f "$(top_builddir)/vlc-$(VERSION)-rw.dmg"
72         hdiutil create -verbose -srcfolder "$(top_builddir)/vlc-$(VERSION)" "$(top_builddir)/vlc-$(VERSION)-rw.dmg" -scrub
73 # Make sure the image is not writable
74 # Note: We can't directly create a read only dmg as we do the bless stuff
75         rm -f "$(top_builddir)/vlc-$(VERSION).dmg"
76         hdiutil convert "$(top_builddir)/vlc-$(VERSION)-rw.dmg" -format UDBZ -o "$(top_builddir)/vlc-$(VERSION).dmg"
77         ls -l "$(top_builddir)/vlc-$(VERSION).dmg"
78
79 package-macosx-zip: VLC-release.app
80         mkdir -p $(top_builddir)/vlc-$(VERSION)/Goodies/
81         cp -R $(top_builddir)/VLC-release.app $(top_builddir)/vlc-$(VERSION)/VLC.app
82         cd $(srcdir); cp -R AUTHORS COPYING README THANKS NEWS extras/package/macosx/Delete_Preferences.app/ \
83                 $(abs_top_builddir)/vlc-$(VERSION)/Goodies/
84         cp $(srcdir)/extras/package/macosx/README.MacOSX.rtf $(top_builddir)/vlc-$(VERSION)/Read\ Me.rtf
85         zip -r -y -9 $(top_builddir)/vlc-$(VERSION).zip $(top_builddir)/vlc-$(VERSION)
86
87 package-macosx-framework-zip:
88         mkdir -p $(top_builddir)/vlckit-$(VERSION)/Goodies/
89         cp -R $(srcdir)/projects/macosx/framework/build/Debug/VLCKit.framework $(top_builddir)/vlckit-$(VERSION)/
90         cd $(srcdir); cp AUTHORS COPYING README THANKS NEWS $(abs_top_builddir)/vlckit-$(VERSION)/Goodies/
91         zip -r -y -9 $(top_builddir)/vlckit-$(VERSION).zip $(top_builddir)/vlckit-$(VERSION)
92
93 package-translations:
94         mkdir -p "$(srcdir)/vlc-translations-$(VERSION)"
95         for i in `cat "$(top_srcdir)/po/LINGUAS"`; do \
96           cp "$(srcdir)/po/$${i}.po" "$(srcdir)/vlc-translations-$(VERSION)/" ; \
97         done
98         cp "$(srcdir)/doc/translations.txt" "$(srcdir)/vlc-translations-$(VERSION)/README.txt"
99
100         echo "#!/bin/sh" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
101         echo "" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
102         echo 'if test $$# != 1; then' >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
103         echo "  echo \"Usage: convert-po.sh <.po file>\"" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
104         echo "  exit 1" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
105         echo "fi" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
106         echo "" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
107         echo 'msgfmt --statistics -o vlc.mo $$1' >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
108
109         $(AMTAR) chof - $(srcdir)/vlc-translations-$(VERSION) \
110           | GZIP=$(GZIP_ENV) gzip -c >$(srcdir)/vlc-translations-$(VERSION).tar.gz
111
112 .PHONY: package-macosx package-macosx-zip package-macosx-framework-zip package-translations