History:How to Build Picard for Windows: Difference between revisions

From MusicBrainz Wiki
Jump to navigationJump to search
(→‎Known issues: Info about libdiscid build patch)
No edit summary
 
(21 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Note}} See up-to-date docs at [https://picard.musicbrainz.org/docs/build-windows/ the dedicated Picard site].
= How to build Picard for Windows =


----
== Disclaimer ==
This HowTo is work in progress and terribly incomplete. Currently it is more a collection of notes which can help you to build Picard on Windows, but it is not a real step by step instruction.


This page explains the process of building [[MusicBrainz Picard]] and the installer for Windows. It only works for Picard 1.2 and newer, which no longer supports AmpliFIND.
== About ==
This HowTo explains the process of building the Picard installer for Windows from source using the MinGW build environment.


== Requirements ==
== Requirements ==
* [http://python.org/download/releases/2.5.4/ Python 2.5]
* [http://www.riverbankcomputing.co.uk/software/pyqt/download PyQt 4]
* [http://www.mingw.org/ MinGW]
* [http://www.mingw.org/wiki/MSYS MSYS]
* [http://nsis.sourceforge.net/Download NSIS]
* [http://www.py2exe.org/ py2exe]
* [http://ffmpeg.org/ FFmpeg]
* [http://code.google.com/p/mutagen/ Mutagen]
* [[libdiscid]]
* [http://code.google.com/p/musicip-libofa/ LibOFA]


* Python 2.7.x
== Install Python, PyQt and py2exe ==
** http://python.org/download/
** Download and install "Python 2.7.x Windows Installer"
** Add C:\Python27 to %PATH%
* PyQt 4.10.x
** http://www.riverbankcomputing.co.uk/software/pyqt/download
** Download and install "PyQt4-4.10.x-gpl-Py2.7-Qt4.8.x-x32.exe"
* libdiscid
** http://musicbrainz.org/doc/libdiscid
** Download "libdiscid-0.6.1-win32.zip" and put "discid.dll" in your Windows\System32 folder
* Pip for Windows
** https://sites.google.com/site/pydatalog/python/pip-for-windows
** Download to a location you find again (no installation)
** in Pip_Win:
*** <code>pip install mutagen</code> for Mutagen (1.22 tested)
*** <code>pip install discid</code> for python-discid (1.1.x tested)
* gettext >= 0.15
** http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/
** Download both gettext-tools-0.17.zip and gettext-runtime-0.17-1.zip and unzip both into the same directory
** Add the gettext bin folder to %PATH% (normally ''C:\Programs\GnuWin32\bin'')
* Visual C++ 2008 Express
** http://go.microsoft.com/?linkid=7729279
** Download and install "vcsetup.exe"
* Chromaprint
** http://acoustid.org/chromaprint
** Download "chromaprint-fpcalc-1.1-win-i86.zip" and put "fpcalc.exe" to the Picard source code directory


== Install NSIS ==
== Running Picard From Sources ==


Before you can run Picard from sources, you need to build the C extension. Start the VS console using "Visual Studio 2008 Command Prompt", go to the source directory and run these commands:
== Install MinGW and Minsys ==


python setup.py build_ext -i
== Build libavformat/libavcodec ==
python setup.py build_locales -i
Download the FFmpeg [http://ffmpeg.org/download.html source code] and extract it to a directory. From inside the MSYS shell change to that directory and run:


After you have done this, you can run Picard directly from the sources using:
./configure --prefix=C:/MinGW \
--extra-cflags="-mno-cygwin -mms-bitfields" \
--extra-ldflags="-Wl,--add-stdcall-alias" \
--enable-memalign-hack \
--target-os=mingw32 \
--enable-shared \
--disable-static \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-network \
--disable-muxers \
--disable-demuxers \
--enable-demuxer=aac \
--enable-demuxer=ac3 \
--enable-demuxer=ape \
--enable-demuxer=flac \
--enable-demuxer=mpc \
--enable-demuxer=mpc8 \
--enable-demuxer=ogg \
--enable-demuxer=wav \
--disable-bsfs \
--disable-filters \
--disable-parsers \
--enable-parser=aac \
--enable-parser=ac3 \
--enable-parser=mpegaudio \
--disable-protocols \
--enable-protocol=file \
--disable-indevs \
--disable-outdevs \
--disable-encoders \
--disable-decoders \
--enable-decoder=aac \
--enable-decoder=ac3 \
--enable-decoder=alac \
--enable-decoder=flac \
--enable-decoder=mp2 \
--enable-decoder=mp3 \
--enable-decoder=mpc7 \
--enable-decoder=mpc8 \
--enable-decoder=ape \
--enable-decoder=wavpack \
--enable-decoder=vorbis \
--enable-decoder=wmav1 \
--enable-decoder=wmav2 \
--enable-decoder=tta \
--enable-decoder=pcm_alaw \
--enable-decoder=pcm_dvd \
--enable-decoder=pcm_f32be \
--enable-decoder=pcm_f32le \
--enable-decoder=pcm_f64be \
--enable-decoder=pcm_f64le \
--enable-decoder=pcm_s16be \
--enable-decoder=pcm_s16le \
--enable-decoder=pcm_s16le_planar \
--enable-decoder=pcm_s24be \
--enable-decoder=pcm_daud \
--enable-decoder=pcm_s24le \
--enable-decoder=pcm_s32be \
--enable-decoder=pcm_s32le \
--enable-decoder=pcm_s8 \
--enable-decoder=pcm_u16be \
--enable-decoder=pcm_u16le \
--enable-decoder=pcm_u24be \
--enable-decoder=pcm_u24le


python tagger.py
Build the libraries with


== Building the Installer ==
make


To build the installer executable you need additional Tools:
== Download the Picard source code ==
See [[Picard_Download|Picard Download]] for instructions on how to obtain the source code of Picard.


* py2exe 0.6.9
== Install libdiscid and libofa ==
** http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/
** Download and install "py2exe-0.6.9.win32-py2.7.exe"
* NSIS 2.46
** http://nsis.sourceforge.net/Download
** Download and install "nsis-2.46-setup.exe"


Then you need to copy msvcr90.dll and msvcp90.dll from "C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT" to the source code directory, so that py2exe can find them.
== Build the Picard installer ==
You also need copy discid.dll (libdiscid) to the picard source.
Configure Picard:


Then you can build the installer using this command:
python setup.py config --compiler mingw32 --library-dirs C:\MinGW\lib --include-dirs C:\MinGW\include


python setup.py bdist_nsis
Fix the build.cfg:
[directshow]
libs =
cflags =
[libofa]
libs =
cflags =
[avcodec]
libs = avcodec.dll avformat.dll avutil.dll
cflags =
[build]
have-make = True
with-directshow = False
with-avcodec = True
with-libofa = False


The setup is installer\picard-setup-1.x.exe and an executable for your system is dist\picard.exe, which you can use to create a desktop shortcut.
Build Picard and create the installer:


== Known Issues ==
python setup.py build --compiler mingw32 bdist_nsis


It is possible that the resulting picard.exe does not show the proper file icon. This is probably a bug of py2exe on Vista. You can fix the icon with the tool [http://angusj.com/resourcehacker/ Resource Hacker] or any other tool, that can edit the resources in executables.
== Known issues ==
* It is possible that the resulting picard.exe does not show the proper file icon. This is probably a bug of py2exe on Vista. You can fix the icon with the tool [http://angusj.com/resourcehacker/ Resource Hacker] or any other tool, that can edit the resources in executables.
* If you try to build libdiscid yourself you must apply the patch from ticket [http://bugs.musicbrainz.org/ticket/5255 #5255].


[[Category:Picard]] [[Category:Development]] [[Category:To_Be_Reviewed]]
[[Category:Development]][[Category:MusicBrainz Picard]][[Category:How To]][[Category:To Be Reviewed]]

Latest revision as of 12:50, 22 May 2015

Note Note: See up-to-date docs at the dedicated Picard site.


This page explains the process of building MusicBrainz Picard and the installer for Windows. It only works for Picard 1.2 and newer, which no longer supports AmpliFIND.

Requirements

Running Picard From Sources

Before you can run Picard from sources, you need to build the C extension. Start the VS console using "Visual Studio 2008 Command Prompt", go to the source directory and run these commands:

python setup.py build_ext -i
python setup.py build_locales -i

After you have done this, you can run Picard directly from the sources using:

python tagger.py

Building the Installer

To build the installer executable you need additional Tools:

Then you need to copy msvcr90.dll and msvcp90.dll from "C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT" to the source code directory, so that py2exe can find them. You also need copy discid.dll (libdiscid) to the picard source.

Then you can build the installer using this command:

python setup.py bdist_nsis

The setup is installer\picard-setup-1.x.exe and an executable for your system is dist\picard.exe, which you can use to create a desktop shortcut.

Known Issues

It is possible that the resulting picard.exe does not show the proper file icon. This is probably a bug of py2exe on Vista. You can fix the icon with the tool Resource Hacker or any other tool, that can edit the resources in executables.