Commit e67f216b authored by Rafaël Carré's avatar Rafaël Carré

win32 package: simplify / cleanup

parent 0fb207f2
...@@ -3,10 +3,13 @@ BUILT_SOURCES_distclean += \ ...@@ -3,10 +3,13 @@ BUILT_SOURCES_distclean += \
extras/package/win32/vlc.win32.nsi extras/package/win32/spad.nsi extras/package/win32/vlc.win32.nsi extras/package/win32/spad.nsi
endif endif
win32_destdir=$(top_builddir)/vlc-$(VERSION) win32_destdir=$(abs_top_builddir)/vlc-$(VERSION)
win32_debugdir=$(top_builddir)/symbols-$(VERSION) win32_debugdir=$(abs_top_builddir)/symbols-$(VERSION)
win32_xpi_destdir=$(win32_destdir)/vlc-plugin win32_xpi_destdir=$(win32_destdir)/vlc-plugin
7Z_OPTS=-t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on
if HAVE_WINCE if HAVE_WINCE
build-npapi: build-npapi:
touch $@ touch $@
...@@ -20,47 +23,41 @@ package-win-install: ...@@ -20,47 +23,41 @@ package-win-install:
$(MAKE) install $(MAKE) install
touch $@ touch $@
#Win-common is for win32 and wince
package-win-common: package-win-install build-npapi package-win-common: package-win-install build-npapi
mkdir -p "$(win32_debugdir)" mkdir -p "$(win32_destdir)"/
mkdir -p "$(win32_destdir)"
# Executables, major libs+manifests # Executables, major libs+manifests
find $(prefix) -maxdepth 4 \( -name "*$(LIBEXT)" -o -name "*$(EXEEXT)" \) -exec cp {} "$(win32_destdir)/" \; find $(prefix) -maxdepth 4 \( -name "*$(LIBEXT)" -o -name "*$(EXEEXT)" \) -exec cp {} "$(win32_destdir)/" \;
for file in $(top_srcdir)/extras/package/win32/vlc$(EXEEXT).manifest \ cd $(top_srcdir)/extras/package/win32 && cp vlc$(EXEEXT).manifest libvlc$(LIBEXT).manifest "$(win32_destdir)/"
$(top_srcdir)/extras/package/win32/libvlc$(LIBEXT).manifest; \
do cp $$file "$(win32_destdir)/" ; done;
# Text files and clean them # Text files, clean them from mail addresses
for file in AUTHORS THANKS ; \ for file in AUTHORS THANKS ; \
do sed 's/@/_AT_/' < "$(srcdir)/$$file" > "$(win32_destdir)/$${file}.txt" ; done; do sed 's/@/_AT_/' < "$(srcdir)/$$file" > "$(win32_destdir)/$${file}.txt"; \
done
for file in NEWS COPYING README; \ for file in NEWS COPYING README; \
do cp "$(srcdir)/$$file" "$(win32_destdir)/$${file}.txt"; done do cp "$(srcdir)/$$file" "$(win32_destdir)/$${file}.txt"; \
done
# Necessary icon
cp $(srcdir)/share/icons/vlc.ico $(win32_destdir) cp $(srcdir)/share/icons/vlc.ico $(win32_destdir)
# Locales
-cp -r $(prefix)/share/locale $(win32_destdir)
# Plugins
cp -r $(prefix)/lib/vlc/plugins $(win32_destdir) cp -r $(prefix)/lib/vlc/plugins $(win32_destdir)
-cp -r $(prefix)/share/locale $(win32_destdir)
if BUILD_LUA if BUILD_LUA
mkdir -p $(win32_destdir)/lua mkdir -p $(win32_destdir)/lua/
cp -r $(prefix)/lib/vlc/lua/* $(win32_destdir)/lua cp -r $(prefix)/lib/vlc/lua/* $(prefix)/share/vlc/lua/* $(win32_destdir)/lua/
cp -r $(prefix)/share/vlc/lua/* $(win32_destdir)/lua
endif endif
if BUILD_SKINS if BUILD_SKINS
rm -fr $(win32_destdir)/skins
cp -r $(prefix)/share/vlc/skins2 $(win32_destdir)/skins cp -r $(prefix)/share/vlc/skins2 $(win32_destdir)/skins
endif endif
if BUILD_OSDMENU if BUILD_OSDMENU
cp -r $(prefix)/share/vlc/osdmenu "$(win32_destdir)/osdmenu" cp -r $(prefix)/share/vlc/osdmenu "$(win32_destdir)/"
for file in $(win32_destdir)/osdmenu/*.cfg; do \ for file in $(win32_destdir)/osdmenu/*.cfg; do \
sed 's%share/osdmenu%osdmenu%g' "$$file" > "$$file.tmp" || exit $$? ; \ sed -i.orig -e 's%share/osdmenu%osdmenu%g' -e 's%/%\\%g' "$$file"; \
sed 's%/%\\%g' "$$file.tmp" > "$$file" || exit$$? ; \ rm -f -- "$${file}.orig"; \
rm -f -- "$$file.tmp"; \
done done
endif endif
...@@ -79,67 +76,67 @@ endif ...@@ -79,67 +76,67 @@ endif
cp "$${gcc_lib_dir}/libstdc++-6.dll" "$${gcc_lib_dir}/libgcc_s_sjlj-1.dll" "$(win32_destdir)/" ; true cp "$${gcc_lib_dir}/libstdc++-6.dll" "$${gcc_lib_dir}/libgcc_s_sjlj-1.dll" "$(win32_destdir)/" ; true
# SDK # SDK
mkdir -p "$(win32_destdir)/sdk/lib" mkdir -p "$(win32_destdir)/sdk/lib/"
cp -r $(prefix)/include "$(win32_destdir)/sdk" cp -r $(prefix)/include "$(win32_destdir)/sdk"
cp -r $(prefix)/lib/pkgconfig "$(win32_destdir)/sdk/lib" cp -r $(prefix)/lib/pkgconfig "$(win32_destdir)/sdk/lib"
for file in libvlc.dll.a libvlc.la libvlccore.dll.a libvlccore.la; do \ cd $(prefix)/lib && cp -rv libvlc.dll.a libvlc.la libvlccore.dll.a libvlccore.la "$(win32_destdir)/sdk/lib/"
cp -rv $(prefix)/lib/$$file "$(win32_destdir)/sdk/lib"; \
done
if !HAVE_WINCE if !HAVE_WINCE
$(DLLTOOL) -D libvlc.dll -l "$(win32_destdir)/sdk/lib/libvlc.lib" -d "$(top_builddir)/lib/.libs/libvlc.dll.def" "$(prefix)/bin/libvlc.dll" $(DLLTOOL) -D libvlc.dll -l "$(win32_destdir)/sdk/lib/libvlc.lib" -d "$(top_builddir)/lib/.libs/libvlc.dll.def" "$(prefix)/bin/libvlc.dll"
$(DLLTOOL) -D libvlccore.dll -l "$(win32_destdir)/sdk/lib/libvlccore.lib" -d "$(top_builddir)/src/.libs/libvlccore.dll.def" "$(prefix)/bin/libvlccore.dll" $(DLLTOOL) -D libvlccore.dll -l "$(win32_destdir)/sdk/lib/libvlccore.lib" -d "$(top_builddir)/src/.libs/libvlccore.dll.def" "$(prefix)/bin/libvlccore.dll"
if !HAVE_WIN64 if !HAVE_WIN64
mkdir -p "$(win32_destdir)/sdk/activex" mkdir -p "$(win32_destdir)/sdk/activex/"
cp $(top_builddir)/npapi-vlc/activex/README.TXT $(win32_destdir)/sdk/activex/README.TXT cd $(top_builddir)/npapi-vlc && cp activex/README.TXT share/test.html $(win32_destdir)/sdk/activex/
cp $(top_builddir)/npapi-vlc/share/test.html $(win32_destdir)/sdk/activex/
endif endif
endif endif
# Convert to DOS line endings
find $(win32_destdir) -type f \( -name "*xml" -or -name "*html" -or -name '*js' -or -name '*css' -or -name '*hosts' -or -iname '*txt' -or -name '*.cfg' -or -name '*.lua' \) -exec $(U2D) {} \; find $(win32_destdir) -type f \( -name "*xml" -or -name "*html" -or -name '*js' -or -name '*css' -or -name '*hosts' -or -iname '*txt' -or -name '*.cfg' -or -name '*.lua' \) -exec $(U2D) {} \;
#Enable DEP and ASLR for all the binaries # Enable DEP and ASLR for all the binaries
find $(win32_destdir) -type f \( -name '*$(LIBEXT)' -print -o -name '*$(EXEEXT)' -print \) -exec $(top_srcdir)/extras/package/win32/peflags.pl {} \; find $(win32_destdir) -type f \( -name '*$(LIBEXT)' -print -o -name '*$(EXEEXT)' -print \) -exec $(top_srcdir)/extras/package/win32/peflags.pl {} \;
# Remove cruft
find $(win32_destdir)/plugins/ -type f \( -name '*.a' -or -name '*.la' \) -exec rm -rvf {} \; find $(win32_destdir)/plugins/ -type f \( -name '*.a' -or -name '*.la' \) -exec rm -rvf {} \;
package-win-strip: package-win-common package-win-strip: package-win-common
find $(win32_destdir) -type f \( -name '*$(LIBEXT)' -or -name '*$(EXEEXT)' \) | while read i; \ mkdir -p "$(win32_debugdir)"/
cd $(win32_destdir); find . -type f \( -name '*$(LIBEXT)' -or -name '*$(EXEEXT)' \) | while read i; \
do if test -n "$$i" ; then \ do if test -n "$$i" ; then \
$(OBJCOPY) --only-keep-debug "$$i" "$$i.dbg"; \ $(OBJCOPY) --only-keep-debug "$$i" "$(win32_debugdir)/`basename $$i.dbg`"; \
$(OBJCOPY) --strip-all "$$i" ; \ $(OBJCOPY) --strip-all "$$i" ; \
$(OBJCOPY) --add-gnu-debuglink="$$i.dbg" "$$i" ; \ $(OBJCOPY) --add-gnu-debuglink="$(win32_debugdir)/`basename $$i.dbg`" "$$i" ; \
mv "$$i.dbg" "$(win32_debugdir)"; \
fi ; \ fi ; \
done done
package-win32-webplugin-common: package-win-strip package-win32-webplugin-common: package-win-strip
mkdir -p "$(win32_xpi_destdir)/plugins" cp -r $(win32_destdir)/plugins/ "$(win32_xpi_destdir)/"
find $(prefix) -maxdepth 4 -name "*$(LIBEXT)" -exec cp {} "$(win32_xpi_destdir)/" \; find $(prefix) -maxdepth 4 -name "*$(LIBEXT)" -exec cp {} "$(win32_xpi_destdir)/" \;
cp $(top_builddir)/npapi-vlc/npapi/npvlc.dll.manifest "$(win32_xpi_destdir)/plugins" cp $(top_builddir)/npapi-vlc/npapi/npvlc.dll.manifest "$(win32_xpi_destdir)/plugins/"
cp "$(top_srcdir)/extras/package/win32/libvlc.dll.manifest" "$(win32_xpi_destdir)/plugins" cp "$(top_srcdir)/extras/package/win32/libvlc.dll.manifest" "$(win32_xpi_destdir)/plugins/"
cp -r $(win32_destdir)/plugins/ "$(win32_xpi_destdir)/plugins" rm -rf "$(win32_xpi_destdir)/plugins/*qt*"
rm -rf "$(win32_xpi_destdir)/plugins/plugins/*qt*" rm -rf "$(win32_xpi_destdir)/plugins/*skins*"
rm -rf "$(win32_xpi_destdir)/plugins/plugins/*skins*"
package-win32-xpi: package-win32-webplugin-common package-win32-xpi: package-win32-webplugin-common
cp $(top_builddir)/npapi-vlc/npapi/install.rdf "$(win32_xpi_destdir)" cp $(top_builddir)/npapi-vlc/npapi/install.rdf "$(win32_xpi_destdir)"
cd $(win32_xpi_destdir) && zip -r "../vlc-$(VERSION).xpi" install.rdf plugins cd $(win32_xpi_destdir) && zip -r "../vlc-$(VERSION).xpi" install.rdf plugins
package-win32-crx: package-win32-webplugin-common package-win32-crx: package-win32-webplugin-common
cp $(top_builddir)/npapi-vlc/npapi/manifest.json "$(win32_xpi_destdir)" cp $(top_builddir)/npapi-vlc/npapi/manifest.json "$(win32_xpi_destdir)"
crxmake --pack-extension "$(win32_xpi_destdir)" \ crxmake --pack-extension "$(win32_xpi_destdir)" \
--extension-output "$(win32_destdir)/vlc-$(VERSION).crx" --ignore-file install.rdf --extension-output "$(win32_destdir)/vlc-$(VERSION).crx" --ignore-file install.rdf
package-win32-exe: package-win-strip package-win32-exe: package-win-strip
# Script installer # Script installer
cp "$(top_builddir)/extras/package/win32/vlc.win32.nsi" "$(win32_destdir)/" cd "$(top_builddir)/extras/package/win32" && cp vlc.win32.nsi spad.nsi "$(win32_destdir)/"
cp "$(top_builddir)/extras/package/win32/spad.nsi" "$(win32_destdir)/" cp -r $(srcdir)/extras/package/win32/languages/ "$(win32_destdir)/"
mkdir -p "$(win32_destdir)/languages" mkdir -p "$(win32_destdir)/NSIS/"
cp $(srcdir)/extras/package/win32/languages/*.nsh "$(win32_destdir)/languages/" cd "$(top_srcdir)/extras/package/win32/" && cp UAC.dll UAC.nsh "$(win32_destdir)/NSIS"
# Copy the UAC NSIS plugin
mkdir -p "$(win32_destdir)/NSIS"
cp "$(top_srcdir)/extras/package/win32/UAC.nsh" "$(win32_destdir)/NSIS"
cp "$(top_srcdir)/extras/package/win32/UAC.dll" "$(win32_destdir)/NSIS"
# Create package # Create package
if makensis -VERSION >/dev/null 2>&1; then \ if makensis -VERSION >/dev/null 2>&1; then \
...@@ -165,13 +162,13 @@ package-win32-debug-zip: package-win-common ...@@ -165,13 +162,13 @@ package-win32-debug-zip: package-win-common
zip -r -9 vlc-$(VERSION)-win32-debug.zip vlc-$(VERSION) zip -r -9 vlc-$(VERSION)-win32-debug.zip vlc-$(VERSION)
package-win32-7zip: package-win-strip package-win32-7zip: package-win-strip
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on vlc-$(VERSION)-win32.7z vlc-$(VERSION) 7z a $(7Z_OPTS) vlc-$(VERSION)-win32.7z vlc-$(VERSION)
package-win32-debug-7zip: package-win-common package-win32-debug-7zip: package-win-common
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on vlc-$(VERSION)-win32-debug.7z vlc-$(VERSION) 7z a $(7Z_OPTS) vlc-$(VERSION)-win32-debug.7z vlc-$(VERSION)
package-win32-cleanup: package-win32-cleanup:
rm -Rf $(win32_destdir) $(win32_debugdir) rm -Rf $(win32_destdir) $(win32_debugdir) $(win32_xpi_destdir)
package-win32: package-win32-zip package-win32-7zip package-win32-exe package-win32-xpi package-win32: package-win32-zip package-win32-7zip package-win32-exe package-win32-xpi
...@@ -186,4 +183,3 @@ package-wince: package-win-strip ...@@ -186,4 +183,3 @@ package-wince: package-win-strip
zip -r -9 vlc-$(VERSION)-wince.zip vlc-$(VERSION) zip -r -9 vlc-$(VERSION)-wince.zip vlc-$(VERSION)
.PHONY: package-win-install package-win-common package-win-strip package-win32-webplugin-common package-win32-xpi package-win32-crx package-win32-exe package-win32-zip package-win32-debug-zip package-win32-7zip package-win32-debug-7zip package-win32-cleanup package-win32 package-win32-debug package-wince .PHONY: package-win-install package-win-common package-win-strip package-win32-webplugin-common package-win32-xpi package-win32-crx package-win32-exe package-win32-zip package-win32-debug-zip package-win32-7zip package-win32-debug-7zip package-win32-cleanup package-win32 package-win32-debug package-wince
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment