Trying to build Windows version of HandBrakeCLI

Archive of historical development discussions
Discussions / Development has moved to GitHub
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
spongemike
Posts: 13
Joined: Tue Jun 10, 2014 4:05 am

Trying to build Windows version of HandBrakeCLI

Post by spongemike »

I installed a fresh Ubuntu VM, set up SSH, logged in, and followed the instructions from https://trac.handbrake.fr/wiki/CompileOnWindows

Specifically, I ran:

Code: Select all

sudo apt-get install subversion yasm apt-file autoconf \
libtool zlib1g-dev libbz2-dev libfribidi-dev intltool libglib2.0-dev

sudo apt-get install mingw-w*

svn co svn://svn.handbrake.fr/HandBrake/trunk HandBrake
cd HandBrake
./configure --cross=i686-w64-mingw32 --launch-jobs=1 --launch 
This all worked except the build... which failed.



Here's some of the build output. What else do I need to do to build???

Code: Select all

  : checking for suffix of executable build tools...
  : checking for dirent.h that defines DIR... yes
  : checking for library containing opendir... none required
  : checking for ANSI C header files... (cached) yes
  : checking fcntl.h usability... yes
  : checking fcntl.h presence... yes
  : checking for fcntl.h... yes
  : checking for stdlib.h... (cached) yes
  : checking for string.h... (cached) yes
  : checking for unistd.h... (cached) yes
  : checking for an ANSI C-conforming const... yes
  : checking for inline... inline
  : checking for pid_t... yes
  : checking for vprintf... yes
  : checking for _doprnt... no
  : checking for stdlib.h... (cached) yes
  : checking for unistd.h... (cached) yes
  : checking for sys/param.h... yes
  : checking for getpagesize... yes
  : checking for working mmap... no
  : checking for geteuid... no
  : checking for getuid... no
  : checking for link... no
  : checking for memmove... yes
  : checking for memset... yes
  : checking for mkstemp... no
  : checking for strchr... yes
  : checking for strrchr... yes
  : checking for strtol... yes
  : checking for getopt... yes
  : checking for getopt_long... yes
  : checking for sysconf... no
  : checking for ftruncate... yes
  : checking for chsize... yes
  : checking for rand... yes
  : checking for random... no
  : checking for lrand48... no
  : checking for a usable iconv... libiconv
  : checking for FT_Get_Next_Char... yes
  : checking for FT_Get_BDF_Property... yes
  : checking for FT_Get_PS_Font_Info... yes
  : checking for FT_Has_PS_Glyph_Names... yes
  : checking for FT_Get_X11_Font_Format... yes
  : checking for FT_Select_Size... yes
  : checking for FT_Bitmap_Size.y_ppem... yes
  : checking for i686-w64-mingw32-pkg-config... /usr/bin/i686-w64-mingw32-pkg-config
  : checking pkg-config is at least version 0.9.0... yes
  : checking for LIBXML2... no
  : configure: error: Package requirements (libxml-2.0 >= 2.6) were not met:
  :
  : No package 'libxml-2.0' found
  :
  : Consider adjusting the PKG_CONFIG_PATH environment variable if you
  : installed software in a non-standard prefix.
  :
  : Alternatively, you may set the environment variables LIBXML2_CFLAGS
  : and LIBXML2_LIBS to avoid the need to call pkg-config.
  : See the pkg-config man page for more details.
  : make: *** [contrib/fontconfig/.stamp.configure] Error 1
-------------------------------------------------------------------------------
time end: Mon Jun  9 20:50:31 2014
duration: 6 minutes, 26 seconds (386.76s)
result: FAILURE (code 2)
-------------------------------------------------------------------------------
Build is finished!
You may now cd into ./build and examine the output.
Deleted User 11865

Re: Trying to build Windows version of HandBrakeCLI

Post by Deleted User 11865 »

https://bugs.launchpad.net/ubuntu/+sour ... ug/1327242

I guess there's something we should fix in our build system. In the meantime, the easiest workaround would be to uninstall this package: http://packages.ubuntu.com/trusty/mingw-w64-tools

Beware than even if it builds successfully, HandBrake compiled under Ubuntu 14.04 may not run properly (no idea why, but some people have encountered the issue). I would currently recommend building it under Ubuntu 13.10…
spongemike
Posts: 13
Joined: Tue Jun 10, 2014 4:05 am

Re: Trying to build Windows version of HandBrakeCLI

Post by spongemike »

Thanks. I'll recreate the VM with Ubuntu 13.10.

So... I'll be starting from scratch. Are you saying I should NOT install the mingw-w64 tools? I.e., I should NOT run the following:

Code: Select all

sudo apt-get install mingw-w*
?
User avatar
s55
HandBrake Team
Posts: 10360
Joined: Sun Dec 24, 2006 1:05 pm

Re: Trying to build Windows version of HandBrakeCLI

Post by s55 »

I tend to use the mingw-w64 official packages instead and put those on my path
Deleted User 11865

