Select Git revision
pkg.sh 5.26 KiB
set -e
fakeroot=$(realpath $(dirname $0))/fakeroot/
pkg_config_path=${fakeroot}/lib/pkgconfig
function gtk_pkg {
folder=gtk-$1
tar=$folder.tar.xz
url=https://download.gnome.org/sources/gtk/${1%.*}/$tar
[ -e "./libs" ] || mkdir ./libs
cd ./libs
[ -e "$tar" ] || {
echo Downloading Gtk from $url
curl -O -L $url
}
[ -e "$folder" ] || tar xf gtk-$1.tar.xz
cd gtk-$1
cat > cross.txt << EOF
[binaries]
c = 'x86_64-w64-mingw32-gcc'
cpp = 'x86_64-w64-mingw32-g++'
ar = 'x86_64-w64-mingw32-ar'
strip = 'x86_64-w64-mingw32-strip'
windres = 'x86_64-w64-mingw32-windres'
[host_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'
EOF
LDFLAGS=-lssp meson \
$([ -e "build-windows" ] && \
echo configure || \
echo setup --cross-file cross.txt ) \
-D media-gstreamer=disabled \
-D buildtype=minsize \
-D debug=false \
-D strip=true \
-D build-examples=false \
-D build-tests=false \
-D build-testsuite=false \
-D demos=false \
-D macos-backend=false \
-D print-cups=disabled \
-D wayland-backend=false \
-D x11-backend=false \
-D win32-backend=true \
-D cairo:png=enabled \
-D cairo:quartz=disabled \
-D cairo:spectre=disabled \
-D cairo:xcb=disabled \
-D cairo:xlib=disabled \
-D fontconfig:doc=disabled \
-D fontconfig:tests=disabled \
-D freetype2:png=disabled \
-D fribidi:tests=false \
-D gdk-pixbuf:builtin_loaders=none \
-D gdk-pixbuf:native_windows_loaders=true \
-D glib:tests=false \
-D glib:installed_tests=false \
-D harfbuzz:chafa=disabled \
-D harfbuzz:coretext=disabled \
-D harfbuzz:docs=disabled \
-D harfbuzz:tests=disabled \
-D libepoxy:tests=false \
-D libepoxy:x11=false \
-D pango:xft=disabled \
--prefix ${fakeroot} \
./build-windows
ninja -j6 -C build-windows
ninja -C build-windows install
exit
}
function ffmpeg_pkg {
folder=ffmpeg-$1
tar=$folder.tar.xz
[ -e "./libs" ] || mkdir ./libs
cd libs
[ -e "$tar" ] || curl -O -L https://ffmpeg.org/releases/$tar
[ -e "$folder" ] || tar xf $tar
cd $folder
echo PKG_CONFIG_PATH=${pkg_config_path} ./configure \
--prefix=${fakeroot} \
--cross-prefix=x86_64-w64-mingw32- \
--arch=x86_64 --target-os=mingw32 \
--enable-gpl --enable-version3 --disable-debug --enable-zlib \
--enable-libfreetype --enable-libfribidi --enable-fontconfig \
--enable-libx264 --pkg-config=pkg-config
PKG_CONFIG_PATH=${pkg_config_path} ./configure \
--prefix=${fakeroot} \
--cross-prefix=x86_64-w64-mingw32- \
--arch=x86_64 --target-os=mingw32 \
--enable-gpl --enable-version3 --disable-debug --enable-zlib \
--enable-libfreetype --enable-libfribidi --enable-fontconfig \
--enable-libx264 --pkg-config=pkg-config
echo make -j6
make -j6
echo make install
make install
exit
}
function x264_pkg {
folder=x264-master
tar=$folder.tar.bz2
[ -e "./libs" ] || mkdir ./libs
cd ./libs
[ -e "$tar" ] || curl -O -L \
https://code.videolan.org/videolan/x264/-/archive/master/$tar
[ -e "$folder" ] || tar xf $tar
cd $folder
./configure --prefix=${fakeroot} \
--enable-shared --enable-static \
--host=x86_64-w64-mingw32 \
--cross-prefix=x86_64-w64-mingw32-
make -j6
make install
exit
}
function cpy_dlls {
rm -f dlls/*.dll
cp fakeroot/bin/libcairo-2.dll dlls
cp fakeroot/bin/libcairo-gobject-2.dll dlls
cp fakeroot/bin/libcairo-script-interpreter-2.dll dlls
cp fakeroot/bin/libepoxy-0.dll dlls
cp fakeroot/bin/libexpat.dll dlls
cp fakeroot/bin/libffi-7.dll dlls
cp fakeroot/bin/libfontconfig-1.dll dlls
cp fakeroot/bin/libfreetype-6.dll dlls
cp fakeroot/bin/libfribidi-0.dll dlls
cp fakeroot/bin/libgdk_pixbuf-2.0-0.dll dlls
cp fakeroot/bin/libgio-2.0-0.dll dlls
cp fakeroot/bin/libglib-2.0-0.dll dlls
cp fakeroot/bin/libgmodule-2.0-0.dll dlls
cp fakeroot/bin/libgobject-2.0-0.dll dlls
cp fakeroot/bin/libgraphene-1.0-0.dll dlls
cp fakeroot/bin/libgthread-2.0-0.dll dlls
cp fakeroot/bin/libgtk-4-1.dll dlls
cp fakeroot/bin/libharfbuzz-0.dll dlls
cp fakeroot/bin/libharfbuzz-gobject-0.dll dlls
cp fakeroot/bin/libharfbuzz-subset-0.dll dlls
cp fakeroot/bin/libintl-8.dll dlls
cp fakeroot/bin/libjpeg-8.2.2.dll dlls
cp fakeroot/bin/libpango-1.0-0.dll dlls
cp fakeroot/bin/libpangocairo-1.0-0.dll dlls
cp fakeroot/bin/libpangoft2-1.0-0.dll dlls
cp fakeroot/bin/libpangowin32-1.0-0.dll dlls
cp fakeroot/bin/libpcre2-16.dll dlls
cp fakeroot/bin/libpcre2-32.dll dlls
cp fakeroot/bin/libpcre2-8.dll dlls
cp fakeroot/bin/libpcre2-posix.dll dlls
cp fakeroot/bin/libpixman-1-0.dll dlls
cp fakeroot/bin/libpng16-16.dll dlls
cp fakeroot/bin/libtiff4.dll dlls
cp fakeroot/bin/libwinpthread-1.dll dlls
cp fakeroot/bin/libx264-164.dll dlls
cp fakeroot/bin/libz.dll dlls
cp fakeroot/lib/avcodec-58.dll dlls
cp fakeroot/lib/avfilter-7.dll dlls
cp fakeroot/lib/avformat-58.dll dlls
cp fakeroot/lib/avutil-56.dll dlls
cp fakeroot/lib/postproc-55.dll dlls
cp fakeroot/lib/swresample-3.dll dlls
cp fakeroot/lib/swscale-5.dll dlls
cp /usr/x86_64-w64-mingw32/lib/libgcc_s_seh-1.dll dlls
cp /usr/x86_64-w64-mingw32/lib/libstdc++-6.dll dlls
x86_64-w64-mingw32-strip dlls/*.dll
}
cd $(dirname $0)
[ -e "fakeroot" ] || mkdir fakeroot
case $1 in
"gtk" )
gtk_pkg $2
;;
"ffmpeg" )
ffmpeg_pkg $2
;;
"x264" )
x264_pkg
;;
"cpy-dlls" )
cpy_dlls
;;
*)
echo "Usage: $0 [gtk version|ffmpeg version|x264]"
;;
esac