package.mak 5.63 KB
Newer Older
1 2 3 4 5 6 7
if HAVE_DARWIN
if BUILD_MACOSX_VLC_APP
# Create the MacOS X app
noinst_DATA = VLC.app
endif
endif

8
# This is just for development purposes.
9 10
# The resulting VLC-dev.app will only run in this tree.
VLC-dev.app: VLC-tmp
Rafaël Carré's avatar
Rafaël Carré committed
11
	rm -Rf $@
12
	cp -R VLC-tmp $@
13
	$(INSTALL) -m 0755 $(top_builddir)/bin/.libs/vlc-osx $@/Contents/MacOS/VLC
Rafaël Carré's avatar
Rafaël Carré committed
14 15
	$(LN_S) -f ../../../modules $@/Contents/MacOS/plugins

16
# VLC.app for packaging and giving it to your friends
17
# use package-macosx to get a nice dmg
18
VLC.app: VLC-tmp
Rafaël Carré's avatar
Rafaël Carré committed
19
	rm -Rf $@
20
	cp -R VLC-tmp $@
21
	PRODUCT="$@" ACTION="release-makefile" src_dir=$(srcdir) build_dir=$(top_builddir) sh $(srcdir)/extras/package/macosx/build-package.sh
22
	bin/vlc-cache-gen $@/Contents/MacOS/plugins
Rafaël Carré's avatar
Rafaël Carré committed
23 24
	find $@ -type d -exec chmod ugo+rx '{}' \;
	find $@ -type f -exec chmod ugo+r '{}' \;
25

26
VLC-tmp:
Marvin Scholz's avatar
Marvin Scholz committed
27
	$(AM_V_GEN)for i in src lib share modules/gui/macosx; do \
Rafaël Carré's avatar
Rafaël Carré committed
28 29
		(cd $$i && $(MAKE) $(AM_MAKEFLAGS) install $(silentstd)); \
	done
Marvin Scholz's avatar
Marvin Scholz committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
	## Create directories
	mkdir -p $@/Contents/Resources/English.lproj
	mkdir -p $@/Contents/MacOS/share/locale/
	mkdir -p $@/Contents/MacOS/include/
	mkdir -p $@/Contents/Frameworks/
	## Copy Info.plist and convert to binary
	cp -R $(top_builddir)/modules/gui/macosx/Resources/Info.plist $@/Contents/
	xcrun plutil -convert binary1 $@/Contents/Info.plist
	## Copy interface files (NIBs)
	cp -R $(top_builddir)/modules/gui/macosx/UI/ $@/Contents/Resources/English.lproj
	## Copy resources
	cp -R $(prefix)/share/macosx/ $@/Contents/Resources
	## Copy InfoPlist.strings file
	cp $(top_builddir)/modules/gui/macosx/Resources/InfoPlist.strings $@/Contents/Resources/English.lproj/
	## Copy frameworks
	cp -R $(CONTRIB_DIR)/Growl.framework $@/Contents/Frameworks/
46 47 48
if HAVE_SPARKLE
	cp -R $(CONTRIB_DIR)/Sparkle.framework $@/Contents/Frameworks/
endif
49 50 51
if HAVE_BREAKPAD
	cp -R $(CONTRIB_DIR)/Breakpad.framework $@/Contents/Frameworks/
endif
52
if BUILD_LUA
Marvin Scholz's avatar
Marvin Scholz committed
53
	## Copy lua scripts
Rafaël Carré's avatar
Rafaël Carré committed
54
	cp -r "$(prefix)/lib/vlc/lua" "$(prefix)/share/vlc/lua" $@/Contents/MacOS/share/
55
endif
56
	(cd "$(prefix)/include" && $(AMTAR) -c --exclude "plugins" vlc) | $(AMTAR) -x -C $@/Contents/MacOS/include/
Marvin Scholz's avatar
Marvin Scholz committed
57
	## Copy translations
58
	cat $(top_srcdir)/po/LINGUAS | while read i; do \
Rafaël Carré's avatar
Rafaël Carré committed
59 60 61
	  $(INSTALL) -d $@/Contents/MacOS/share/locale/$${i}/LC_MESSAGES ; \
	  $(INSTALL) $(srcdir)/po/$${i}.gmo $@/Contents/MacOS/share/locale/$${i}/LC_MESSAGES/vlc.mo; \
	  mkdir -p $@/Contents/Resources/$${i}.lproj/ ; \
