spek

Acoustic spectrum analyser
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

commit 592b9055db6da8e3357cdcd936d2ecc87194c88a
parent e88efbe95965590d16b4ae1a111c4d18f1e8bbff
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Wed, 29 Aug 2012 21:27:13 -0700

win: Update bundle scripts

Build a single EXE version (issue 2)

Diffstat:
M.gitignore | 3+++
MMakefile.am | 10++++++----
Mconfigure.ac | 2+-
Ddist/README | 38--------------------------------------
Adist/README.md | 37+++++++++++++++++++++++++++++++++++++
Adist/win/README.md | 26++++++++++++++++++++++++++
Adist/win/bundle.bat | 21+++++++++++++++++++++
Mdist/win/bundle.sh | 132+++++++++++++++++++++++++++----------------------------------------------------
Mdist/win/spek.wxs.in | 23+++++++++--------------
9 files changed, 148 insertions(+), 144 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -1,7 +1,9 @@ *.a +*.exe *.msi *.o *.xz +*.zip *~ .DS_Store .deps @@ -19,6 +21,7 @@ depcomp dist/osx/Spek.app dist/osx/Spek.dmg dist/osx/spek.modules +dist/win/Spek dist/win/spek.wxs install-sh intltool-extract.in diff --git a/Makefile.am b/Makefile.am @@ -7,9 +7,6 @@ SUBDIRS = \ tests EXTRA_DIST = \ - intltool-extract.in \ - intltool-merge.in \ - intltool-update.in \ dist/osx/DS_Store \ dist/osx/Info.plist \ dist/osx/README.md \ @@ -19,13 +16,18 @@ EXTRA_DIST = \ dist/osx/launcher.sh \ dist/osx/spek.bundle \ dist/osx/spek.modules \ + dist/win/README.md \ dist/win/banner.bmp \ + dist/win/bundle.bat \ dist/win/bundle.sh \ dist/win/dialog.bmp \ dist/win/fix-msi.js \ dist/win/spek.ico \ dist/win/spek.rc \ - dist/win/spek.wxs + dist/win/spek.wxs \ + intltool-extract.in \ + intltool-merge.in \ + intltool-update.in DISTCLEANFILES = \ intltool-extract \ diff --git a/configure.ac b/configure.ac @@ -51,7 +51,7 @@ GETTEXT_PACKAGE=spek AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Gettext Package]) AC_SUBST(GETTEXT_PACKAGE) AM_GNU_GETTEXT_VERSION([0.18.1]) -AM_GNU_GETTEXT([external]) +AM_PO_SUBDIRS AC_CONFIG_FILES([ Makefile diff --git a/dist/README b/dist/README @@ -1,38 +0,0 @@ -Spek release checklist -============================================================================== - - * Bump the version number in configure.ac. - * `cd po && make update-po && tx push -s`. - * `tx pull -a` and commit with correct `--author`s. - * Review translations, fix things like missing mnemonics and line endings. - * Translate what I can, Ich spreek un peu по-русски. - * `tx pull -a`. - * Update the list of available languages, 80% or so will do: - * po/LINGUAS - * src/spek-preferences-dialog.vala - * dist/win/bundle.sh - * dist/osx/bundle.sh - * Update AUTHORS using `git log X.Y.. --pretty=format:"%an <%ae>" | sort -u`. - * Sync AUTHORS with the About dialogue. - * Update news in README.md. - * Update the website and debian/control's description with the new features. - * Update the manpage if necessary. - * Update sshots if there are user-visible changes. - * Update and sync wiki pages with the new version number and instructions. - * Update copyright year of touched code. - * Commit everything. - * Make sure `make distcheck` doesn't return errors. - * Prepare binaries for OSX and WIN, see README files in dist/*. - * Update FreeBSD, Debian and Ubuntu ports, see README files in dist/*. - * If anything has been changed, commit and re-make the tarball. - * Write the blog post, link from web/index.html, don't publish yet. - * Update web/index.html: bump version numbers, binary sizes and news. - * `git tag -a X.Y`. - * Upload the tarball + OSX and WIN binaries. - * Update the Ubuntu PPA. - * Request FreeBSD and Debian updates. - * Upload the website using `web/upload`. - * Publish the blog post. - * Send an announcement to linux-audio-announce and vala-list. - * Update the forum thread on what. - * Ping ArchLinux and Gentoo maintainers. diff --git a/dist/README.md b/dist/README.md @@ -0,0 +1,37 @@ +# Spek release checklist + + * Bump the version number in configure.ac. + * `cd po && make update-po && tx push -s`. + * `tx pull -a` and commit with correct `--author`s. + * Review translations, fix things like missing mnemonics and line endings. + * Translate what I can, Ich spreek un peu по-русски. + * `tx pull -a`. + * Update the list of available languages, 80% or so will do: + * po/LINGUAS + * src/spek-preferences-dialog.vala + * dist/win/bundle.sh + * dist/osx/bundle.sh + * Update AUTHORS using `git log X.Y.. --pretty=format:"%an <%ae>" | sort -u`. + * Sync AUTHORS with the About dialogue. + * Update news in README.md. + * Update the website and debian/control's description with the new features. + * Update the manpage if necessary. + * Update sshots if there are user-visible changes. + * Update and sync wiki pages with the new version number and instructions. + * Update copyright year of touched code. + * Commit everything. + * Make sure `make distcheck` doesn't return errors. + * Prepare binaries for OSX and WIN, see README files in dist/*. + * Update FreeBSD, Debian and Ubuntu ports, see README files in dist/*. + * If anything has been changed, commit and re-make the tarball. + * Write the blog post, link from web/index.html, don't publish yet. + * Update web/index.html: bump version numbers, binary sizes and news. + * `git tag -a X.Y`. + * Upload the tarball + OSX and WIN binaries. + * Update the Ubuntu PPA. + * Request FreeBSD and Debian updates. + * Upload the website using `web/upload`. + * Publish the blog post. + * Send an announcement to linux-audio-announce and vala-list. + * Update the forum thread on what. + * Ping ArchLinux and Gentoo maintainers. diff --git a/dist/win/README.md b/dist/win/README.md @@ -0,0 +1,26 @@ +# Building the Windows installer + +This is done in two steps: + + * Cross-compiling spek.exe using [MXE](http://mxe.cc/) + * Building the MSI package under Windows + +For the first step you can use any Unix-y environment. Set up +[MXE](http://mxe.cc/#tutorial), you can use the code from +[this repository](https://github.com/alexkay/mxe/tree/spek) or the official one. + +Build Spek dependencies: + +``` +% make pthreads ffmpeg wxwidgets +``` + +Build Spek, adjusting `bundle.sh` variables as necessary: + +``` +% ./dist/win/bundle.sh +``` + +For the second step, you will need a Windows box with +[WiX](http://wix.sourceforge.net/) installed. Copy over the entire `dist/win` +directory and run `bundle.bat`. diff --git a/dist/win/bundle.bat b/dist/win/bundle.bat @@ -0,0 +1,21 @@ +rem This script will build an MSI installer for Win32. +rem Check README.md in this directory for instructions. + +set WIX_PATH=c:\Program Files\Windows Installer XML v3.5\bin + +del spek.msi + +rem Generate a wxs for files in Spek +move Spek\spek.exe .\ +"%WIX_PATH%"\heat dir Spek -gg -ke -srd -cg Files -dr INSTALLLOCATION -template fragment -o files.wxs +move spek.exe Spek\ + +rem Make the MSI package +"%WIX_PATH%"\candle spek.wxs files.wxs +"%WIX_PATH%"\light -ext WixUIExtension.dll -b Spek spek.wixobj files.wixobj -o spek.msi +start /wait fix-msi.js spek.msi + +rem Clean up +del files.wxs +del *.wixobj +del *.wixpdb diff --git a/dist/win/bundle.sh b/dist/win/bundle.sh @@ -1,95 +1,54 @@ -#!/usr/bin/env bash - -# This script will build a ZIP archive and an MSI installer for Win32. -# It requires a fully functioning MinGW/MSYS environment. -# The script also depends on 7z and WiX. - -WIX_PATH=c:/Program\ Files/Windows\ Installer\ XML\ v3.5/bin -SZ_PATH=c:/Program\ Files/7-Zip - -pushd $(dirname $0)/../.. - -rm -fr dist/win/Spek -mkdir dist/win/Spek -rm dist/win/spek.{msi,zip} +#!/bin/sh + +# This script will cross-compile spek.exe, make a ZIP archive and prepare files +# for building an MSI installer under Windows. +# Check README.md in this directory for instructions. + +# Adjust these variables if necessary. +HOST=i686-pc-mingw32 +LANGUAGES="cs da de eo es fr it ja nl pl pt_BR ru sv uk zh_CN zh_TW" +MAKE=gmake +MXE=$(realpath $(dirname $0)/../../../mxe/usr/i686-pc-mingw32) +STRIP=$(which i686-pc-mingw32-strip) +UPX=$(which upx) +WINDRES=$(which i686-pc-mingw32-windres) +WX_CONFIG="$MXE"/bin/wx-config +ZIP=$(which zip) + +cd $(dirname $0)/../.. +rm -fr dist/win/build && mkdir dist/win/build # Compile the resource file -windres dist/win/spek.rc -O coff -o dist/win/spek.res +"$WINDRES" dist/win/spek.rc -O coff -o dist/win/spek.res mkdir -p src/dist/win && cp dist/win/spek.res src/dist/win/ -CFLAGS="-mwindows" LDFLAGS="dist/win/spek.res" ./configure --prefix=${PWD}/dist/win/Spek && make && make install - -cd dist/win/Spek - -urls=(\ -# GTK+ and its dependencies -"http://ftp.gnome.org/pub/gnome/binaries/win32/atk/1.32/atk_1.32.0-1_win32.zip" \ -"http://ftp.gnome.org/pub/gnome/binaries/win32/gdk-pixbuf/2.22/gdk-pixbuf_2.22.1-1_win32.zip" \ -"http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib_2.28.1-1_win32.zip" \ -"http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+_2.24.0-1_win32.zip" \ -"http://ftp.gnome.org/pub/gnome/binaries/win32/pango/1.28/pango_1.28.3-1_win32.zip" \ -"http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/cairo_1.10.2-1_win32.zip" \ -"http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/expat_2.0.1-1_win32.zip" \ -"http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/fontconfig_2.8.0-2_win32.zip" \ -"http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/freetype_2.4.4-1_win32.zip" \ -"http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip" \ -"http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/hicolor-icon-theme_0.10-1_win32.zip" \ -"http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libpng_1.4.3-1_win32.zip" \ -"http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/zlib_1.2.5-2_win32.zip" \ -) - -for url in ${urls[*]} -do - wget $url - if [ $? != 0 ]; then - echo "Can't get $url" - popd - exit 1 - fi - name=$(basename $url) - "$SZ_PATH"/7z x -y $name - rm $name +# Compile and strip spek.exe +LDFLAGS="dist/win/spek.res" ./configure \ + --host="$HOST" \ + --with-wx-config="$WX_CONFIG" \ + --prefix=${PWD}/dist/win/build && \ + "$MAKE" && \ + "$MAKE" install +"$STRIP" dist/win/build/bin/spek.exe +"$UPX" dist/win/build/bin/spek.exe + +# Copy files to the bundle +cd dist/win +rm -fr Spek && mkdir Spek +cp build/bin/spek.exe Spek/ +for lang in $LANGUAGES; do + mkdir -p Spek/"$lang" + cp build/lib/locale/"$lang"/LC_MESSAGES/spek.mo Spek/"$lang"/ + cp "$MXE"/share/locale/"$lang"/LC_MESSAGES/wxstd.mo Spek/"$lang"/ done +rm -fr build -# ffmpeg configure options: -# ./configure --disable-static --enable-shared --enable-gpl --enable-version3 --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-avdevice --disable-swscale --disable-postproc --enable-pthreads --disable-encoders --disable-muxers --disable-devices --disable-filters --enable-memalign-hack --enable-runtime-cpudetect --disable-debug --prefix=/usr - -cp /usr/bin/avcodec-53.dll bin/ -cp /usr/bin/avformat-53.dll bin/ -cp /usr/bin/avutil-51.dll bin/ - -# Clean up -mv bin/spek.exe ../ -mkdir share/locale_ -mv share/locale/{cs,da,de,eo,es,fr,it,ja,nl,pl,pt_BR,ru,sv,uk,zh_CN,zh_TW} share/locale_/ -rm -fr share/locale -mv share/locale_ share/locale -rm -fr doc -rm -fr presets -rm -fr manifest -rm bin/*.exe - -# Set the default GTK theme -echo "gtk-theme-name = \"MS-Windows\"" > etc/gtk-2.0/gtkrc - -cd .. - -# Generate a wxs for files in Spek -"$WIX_PATH"/heat dir Spek -gg -ke -srd -cg Files -dr INSTALLLOCATION -template fragment -o files.wxs +# Create a zip archive +rm -f spek.zip +"$ZIP" -r spek.zip Spek -# Make the MSI package -"$WIX_PATH"/candle spek.wxs files.wxs -"$WIX_PATH"/light -ext WixUIExtension.dll -b Spek spek.wixobj files.wixobj -o spek.msi -start fix-msi.js spek.msi +cd ../.. # Clean up -rm *.res -rm *.wixobj -rm *.wixpdb - -# Create a zip archive -mv spek.exe Spek/bin/ -cp spek.ico Spek/ -"$SZ_PATH"/7z a spek.zip Spek - -popd -\ No newline at end of file +rm -fr src/dist +rm dist/win/spek.res diff --git a/dist/win/spek.wxs.in b/dist/win/spek.wxs.in @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <?define ProductName = "Spek" ?> <?define Manufacturer = "Spek Project" ?> -<?define ProductVersion = "@VERSION@.0" ?> +<?define ProductVersion = "@VERSION@" ?> <?define UpgradeCode = "46D51DDF-5749-45E2-818B-1ACADF21C0D9" ?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="*" Name="$(var.ProductName)" Language="0" @@ -32,7 +32,7 @@ <Icon Id="ProgramIcon" SourceFile="spek.ico"/> <DirectoryRef Id="ProgramMenuSubfolder"> <Component Id="StartMenuShortcut" Guid="165DF12B-D970-49BC-B07B-880B62ABC308"> - <Shortcut Id="StartMenuShortcut" Name="$(var.ProductName)" Icon="ProgramIcon" Target="[INSTALLLOCATION]bin\spek.exe" WorkingDirectory="bin"/> + <Shortcut Id="StartMenuShortcut" Name="$(var.ProductName)" Icon="ProgramIcon" Target="[INSTALLLOCATION]spek.exe" WorkingDirectory="INSTALLLOCATION"/> <Shortcut Id="UninstallProduct" Name="Uninstall $(var.ProductName)" Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]"/> <RemoveFolder Id="ProgramMenuSubfolder" On="uninstall"/> <RegistryValue Root="HKCU" Key="Software\$(var.Manufacturer)\$(var.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/> @@ -40,7 +40,7 @@ </DirectoryRef> <DirectoryRef Id="DesktopFolder"> <Component Id="DesktopShortcut" Guid="ACCE1EDB-87E3-4FE5-B2BF-93113E767381"> - <Shortcut Id="DesktopShortcut" Name="$(var.ProductName)" Icon="ProgramIcon" Target="[INSTALLLOCATION]bin\spek.exe" WorkingDirectory="bin"/> + <Shortcut Id="DesktopShortcut" Name="$(var.ProductName)" Icon="ProgramIcon" Target="[INSTALLLOCATION]spek.exe" WorkingDirectory="INSTALLLOCATION"/> <RegistryValue Root="HKCU" Key="Software\$(var.Manufacturer)\$(var.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/> </Component> </DirectoryRef> @@ -54,27 +54,28 @@ <Directory Id="INSTALLLOCATION" Name="$(var.ProductName)"> <Component Id="Main" Guid="CD5121AD-F799-4796-9DB8-0C24CA0A4C8E"> <File Id="spek.ico" Name="spek.ico" Source="spek.ico" /> + <File Id="spek.exe" Name="spek.exe" Source="spek.exe" /> <!-- Capabilities keys for Vista/7 "Set Program Access and Defaults" --> <RegistryValue Root="HKLM" Key="SOFTWARE\Spek\Capabilities" Name="ApplicationDescription" Value="Acoustic Spectrum Analyser" Type="string" /> <RegistryValue Root="HKLM" Key="SOFTWARE\Spek\Capabilities" Name="ApplicationIcon" Value="[#spek.ico]" Type="string" /> <RegistryValue Root="HKLM" Key="SOFTWARE\Spek\Capabilities" Name="ApplicationName" Value="Spek" Type="string" /> <RegistryValue Root="HKLM" Key="SOFTWARE\Spek\Capabilities\DefaultIcon" Value="[#spek.ico]" Type="string" /> - <RegistryValue Root="HKLM" Key="SOFTWARE\Spek\Capabilities\shell\open\command" Value="&quot;[INSTALLLOCATION]bin\spek.exe&quot; &quot;%1&quot;" Type="string" /> + <RegistryValue Root="HKLM" Key="SOFTWARE\Spek\Capabilities\shell\open\command" Value="&quot;[INSTALLLOCATION]spek.exe&quot; &quot;%1&quot;" Type="string" /> <RegistryValue Root="HKLM" Key="SOFTWARE\RegisteredApplications" Name="Spek" Value="SOFTWARE\Spek\Capabilities" Type="string" /> <!-- App Paths to support Start,Run -> "spek" --> - <RegistryValue Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\spek.exe" Value="[INSTALLLOCATION]bin\spek.exe" Type="string" /> - <RegistryValue Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\spek.exe" Name="Path" Value="[INSTALLLOCATION]bin" Type="string" /> + <RegistryValue Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\spek.exe" Value="[INSTALLLOCATION]spek.exe" Type="string" /> + <RegistryValue Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\spek.exe" Name="Path" Value="[INSTALLLOCATION]" Type="string" /> <!-- Extend to the "open with" list + Win7 jump menu pinning --> <RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Applications\spek.exe" Value="Acoustic Spectrum Analyser" Type="string" /> <RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Applications\spek.exe" Name="FriendlyAppName" Value="Spek" Type="string" /> <RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Applications\spek.exe\DefaultIcon" Value="[#spek.ico]" Type="string" /> - <RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Applications\spek.exe\shell\open\command" Value="&quot;[INSTALLLOCATION]bin\spek.exe&quot; &quot;%1&quot;" Type="string" /> + <RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Applications\spek.exe\shell\open\command" Value="&quot;[INSTALLLOCATION]spek.exe&quot; &quot;%1&quot;" Type="string" /> <!-- Spek.Audio class --> <RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Spek.Audio" Value="Spek Audio File" KeyPath="yes" Type="string" /> <RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Spek.Audio" Name="FriendlyTypeName" Value="Spek Audio File" Type="string" /> <RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Spek.Audio\DefaultIcon" Value="[#spek.ico]" Type="string" /> <RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Spek.Audio\shell" Value="open" Type="string" /> - <RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Spek.Audio\shell\open\command" Value="&quot;[INSTALLLOCATION]bin\spek.exe&quot; &quot;%1&quot;" Type="string" /> + <RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Spek.Audio\shell\open\command" Value="&quot;[INSTALLLOCATION]spek.exe&quot; &quot;%1&quot;" Type="string" /> <!-- Associate with file extensions --> <?foreach ext in "3gp;aac,aif;aifc;aiff;amr;awb;ape;au;dts;flac;gsm;m4a;m4p;mp3;mp4;mp+;mpc;mpp;oga;ogg;ra;ram;snd;wav;wma;wv"?> <RegistryValue Root="HKLM" Key="SOFTWARE\Spek\Capabilities\FileAssociations" Name=".$(var.ext)" Value="Spek.Audio" Type="string" /> @@ -83,17 +84,11 @@ <RegistryValue Root="HKLM" Key="SOFTWARE\Classes\.$(var.ext)\OpenWithProgids" Name="Spek.Audio" Value="" Type="string" /> <?endforeach?> </Component> - <Directory Id="bin" Name="bin"> - <Component Id="Spek" Guid="EC0CA007-EC9E-44E2-B9DE-AE91D3C8EF70"> - <File Id="spek.exe" Name="spek.exe" Source="spek.exe" /> - </Component> - </Directory> </Directory> </Directory> </Directory> <Feature Id="All" Title="$(var.ProductName)" Level="1"> <ComponentRef Id="Main" /> - <ComponentRef Id="Spek" /> <ComponentGroupRef Id="Files" /> <ComponentRef Id="StartMenuShortcut" /> <ComponentRef Id="DesktopShortcut" />