package.mak 6.19 KB
Newer Older
1 2 3 4 5 6 7
if HAVE_DARWIN
noinst_DATA = pseudo-bundle
endif

# Symlink a pseudo-bundle
pseudo-bundle:
	$(MKDIR_P) $(top_builddir)/bin/Contents/Resources/
8
	$(LN_S) -hf $(abs_top_builddir)/modules/gui/macosx/UI $(top_builddir)/bin/Contents/Resources/Base.lproj
9 10
	$(LN_S) -hf $(abs_top_builddir)/share/macosx/Info.plist $(top_builddir)/bin/Contents/Info.plist
	$(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 18
	## Copy Contents
	cp -R $(prefix)/share/macosx/ $@
19
	## Copy .strings file and .nib files
20
	cp -R $(top_builddir)/modules/gui/macosx/UI $@/Contents/Resources/Base.lproj
21
	## Copy Info.plist and convert to binary
22
	cp -R $(top_builddir)/share/macosx/Info.plist $@/Contents/
23
	xcrun plutil -convert binary1 $@/Contents/Info.plist
24 25 26
	## Create Frameworks dir and copy required ones
	mkdir -p $@/Contents/Frameworks
	cp -R $(CONTRIB_DIR)/Frameworks/Growl.framework $@/Contents/Frameworks
27
if HAVE_SPARKLE
28
	cp -R $(CONTRIB_DIR)/Frameworks/Sparkle.framework $@/Contents/Frameworks
29
endif
30
if HAVE_BREAKPAD
31
	cp -R $(CONTRIB_DIR)/Frameworks/Breakpad.framework $@/Contents/Frameworks
32
endif
33
	mkdir -p $@/Contents/MacOS/share/
34
if BUILD_LUA
35
	## Copy lua scripts
36
	cp -r "$(pkgdatadir)/lua" $@/Contents/MacOS/share/
37
	cp -r "$(pkglibexecdir)/lua" $@/Contents/MacOS/
38
endif
39
	## HRTFs
40
	cp -r $(srcdir)/share/hrtfs $@/Contents/MacOS/share/
41 42
	## Copy some other stuff (?)
	mkdir -p $@/Contents/MacOS/include/
43
	(cd "$(prefix)/include" && $(AMTAR) -c --exclude "plugins" vlc) | $(AMTAR) -x -C $@/Contents/MacOS/include/
44
	## Copy translations
45
	test -d "$(prefix)/share/locale" && cp -r "$(prefix)/share/locale" $@/Contents/MacOS/share/ || true
46
	printf "APPLVLC#" >| $@/Contents/PkgInfo
47 48 49 50 51 52
	## Copy libs
	mkdir -p $@/Contents/MacOS/lib
	find $(prefix)/lib -name 'libvlc*.dylib' -maxdepth 1 -exec cp -a {} $@/Contents/MacOS/lib \;
	## Copy plugins
	mkdir -p $@/Contents/MacOS/plugins
	find $(prefix)/lib/vlc/plugins -name 'lib*_plugin.dylib' -maxdepth 2 -exec cp -a {} $@/Contents/MacOS/plugins \;
53 54
	## Copy libbluray jar
	find "$(CONTRIB_DIR)/share/java/" -name 'libbluray-j2se-*.jar' -maxdepth 1 -exec cp -a {} $@/Contents/MacOS/plugins \;
55 56
	## Install binary
	cp $(prefix)/bin/vlc $@/Contents/MacOS/VLC
57 58 59 60 61
	## Generate plugin cache
	bin/vlc-cache-gen $@/Contents/MacOS/plugins
	find $@ -type d -exec chmod ugo+rx '{}' \;
	find $@ -type f -exec chmod ugo+r '{}' \;

62

63
package-macosx: VLC.app
64
	rm -f "$(top_builddir)/vlc-$(VERSION).dmg"
65 66 67 68 69 70 71 72 73
if HAVE_DMGBUILD
	@echo "Packaging fancy DMG using dmgbuild"
	cd "$(top_srcdir)/extras/package/macosx/dmg" && dmgbuild -s "dmg_settings.py" \
		-D app="$(abs_top_builddir)/VLC.app" "VLC Media Player" "$(abs_top_builddir)/vlc-$(VERSION).dmg"
else !HAVE_DMGBUILD
	@echo "Packaging non-fancy DMG"
	## Create directory for DMG contents
	mkdir -p "$(top_builddir)/vlc-$(VERSION)"
	## Copy contents
74
	cp -Rp "$(top_builddir)/VLC.app" "$(top_builddir)/vlc-$(VERSION)/VLC.app"
75 76 77 78 79 80
	## Symlink to Applications so users can easily drag-and-drop the App to it
	$(LN_S) -f /Applications "$(top_builddir)/vlc-$(VERSION)/"
	## Create DMG
	hdiutil create -srcfolder "$(top_builddir)/vlc-$(VERSION)" -volname "VLC Media Player" \
		-format UDBZ -o "$(top_builddir)/vlc-$(VERSION).dmg"
	## Cleanup
81
	rm -rf "$(top_builddir)/vlc-$(VERSION)"
82
endif
83

84
package-macosx-zip: VLC.app
85
	rm -f "$(top_builddir)/vlc-$(VERSION).zip"
86
	mkdir -p $(top_builddir)/vlc-$(VERSION)/Goodies/
87
	cp -Rp $(top_builddir)/VLC.app $(top_builddir)/vlc-$(VERSION)/VLC.app
88
	cd $(srcdir); cp -R AUTHORS COPYING README THANKS NEWS $(abs_top_builddir)/vlc-$(VERSION)/Goodies/
89
	zip -r -y -9 $(top_builddir)/vlc-$(VERSION).zip $(top_builddir)/vlc-$(VERSION)
90
	rm -rf "$(top_builddir)/vlc-$(VERSION)"
91

92 93 94
package-macosx-release:
	rm -f "$(top_builddir)/vlc-$(VERSION)-release.zip"
	mkdir -p $(top_builddir)/vlc-$(VERSION)-release
95
	cp -Rp $(top_builddir)/VLC.app $(top_builddir)/vlc-$(VERSION)-release/
96 97
	cp $(srcdir)/extras/package/macosx/dmg/* $(top_builddir)/vlc-$(VERSION)-release/
	cp "$(srcdir)/extras/package/macosx/codesign.sh" $(top_builddir)/vlc-$(VERSION)-release/
98
	cp "$(pkglibexecdir)/vlc-cache-gen" $(top_builddir)/vlc-$(VERSION)-release/
99
	install_name_tool -add_rpath "@executable_path/VLC.app/Contents/MacOS/lib" $(top_builddir)/vlc-$(VERSION)-release/vlc-cache-gen
100 101 102
	zip -r -y -9 $(top_builddir)/vlc-$(VERSION)-release.zip $(top_builddir)/vlc-$(VERSION)-release
	rm -rf "$(top_builddir)/vlc-$(VERSION)-release"

103 104
package-translations:
	mkdir -p "$(srcdir)/vlc-translations-$(VERSION)"
105 106
	for i in `cat "$(top_srcdir)/po/LINGUAS"`; do \
	  cp "$(srcdir)/po/$${i}.po" "$(srcdir)/vlc-translations-$(VERSION)/" ; \
107
	done
108
	cp "$(srcdir)/doc/translations.txt" "$(srcdir)/vlc-translations-$(VERSION)/README.txt"
109 110 111 112 113 114 115 116 117 118 119 120 121

	echo "#!/bin/sh" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
	echo "" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
	echo 'if test $$# != 1; then' >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
	echo "	echo \"Usage: convert-po.sh <.po file>\"" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
	echo "	exit 1" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
	echo "fi" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
	echo "" >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"
	echo 'msgfmt --statistics -o vlc.mo $$1' >>"$(srcdir)/vlc-translations-$(VERSION)/convert.po.sh"

	$(AMTAR) chof - $(srcdir)/vlc-translations-$(VERSION) \
	  | GZIP=$(GZIP_ENV) gzip -c >$(srcdir)/vlc-translations-$(VERSION).tar.gz

122
.PHONY: package-macosx package-macosx-zip package-macosx-release package-translations pseudo-bundle
123 124 125 126 127 128 129 130 131

###############################################################################
# Mac OS X project
###############################################################################

EXTRA_DIST += \
	extras/package/macosx/build.sh \
	extras/package/macosx/codesign.sh \
	extras/package/macosx/configure.sh \
132 133 134
	extras/package/macosx/dmg/dmg_settings.py \
	extras/package/macosx/dmg/disk_image.icns \
	extras/package/macosx/dmg/background.tiff \
135
	extras/package/macosx/asset_sources/vlc_app_icon.svg \
136
	extras/package/macosx/VLC.entitlements \
137
	extras/package/macosx/VLC.xcodeproj/project.pbxproj