Rafaël Carré's avatar
Rafaël Carré committed
62
	  $(LN_S) -f ../English.lproj/InfoPlist.strings ../English.lproj/MainMenu.nib \
Rafaël Carré's avatar
Rafaël Carré committed
63
		$@/Contents/Resources/$${i}.lproj/ ; \
64
	done
Rafaël Carré's avatar
Rafaël Carré committed
65
	printf "APPLVLC#" >| $@/Contents/PkgInfo
66

67
package-macosx: VLC.app
Rafaël Carré's avatar
Rafaël Carré committed
68
	mkdir -p "$(top_builddir)/vlc-$(VERSION)/Goodies/"
69
	cp -R "$(top_builddir)/VLC.app" "$(top_builddir)/vlc-$(VERSION)/VLC.app"
Rafaël Carré's avatar
Rafaël Carré committed
70
	cd $(srcdir); cp AUTHORS COPYING README THANKS NEWS $(abs_top_builddir)/vlc-$(VERSION)/Goodies/
Rafaël Carré's avatar
Rafaël Carré committed
71
	$(LN_S) -f /Applications $(top_builddir)/vlc-$(VERSION)/
72
	rm -f "$(top_builddir)/vlc-$(VERSION)-rw.dmg"
Brendon Justin's avatar
Brendon Justin committed
73 74 75
	hdiutil create -verbose -srcfolder "$(top_builddir)/vlc-$(VERSION)" "$(top_builddir)/vlc-$(VERSION)-rw.dmg" -scrub -format UDRW
	mkdir -p ./mount
	hdiutil attach -readwrite -noverify -noautoopen -mountRoot ./mount "vlc-$(VERSION)-rw.dmg"
76
	-osascript "$(srcdir)"/extras/package/macosx/dmg_setup.scpt "vlc-$(VERSION)"
Brendon Justin's avatar
Brendon Justin committed
77
	hdiutil detach ./mount/"vlc-$(VERSION)"
78 79
# Make sure the image is not writable
# Note: We can't directly create a read only dmg as we do the bless stuff
Rafaël Carré's avatar
Rafaël Carré committed
80
	rm -f "$(top_builddir)/vlc-$(VERSION).dmg"
81 82
	hdiutil convert "$(top_builddir)/vlc-$(VERSION)-rw.dmg" -format UDBZ -o "$(top_builddir)/vlc-$(VERSION).dmg"
	ls -l "$(top_builddir)/vlc-$(VERSION).dmg"
83 84
	rm -f "$(top_builddir)/vlc-$(VERSION)-rw.dmg"
	rm -rf "$(top_builddir)/vlc-$(VERSION)"
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 94

package-translations:
	mkdir -p "$(srcdir)/vlc-translations-$(VERSION)"
Rafaël Carré's avatar
Rafaël Carré committed
95 96
	for i in `cat "$(top_srcdir)/po/LINGUAS"`; do \
	  cp "$(srcdir)/po/$${i}.po" "$(srcdir)/vlc-translations-$(VERSION)/" ; \
97
	done
Rafaël Carré's avatar
Rafaël Carré committed
98
	cp "$(srcdir)/doc/translations.txt" "$(srcdir)/vlc-translations-$(VERSION)/README.txt"
99 100 101 102 103 104 105 106 107 108 109 110 111

	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

112
.PHONY: package-macosx package-macosx-zip package-translations
113 114 115 116 117 118 119 120 121 122 123 124 125

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

EXTRA_DIST += \
	extras/package/macosx/build-package.sh \
	extras/package/macosx/build.sh \
	extras/package/macosx/codesign.sh \
	extras/package/macosx/configure.sh \
	extras/package/macosx/dmg_setup.scpt \
	extras/package/macosx/fullscreen_panel.svg \
	extras/package/macosx/vlc_status_icon.svg \
126
	extras/package/macosx/vlc_app_icon.svg \
127
	extras/package/macosx/VLC.entitlements \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
128
	extras/package/macosx/VLC.xcodeproj/project.pbxproj