package.mak 6.02 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
Rafaël Carré's avatar
Rafaël Carré committed
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
Marvin Scholz's avatar
Marvin Scholz committed
21
	## Copy Info.plist and convert to binary
22
	cp -R $(top_builddir)/share/macosx/Info.plist $@/Contents/
Marvin Scholz's avatar
Marvin Scholz committed
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
Marvin Scholz's avatar
Marvin Scholz committed
35
	## Copy lua scripts
36
	cp -r "$(prefix)/share/vlc/lua" $@/Contents/MacOS/share/
37
	cp -r "$(prefix)/lib/vlc/lua" $@/Contents/MacOS/
38
endif
39
	## HRTFs
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
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/
Marvin Scholz's avatar
Marvin Scholz committed
44
	## Copy translations
45
	cp -r "$(prefix)/share/locale" $@/Contents/MacOS/share/
Rafaël Carré's avatar
Rafaël Carré committed
46
	printf "APPLVLC#" >| $@/Contents/PkgInfo
47 48 49 50 51 52 53 54
	## 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 \;
	## Install binary
	cp $(prefix)/bin/vlc $@/Contents/MacOS/VLC
55 56 57 58 59
	## Generate plugin cache
	bin/vlc-cache-gen $@/Contents/MacOS/plugins
	find $@ -type d -exec chmod ugo+rx '{}' \;
	find $@ -type f -exec chmod ugo+r '{}' \;

60

61
package-macosx: VLC.app
62
	rm -f "$(top_builddir)/vlc-$(VERSION).dmg"
Marvin Scholz's avatar
Marvin Scholz committed
63 64 65 66 67 68 69 70 71
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
72
	cp -Rp "$(top_builddir)/VLC.app" "$(top_builddir)/vlc-$(VERSION)/VLC.app"
Marvin Scholz's avatar
Marvin Scholz committed
73 74 75 76 77 78
	## 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
79
	rm -rf "$(top_builddir)/vlc-$(VERSION)"
Marvin Scholz's avatar
Marvin Scholz committed
80
endif
81

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

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

101 102
package-translations:
	mkdir -p "$(srcdir)/vlc-translations-$(VERSION)"
Rafaël Carré's avatar
Rafaël Carré committed
103 104
	for i in `cat "$(top_srcdir)/po/LINGUAS"`; do \
	  cp "$(srcdir)/po/$${i}.po" "$(srcdir)/vlc-translations-$(VERSION)/" ; \
105
	done
Rafaël Carré's avatar
Rafaël Carré committed
106
	cp "$(srcdir)/doc/translations.txt" "$(srcdir)/vlc-translations-$(VERSION)/README.txt"
107 108 109 110 111 112 113 114 115 116 117 118 119

	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

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

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

EXTRA_DIST += \
	extras/package/macosx/build.sh \
	extras/package/macosx/codesign.sh \
	extras/package/macosx/configure.sh \
Marvin Scholz's avatar
Marvin Scholz committed
130 131 132
	extras/package/macosx/dmg/dmg_settings.py \
	extras/package/macosx/dmg/disk_image.icns \
	extras/package/macosx/dmg/background.tiff \
133
	extras/package/macosx/asset_sources/vlc_app_icon.svg \
134
	extras/package/macosx/VLC.entitlements \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
135
	extras/package/macosx/VLC.xcodeproj/project.pbxproj