Skip to content

Building Windows X86_64 Third Party Dependencies

Pablo Tesone edited this page Apr 14, 2023 · 5 revisions
pacman -S mingw-w64-x86_64-toolchain
pacman -S make
pacman -S zip
pacman -S patch
pacman -S mingw-w64-x86_64-cmake	
pacman -S autoconf
pacman -S automake
pacman -S libtool
pacman -S gperf
pacman -S meson
pacman -S mingw-w64-x86_64-meson

BUILD_DIR=/home/pablo/thirdParty

SDL2-2.24.1

cd ${BUILD_DIR}
wget https://libsdl.org/release/SDL2-2.24.1.tar.gz

tar xvfz SDL2-2.24.1.tar.gz
cd SDL2-2.24.1

PKG_CONFIG_PATH="${BUILD_DIR}/lib/pkgconfig" \
./configure --prefix=${BUILD_DIR} 

make install

cd ${BUILD_DIR}/bin
zip -y SDL2-2.24.1.zip SDL2.dll

libpng-1.6.37

wget https://download.sourceforge.net/libpng/libpng-1.6.37.tar.gz
tar xvfz libpng-1.6.37.tar.gz
cd libpng-1.6.37

PKG_CONFIG_PATH="${BUILD_DIR}/lib/pkgconfig" \
cmake . -DCMAKE_PREFIX_PATH=${BUILD_DIR} -DCMAKE_INSTALL_PREFIX:PATH=${BUILD_DIR} \
-G 'Unix Makefiles'

make install

cd ${BUILD_DIR}/bin

zip -y libpng-1.6.37.zip libpng*.dll

bzip2-1.0.8

Required by freetype, in Windows it is included in the zip of freetype.

wget https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz
tar xvfz bzip2-1.0.8.tar.gz

cd bzip2-1.0.8

# Patch needed for having a configure script
wget https://raw.githubusercontent.com/msys2/MINGW-packages/master/mingw-w64-bzip2/bzip2-buildsystem.all.patch
patch -p1 -i 

autoreconf -fi

PKG_CONFIG_PATH="${BUILD_DIR}/lib/pkgconfig" \
./configure --prefix=${BUILD_DIR} --enable-shared

make install

freetype-2.12.1

wget https://download.savannah.gnu.org/releases/freetype/freetype-2.12.1.tar.gz
tar xvfz freetype-2.12.1.tar.gz
cd freetype-2.12.1

PKG_CONFIG_PATH="${BUILD_DIR}/lib/pkgconfig" \
./configure --prefix=${BUILD_DIR} --enable-freetype-config --without-harfbuzz --without-brotli

make install

cd ${BUILD_DIR}/bin

zip -y freetype-2.12.1.zip libfreetype-6.dll libbz2-1.dll

expat-2.5.0

It is required by fontconfig, and I will ship it with fontconfig.

wget https://github.com/libexpat/libexpat/releases/download/R_2_5_0/expat-2.5.0.tar.gz
tar xvfz expat-2.5.0.tar.gz
cd expat-2.5.0

PKG_CONFIG_PATH="${BUILD_DIR}/lib/pkgconfig" \
./configure --prefix=${BUILD_DIR} --enable-shared

make install 

fontconfig-2.13.1

wget https://freedesktop.org/software/fontconfig/release/fontconfig-2.13.1.tar.gz
tar xvfz fontconfig-2.13.1.tar.gz
cd fontconfig-2.13.1

autoreconf -fi
 
PKG_CONFIG_PATH="${BUILD_DIR}/lib/pkgconfig" \
./configure \
--prefix=${BUILD_DIR} --disable-docs --disable-nls

#Do not build tests
sed -i 's,all-am: Makefile $(PROGRAMS),all-am:,' test/Makefile

make install

cd ${BUILD_DIR}/bin

zip -y fontconfig-2.13.1.zip libfontconfig-1.dll
zip -y fontconfig-2.13.1.zip libexpat-1.dll

pixman-0.40.0

wget https://www.cairographics.org/releases/pixman-0.40.0.tar.gz
tar xvfz pixman-0.40.0.tar.gz

cd pixman-0.40.0

PKG_CONFIG_PATH="${BUILD_DIR}/lib/pkgconfig" \
./configure \
--prefix=${BUILD_DIR}

make install

cd ${BUILD_DIR}/bin

zip -y pixman-0.40.0.zip libpixman-1-0.dll

zlib-1.2.13

wget https://zlib.net/current/zlib-1.2.13.tar.gz
tar xvf zlib-1.2.13.tar.gz
cd zlib-1.2.13

PKG_CONFIG_PATH="${BUILD_DIR}/lib/pkgconfig" \
./configure \
--prefix=${BUILD_DIR}

make install

cd ${BUILD_DIR}/bin

zip -y zlib-1.2.13.zip zlib1.dll

cairo-1.17.4

wget https://cairographics.org/snapshots/cairo-1.17.4.tar.xz
tar xvf cairo-1.17.4.tar.xz
cd cairo-1.17.4

