macOS: Remove unnecessary asset sources
[vlc.git] / extras / package / macosx / package.mak
1 if HAVE_DARWIN
2 noinst_DATA = pseudo-bundle
3 endif
4
5 # Symlink a pseudo-bundle
6 pseudo-bundle:
7         $(MKDIR_P) $(top_builddir)/bin/Contents/Resources/
8         $(LN_S) -hf $(abs_top_builddir)/modules/gui/macosx/UI $(top_builddir)/bin/Contents/Resources/English.lproj
9         $(LN_S) -hf $(abs_top_builddir)/share/macosx/Info.plist $(top_builddir)/bin/Contents/Info.plist
10         $(LN_S) -hf $(CONTRIB_DIR)/Frameworks
11         cd $(top_builddir)/bin/Contents/Resources/ && find $(abs_top_srcdir)/modules/gui/macosx/Resources/ -type f -exec $(LN_S) -f {} \;
12
13 # VLC.app for packaging and giving it to your friends
14 # use package-macosx to get a nice dmg
15 VLC.app: install
16         rm -Rf $@
17         ## Copy Contents
18         cp -R $(prefix)/share/macosx/ $@
19         ## Copy .strings file
20         cp -R $(top_builddir)/modules/gui/macosx/UI/InfoPlist.strings $@/Contents/Resources/UI
21         ## Rename interface files (UI) folder
22         mv $@/Contents/Resources/UI $@/Contents/Resources/English.lproj
23         ## Copy Info.plist and convert to binary
24         cp -R $(top_builddir)/share/macosx/Info.plist $@/Contents/
25         xcrun plutil -convert binary1 $@/Contents/Info.plist
26         ## Create Frameworks dir and copy required ones
27         mkdir -p $@/Contents/Frameworks
28         cp -R $(CONTRIB_DIR)/Frameworks/Growl.framework $@/Contents/Frameworks
29 if HAVE_SPARKLE
30         cp -R $(CONTRIB_DIR)/Frameworks/Sparkle.framework $@/Contents/Frameworks
31 endif
32 if HAVE_BREAKPAD
33         cp -R $(CONTRIB_DIR)/Frameworks/Breakpad.framework $@/Contents/Frameworks
34 endif
35         mkdir -p $@/Contents/MacOS/share/locale/
36 if BUILD_LUA
37         ## Copy lua scripts
38         cp -r "$(prefix)/lib/vlc/lua" "$(prefix)/share/vlc/lua" $@/Contents/MacOS/share/
39 endif
40         ## Copy some other stuff (?)
41         mkdir -p $@/Contents/MacOS/include/
42         (cd "$(prefix)/include" && $(AMTAR) -c --exclude "plugins" vlc) | $(AMTAR) -x -C $@/Contents/MacOS/include/
43         ## Copy translations
44         cat $(top_srcdir)/po/LINGUAS | while read i; do \
45           $(INSTALL) -d $@/Contents/MacOS/share/locale/$${i}/LC_MESSAGES ; \
46           $(INSTALL) $(srcdir)/po/$${i}.gmo $@/Contents/MacOS/share/locale/$${i}/LC_MESSAGES/vlc.mo; \
47           mkdir -p $@/Contents/Resources/$${i}.lproj/ ; \
48           $(LN_S) -f ../English.lproj/InfoPlist.strings ../English.lproj/MainMenu.nib \
49                 $@/Contents/Resources/$${i}.lproj/ ; \
50         done
51         printf "APPLVLC#" >| $@/Contents/PkgInfo
52         ## Copy libs
53         mkdir -p $@/Contents/MacOS/lib
54         find $(prefix)/lib -name 'libvlc*.dylib' -maxdepth 1 -exec cp -a {} $@/Contents/MacOS/lib \;
55         ## Copy plugins
56         mkdir -p $@/Contents/MacOS/plugins
57         find $(prefix)/lib/vlc/plugins -name 'lib*_plugin.dylib' -maxdepth 2 -exec cp -a {} $@/Contents/MacOS/plugins \;
58         ## Install binary
59         cp $(prefix)/bin/vlc $@/Contents/MacOS/VLC
60         ## Generate plugin cache
61         bin/vlc-cache-gen $@/Contents/MacOS/plugins
62         find $@ -type d -exec chmod ugo+rx '{}' \;
63         find $@ -type f -exec chmod ugo+r '{}' \;
64
65
66 package-macosx: VLC.app
67 if HAVE_DMGBUILD
68         @echo "Packaging fancy DMG using dmgbuild"
69         cd "$(top_srcdir)/extras/package/macosx/dmg" && dmgbuild -s "dmg_settings.py" \
70                 -D app="$(abs_top_builddir)/VLC.app" "VLC Media Player" "$(abs_top_builddir)/vlc-$(VERSION).dmg"
71 else !HAVE_DMGBUILD
72         @echo "Packaging non-fancy DMG"
73         ## Create directory for DMG contents
74         mkdir -p "$(top_builddir)/vlc-$(VERSION)"
75         ## Copy contents
76         cp -R "$(top_builddir)/VLC.app" "$(top_builddir)/vlc-$(VERSION)/VLC.app"
77         ## Symlink to Applications so users can easily drag-and-drop the App to it
78         $(LN_S) -f /Applications "$(top_builddir)/vlc-$(VERSION)/"
79         ## Create DMG
80         hdiutil create -srcfolder "$(top_builddir)/vlc-$(VERSION)" -volname "VLC Media Player" \
81                 -format UDBZ -o "$(top_builddir)/vlc-$(VERSION).dmg"
82         ## Cleanup
83         rm -rf "$(top_builddir)/vlc-$(VERSION)"
84 endif
85
86 package-macosx-zip: VLC.app
87         mkdir -p $(top_builddir)/vlc-$(VERSION)/Goodies/
88         cp -R $(top_builddir)/VLC.app $(top_builddir)/vlc-$(VERSION)/VLC.app
89         cd $(srcdir); cp -R AUTHORS COPYING README THANKS NEWS $(abs_top_builddir)/vlc-$(VERSION)/Goodies/
90         zip -r -y -9 $(top_builddir)/vlc-$(VERSION).zip $(top_builddir)/vlc-$(VERSION)
91         rm -rf "$(top_builddir)/vlc-$(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-translations pseudo-bundle
113
114 ###############################################################################
115 # Mac OS X project
116 ###############################################################################
117
118 EXTRA_DIST += \
119         extras/package/macosx/build.sh \
120         extras/package/macosx/codesign.sh \
121         extras/package/macosx/configure.sh \
122         extras/package/macosx/dmg/dmg_settings.py \
123         extras/package/macosx/dmg/disk_image.icns \
124         extras/package/macosx/dmg/background.tiff \
125         extras/package/macosx/asset_sources/vlc_app_icon.svg \
126         extras/package/macosx/VLC.entitlements \
127         extras/package/macosx/VLC.xcodeproj/project.pbxproj