Re: Trying to build Windows version of HandBrakeCLI

Post by Deleted User 11865 »

spongemike wrote:Are you saying I should NOT install the mingw-w64 tools? I.e., I should NOT run the following:

Code: Select all

sudo apt-get install mingw-w*
?
No, you should install MinGW, just not that specific package I mentioned above. I don't think it exists under 13.10 anyway.
spongemike
Posts: 13
Joined: Tue Jun 10, 2014 4:05 am

Re: Trying to build Windows version of HandBrakeCLI

Post by spongemike »

You say I *should* install MinGW, just not that specific package.

Okay, so how? I.e., what installation command should I run (on Ubuntu 13.10)?

Please forgive my ignorance, but I come from a Windows background, and I'm only working in Ubuntu in order to build the Windows version of HandBrakeCli.exe (and the only reason I'm doing that is because it keeps crashing when I try to use it to encode MKV files ripped by MakeMKV from the "Dexter" TV show, so I'm hoping to put in some debug printf's and try/catch's and find out where it's crashing so I can figure out how to prevent it). (And maybe even fix it in the code and submit a patch)

Thanks!
IBrokeIt
Posts: 3
Joined: Thu Jul 31, 2014 2:26 am

Re: Trying to build Windows version of HandBrakeCLI

Post by IBrokeIt »

Rodeo wrote: Beware than even if it builds successfully, HandBrake compiled under Ubuntu 14.04 may not run properly (no idea why, but some people have encountered the issue).
I ran into this on Linux Mint 17, which is based upon Ubuntu 14.04.

the easiest workaround would be to uninstall this package: http://packages.ubuntu.com/trusty/mingw-w64-tools
that specific package I mentioned above. I don't think it exists under 13.10 anyway.
It doesn't exist under 13.10, so no worries. :)

spongemike wrote: Okay, so how? I.e., what installation command should I run (on Ubuntu 13.10)?

Please forgive my ignorance, but I come from a Windows background, and I'm only working in Ubuntu in order to build the Windows version of HandBrakeCli.exe (and the only reason I'm doing that is because it keeps crashing when I try to use it to encode MKV files ripped by MakeMKV from the "Dexter" TV show, so I'm hoping to put in some debug printf's and try/catch's and find out where it's crashing so I can figure out how to prevent it). (And maybe even fix it in the code and submit a patch)

Thanks!
A little late, but here's a mini HOWTO for future readers.
Please note that this was on Linux Mint 16 MATE (which is based on Ubuntu 13.10, but with GNOME 2 desktop).

01. Install Linux Mint 16 / Ubuntu 13.10.


02. Install Linux pre-requisites (good for sanity check).

Code: Select all

sudo apt-get install subversion yasm build-essential autoconf libtool \
     zlib1g-dev libbz2-dev libogg-dev libtheora-dev libvorbis-dev \
     libsamplerate-dev libxml2-dev libfribidi-dev libfreetype6-dev \
     libfontconfig1-dev libass-dev intltool libglib2.0-dev libdbus-glib-1-dev \
     libgtk-3-dev libgudev-1.0-dev libwebkitgtk-3.0-dev libnotify-dev \
     libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libappindicator-dev

03. Install and compile GTK+ 3.10.9
There are newer versions available (newest is 3.13.5), but I chose the newest in the 3.10 branch.

Code: Select all

mkdir -p ~/Downloads
cd ~/Downloads
wget http://ftp.gnome.org/pub/gnome/sources/gtk+/3.10/gtk+-3.10.9.tar.xz
mkdir -p ~/src
cd ~/src
tar -xvf ~/Downloads/gtk+-3.10.9.tar.xz
cd ~/src/gtk+-3.10.9
./configure
make
sudo make install

04. Install Windows cross-compilation pre-requisites.

Code: Select all

sudo apt-get install subversion yasm apt-file autoconf libtool zlib1g-dev libbz2-dev libfribidi-dev intltool libglib2.0-dev mingw-w*

05. Download newest HandBrake source code

Code: Select all

cd ~/src
svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk

06. Compile for Linux (if desired, good sanity check)

Code: Select all

cd ~/src/hb-trunk
./configure --build=./build-linux
cd ~/src/hb-trunk/build-linux
make

07. Cross-compile for Win32 CLI (if desired)

Code: Select all

cd ~/src/hb-trunk
./configure --cross=i686-w64-mingw32 --build=./build-win32
cd ~/src/hb-trunk/build-win32
make

08. Cross-compile for Win64 CLI (if desired)

Code: Select all

cd ~/src/hb-trunk
./configure --cross=x86_64-w64-mingw32 --build=./build-win64
cd ~/src/hb-trunk/build-win64
make

Linux code in ~/src/hb-trunk/build-linux
Win32 code in ~/src/hb-trunk/build-win32
Win64 code in ~/src/hb-trunk/build-win64

Have fun! :D
Post Reply