PKG_CONFIG_PATH="${BUILD_DIR}/lib/pkgconfig" \
./configure \
--prefix=${BUILD_DIR}

make install

cd ${BUILD_DIR}/bin

zip -y cairo-1.17.4.zip libcairo-2.dll

harfbuzz-5.3.1

wget https://github.com/harfbuzz/harfbuzz/releases/download/5.3.1/harfbuzz-5.3.1.tar.xz

tar xvf harfbuzz-5.3.1.tar.xz

cd harfbuzz-5.3.1

mkdir build

PKG_CONFIG_PATH="${BUILD_DIR}/lib/pkgconfig" \
LDFLAGS="-L${BUILD_DIR}/lib -L${BUILD_DIR}/bin" \
meson --prefix="${BUILD_DIR}" \
--buildtype plain \
--default-library=shared \
-Dglib=disabled \
-Dicu=disabled \
-Dtests=disabled \
.. 

meson compile
meson install 

cd ${BUILD_DIR}/bin

zip -y harfbuzz-5.3.1.zip libharfbuzz-0.dll

libSSH2-1.10.0

wget https://github.com/libssh2/libssh2/releases/download/libssh2-1.10.0/libssh2-1.10.0.tar.gz

tar xvfz libssh2-1.10.0.tar.gz

cd libssh2-1.10.0/
mkdir build
cd build

PKG_CONFIG_PATH="${BUILD_DIR}/lib/pkgconfig" \
cmake .. \
-B . \
-DCMAKE_PREFIX_PATH=${BUILD_DIR} \
-DCMAKE_INSTALL_PREFIX=${BUILD_DIR} \
-DCRYPTO_BACKEND=OpenSSL \
-DBUILD_SHARED_LIBS=ON \
-DENABLE_ZLIB_COMPRESSION=ON \
-DENABLE_DEBUG_LOGGING=ON

cmake --build .
cmake --build . --target install

mv ${BUILD_DIR}/lib/liblibssh2.dll.a ${BUILD_DIR}/lib/libssh2.dll.a

cd ${BUILD_DIR}/bin

zip -y ssh2-1.10.0.zip libssh2-1-10-0-1.dll

openssl-1.1.1k

cd ${BUILD_DIR}

wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz
tar xvfz openssl-1.1.1k.tar.gz

cd openssl-1.1.1k

./config --prefix=${BUILD_DIR} 
make install

cd ${BUILD_DIR}/bin

zip -y openssl-1.1.1k.zip libssl-1_1-x64.dll libcrypto-1_1-x64.dll

libGit2-1.5.2

git clone https://github.com/libgit2/libgit2.git libgit2-1.5.2
cd libgit2-1.5.2
git checkout v1.5.2

mkdir build
cd build 

PKG_CONFIG_PATH="${BUILD_DIR}/lib/pkgconfig" \
cmake .. -B . \
-DCMAKE_PREFIX_PATH=${BUILD_DIR} \
-DCMAKE_INSTALL_PREFIX:PATH=${BUILD_DIR} \
-DCMAKE_FIND_ROOT_PATH=${BUILD_DIR} \
-DCMAKE_LIBRARY_PATH=${BUILD_DIR}/lib \
-DCMAKE_INCLUDE_PATH=${BUILD_DIR}/include \
-DCMAKE_SHARED_LIBRARY_NAME_WITH_VERSION=ON \
-DUSE_SSH=ON \
-DUSE_WINHTTP=ON \
-DBUILD_EXAMPLES=ON 

cmake --build . --target install

cd ${BUILD_DIR}/bin

zip -y libgit2-1.5.2.zip libgit2-1.5.dll

cp libgit2-1.5.dll libgit2.dll
zip -y libgit2-default-2023-04-14.zip libgit2.dll

libGit2-1.6.4

git clone https://github.com/libgit2/libgit2.git libgit2-1.6.4
cd libgit2-1.6.4
git checkout v1.6.4

mkdir build
cd build 

PKG_CONFIG_PATH="${BUILD_DIR}/lib/pkgconfig" \
cmake .. -B . \
-DCMAKE_PREFIX_PATH=${BUILD_DIR} \
-DCMAKE_INSTALL_PREFIX:PATH=${BUILD_DIR} \
-DCMAKE_FIND_ROOT_PATH=${BUILD_DIR} \
-DCMAKE_LIBRARY_PATH=${BUILD_DIR}/lib \
-DCMAKE_INCLUDE_PATH=${BUILD_DIR}/include \
-DCMAKE_SHARED_LIBRARY_NAME_WITH_VERSION=ON \
-DUSE_SSH=ON \
-DUSE_WINHTTP=ON \
-DBUILD_EXAMPLES=ON 

cmake --build . --target install

cd ${BUILD_DIR}/bin

zip -y libgit2-1.6.4.zip libgit2-1.6.dll
Clone this wiki locally