From 5b85813a3e42b7b963e0fd43e46fd2ab668cc801 Mon Sep 17 00:00:00 2001 From: Stian Skjelstad Date: Fri, 20 Dec 2024 20:44:15 +0100 Subject: [PATCH] [mingw] Split out versions for externals libraries into its own config file, add script to check if versionsnumbers are the latest versions and update the version numbers. --- mingw/build.sh | 157 ++++++++++++++++++++++------------------- mingw/versionscheck.sh | 96 +++++++++++++++++++++++++ mingw/versionsconf.sh | 20 ++++++ 3 files changed, 199 insertions(+), 74 deletions(-) create mode 100755 mingw/versionscheck.sh create mode 100644 mingw/versionsconf.sh diff --git a/mingw/build.sh b/mingw/build.sh index 01dbb967..8f0b8425 100755 --- a/mingw/build.sh +++ b/mingw/build.sh @@ -7,6 +7,8 @@ set -e if ! test -f ./configure || test $# != 1; then echo "Please execute from the main project directory like this:"; echo "mingw/build.sh x86_64-w64-mingw32 (or i686-w64-mingw32 for a 32bit build)"; exit 1; fi if test "$1" != "x86_64-w64-mingw32" && test "$1" != "i686-w64-mingw32"; then echo "only supported targets are x86_64-w64-mingw32 and i686-w64-mingw32. $1 given"; exit 1; fi +. mingw/versionsconf.sh + test -f ./Makefile && make clean || true sudo apt-get install mingw-w64-tools mingw-w64 libz-mingw-w64-dev nasm cmake @@ -72,10 +74,10 @@ do_cmake () { #cd .. ########## BZIP2 ########## -wget https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz -O bzip2-1.0.8.tar.gz -rm -Rf bzip2-1.0.8 -tar xfz bzip2-1.0.8.tar.gz -cd bzip2-1.0.8 +rm -Rf bzip2-* +wget https://sourceware.org/pub/bzip2/bzip2-$BZIP2_VERSION.tar.gz -O bzip2-$BZIP2_VERSION.tar.gz +tar xfz bzip2-$BZIP2_VERSION.tar.gz +cd bzip2-$BZIP2_VERSION cat < Makefile.mingw32 CC=$host-gcc CFLAGS=-fpic -fPIC -DWIN32 -MD -O2 -D_FILE_OFFSET_BITS=64 -DBZ_EXPORT @@ -152,10 +154,10 @@ EOF cd .. ########## MAD ########## -wget https://sourceforge.net/projects/mad/files/libmad/0.15.1b/libmad-0.15.1b.tar.gz/download -O libmad-0.15.1b.tar.gz -rm -Rf libmad-0.15.1b -tar xfz libmad-0.15.1b.tar.gz -cd libmad-0.15.1b +rm -Rf libmad-* +wget https://sourceforge.net/projects/mad/files/libmad/$LIBMAD_VERSION/libmad-$LIBMAD_VERSION.tar.gz/download -O libmad-$LIBMAD_VERSION.tar.gz +tar xfz libmad-$LIBMAD_VERSION.tar.gz +cd libmad-$LIBMAD_VERSION patch -p 1 << EOF diff -u libmad-0.15.1b/configure.ac libmad-0.15.1b-new/configure.ac --- libmad-0.15.1b/configure.ac 2004-01-23 10:41:32.000000000 +0100 @@ -196,37 +198,37 @@ make all install cd .. ########## LIBJPEG-TURBO ########## -wget https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.0.3/libjpeg-turbo-3.0.3.tar.gz -O libjpeg-turbo-3.0.3.tar.gz -rm -Rf libjpeg-turbo-3.0.3 -tar xfz libjpeg-turbo-3.0.3.tar.gz -cd libjpeg-turbo-3.0.3 +rm -Rf libjpeg-turbo-* +wget https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/$LIBJPEGTURBO_VERSION/libjpeg-turbo-$LIBJPEGTURBO_VERSION.tar.gz -O libjpeg-turbo-$LIBJPEGTURBO_VERSION.tar.gz +tar xfz libjpeg-turbo-$LIBJPEGTURBO_VERSION.tar.gz +cd libjpeg-turbo-$LIBJPEGTURBO_VERSION do_cmake -DENABLE_SHARED=TRUE cd .. ########## LIBPNG ########## -wget https://download.sourceforge.net/libpng/libpng-1.6.43.tar.gz -O libpng-1.6.43.tar.gz -rm -Rf libpng-1.6.43 -tar xfz libpng-1.6.43.tar.gz -cd libpng-1.6.43 +rm -Rf libpng-* +wget https://download.sourceforge.net/libpng/libpng-$LIBPNG_VERSION.tar.gz -O libpng-$LIBPNG_VERSION.tar.gz +tar xfz libpng-$LIBPNG_VERSION.tar.gz +cd libpng-$LIBPNG_VERSION #cmake does not use pkg-config for zlib????? do_cmake -DZLIB_ROOT=/usr/$host/ cd .. ########## LIBOGG ########## -wget https://downloads.xiph.org/releases/ogg/libogg-1.3.5.tar.gz -O libogg-1.3.5.tar.gz -rm -Rf libogg-1.3.5/ -tar xfz libogg-1.3.5.tar.gz -cd libogg-1.3.5/ +rm -Rf libogg-* +wget https://downloads.xiph.org/releases/ogg/libogg-$LIBOGG_VERSION.tar.gz -O libogg-$LIBOGG_VERSION.tar.gz +tar xfz libogg-$LIBOGG_VERSION.tar.gz +cd libogg-$LIBOGG_VERSION do_cmake cd .. # Bug in build-system, missmatch with dll filename, and internal name mv -f $prefix/bin/libogg.dll $prefix/bin/ogg.dll ########## VORBIS ########## -wget https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.7.tar.gz -O libvorbis-1.3.7.tar.gz -rm -Rf libvorbis-1.3.7 -tar xfz libvorbis-1.3.7.tar.gz -cd libvorbis-1.3.7 +rm -Rf libvorbis-* +wget https://downloads.xiph.org/releases/vorbis/libvorbis-$LIBVORBIS_VERSION.tar.gz -O libvorbis-$LIBVORBIS_VERSION.tar.gz +tar xfz libvorbis-$LIBVORBIS_VERSION.tar.gz +cd libvorbis-$LIBVORBIS_VERSION patch -p1 << EOF diff -ur libvorbis-1.3.7/win32/vorbis.def libvorbis-1.3.7-new/win32/vorbis.def --- libvorbis-1.3.7/win32/vorbis.def 2020-03-23 16:04:43.000000000 +0100 @@ -269,60 +271,66 @@ mv -f $prefix/bin/libvorbisfile.dll $prefix/bin/vorbisfile.dll mv -f $prefix/bin/libvorbis.dll $prefix/bin/vorbis.dll ########## FLAC ########## -wget https://ftp.osuosl.org/pub/xiph/releases/flac/flac-1.4.3.tar.xz -O flac-1.4.3.tar.xz -rm -Rf flac-1.4.3 -tar xfJ flac-1.4.3.tar.xz -cd flac-1.4.3 +rm -Rf flac-* +wget https://ftp.osuosl.org/pub/xiph/releases/flac/flac-$FLAC_VERSION.tar.xz -O flac-$FLAC_VERSION.tar.xz +tar xfJ flac-$FLAC_VERSION.tar.xz +cd flac-$FLAC_VERSION do_cmake -D_OGG_LIBRARY_DIRS=$prefix/lib cd .. ########## SDL2 ########## -wget https://github.com/libsdl-org/SDL/releases/download/release-2.30.7/SDL2-devel-2.30.7-mingw.tar.gz -O SDL2-devel-2.30.7-mingw.tar.gz -rm -Rf SDL2-2.30.7 -tar xfz SDL2-devel-2.30.7-mingw.tar.gz -cd SDL2-2.30.7 +rm -Rf SDL2-* +wget https://github.com/libsdl-org/SDL/releases/download/release-$SDL2_VERSION/SDL2-devel-$SDL2_VERSION-mingw.tar.gz -O SDL2-devel-$SDL2_VERSION-mingw.tar.gz +tar xfz SDL2-devel-$SDL2_VERSION-mingw.tar.gz +cd SDL2-$SDL2_VERSION cp $host/* $prefix -R prefix2=`echo $prefix|sed -e 's/\//\\\\\//'g` -sed -e "s/^prefix=.*/prefix=$prefix2/" -i $prefix/lib/pkgconfig/sdl2.pc +sed -e "s/\/tmp\/tardir\/.*\/build-mingw\/.*mingw..\//$prefix2\//" -i $prefix/bin/sdl2-config +sed -e "s/\/tmp\/tardir\/.*\/build-mingw\/.*mingw..\//$prefix2\//" -i $prefix/lib/libSDL2.la +sed -e "s/\/tmp\/tardir\/.*\/build-mingw\/.*mingw..\//$prefix2\//" -i $prefix/lib/libSDL2main.la +sed -e "s/\/tmp\/tardir\/.*\/build-mingw\/.*mingw..\//$prefix2\//" -i $prefix/lib/libSDL2_test.la +sed -e "s/\/tmp\/tardir\/.*\/build-mingw\/.*mingw..\//$prefix2\//" -i $prefix/lib/pkgconfig/sdl2.pc +sed -e "s/\/tmp\/tardir\/.*\/build-mingw\/.*mingw..\//$prefix2\//" -i $prefix/lib/cmake/SDL2/sdl2-config.cmake cd .. -if test "$host" == "i686-w64-mingw32"; then ########## BROTLI ##########, only needed for 32bit, unsure why - wget https://github.com/google/brotli/archive/refs/tags/v1.1.0.tar.gz -O brotli-1.1.0.tar.gz - rm -Rf brotli-1.1.0 - tar xfz brotli-1.1.0.tar.gz - cd brotli-1.1.0 +rm -Rf brotli-* +if test "$host" == "i686-w64-mingw32"; then + wget https://github.com/google/brotli/archive/refs/tags/v$BROTLI_VERSION.tar.gz -O brotli-$BROTLI_VERSION.tar.gz + tar xfz brotli-$BROTLI_VERSION.tar.gz + cd brotli-$BROTLI_VERSION do_cmake -DCMAKE_CXX_FLAGS=-Wa,-mbig-obj cd .. fi ########## HARFBUZZ ######### -wget https://github.com/harfbuzz/harfbuzz/releases/download/9.0.0/harfbuzz-9.0.0.tar.xz -O harfbuzz-9.0.0.tar.xz -rm -Rf harfbuzz-9.0.0 -tar xfJ harfbuzz-9.0.0.tar.xz -cd harfbuzz-9.0.0 +rm -Rf harfbuzz-* +wget https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION/harfbuzz-$HARFBUZZ_VERSION.tar.xz -O harfbuzz-$HARFBUZZ_VERSION.tar.xz +tar xfJ harfbuzz-$HARFBUZZ_VERSION.tar.xz +cd harfbuzz-$HARFBUZZ_VERSION do_cmake -DCMAKE_CXX_FLAGS=-Wa,-mbig-obj cd .. ########## FREETYPE2 ########## -wget https://sourceforge.net/projects/freetype/files/freetype2/2.13.3/freetype-2.13.3.tar.gz/download -O freetype-2.13.3.tar.gz -rm -Rf freetype-2.13.3 -tar xfz freetype-2.13.3.tar.gz -cd freetype-2.13.3 +rm -Rf freetype-* +wget https://sourceforge.net/projects/freetype/files/freetype2/$FREETYPE2_VERSION/freetype-$FREETYPE2_VERSION.tar.gz/download -O freetype-$FREETYPE2_VERSION.tar.gz +tar xfz freetype-$FREETYPE2_VERSION.tar.gz +cd freetype-$FREETYPE2_VERSION do_cmake -DZLIB_ROOT=/usr/$host/ \ -DFT_DISABLE_BZIP2=TRUE cd .. ########## LIBDISCID ########## -wget http://ftp.eu.metabrainz.org/pub/musicbrainz/libdiscid/libdiscid-0.6.4-win.zip -O libdiscid-0.6.4-win.zip -rm -Rf libdiscid-0.6.4-win -unzip libdiscid-0.6.4-win.zip +rm -Rf libdiscid-* +#wget http://ftp.eu.metabrainz.org/pub/musicbrainz/libdiscid/libdiscid-$LIBDISCID_VERSION-win.zip -O libdiscid-$LIBDISCID_VERSION-win.zip +wget https://github.com/metabrainz/libdiscid/releases/download/v$LIBDISCID_VERSION/libdiscid-$LIBDISCID_VERSION-win.zip -O libdiscid-$LIBDISCID_VERSION-win.zip +unzip libdiscid-$LIBDISCID_VERSION-win.zip if test "$host" == "i686-w64-mingw32"; then - cp -r libdiscid-0.6.4-win/Win32/* $prefix/lib + cp -r libdiscid-$LIBDISCID_VERSION-win/Win32/* $prefix/lib else - cp -r libdiscid-0.6.4-win/x64/* $prefix/lib + cp -r libdiscid-$LIBDISCID_VERSION-win/x64/* $prefix/lib fi -cp -r libdiscid-0.6.4-win/include/discid $prefix/include +cp -r libdiscid-$LIBDISCID_VERSION-win/include/discid $prefix/include cat < $prefix/lib/pkgconfig/libdiscid.pc prefix= exec_prefix= @@ -339,10 +347,10 @@ Cflags: EOF ########## cJSON ########## -wget https://github.com/DaveGamble/cJSON/archive/refs/tags/v1.7.18.tar.gz -O cJSON-1.7.18.tar.gz -rm -Rf cJSON-1.7.18 -tar xfz cJSON-1.7.18.tar.gz -cd cJSON-1.7.18 +rm -Rf cJSON-* +wget https://github.com/DaveGamble/cJSON/archive/refs/tags/v$CJSON_VERSION.tar.gz -O cJSON-$CJSON_VERSION.tar.gz +tar xfz cJSON-$CJSON_VERSION.tar.gz +cd cJSON-$CJSON_VERSION patch -p 1 <//'|sed -e 's/<\/span.*//'` + +if [ f"$LIBMAD_VERSION" != f"$LIBMAD_LATEST_VERSION" ]; then + echo LIBMAD version should have been $LIBMAD_LATEST_VERSION +fi + +LIBJPEGTURBO_LATEST_VERSION=`curl -s https://github.com/libjpeg-turbo/libjpeg-turbo/releases|grep -m 1 "Link--primary Link"|sed -e 's/.*"Link--primary Link">//'|sed -e 's/<.*//'` +if [ f"$LIBJPEGTURBO_VERSION" != f"$LIBJPEGTURBO_LATEST_VERSION" ]; then + echo LIBJPEG-TURBO version should have been $LIBJPEGTURBO_LATEST_VERSION +fi + +LIBPNG_LATEST_VERSION=`curl -s http://www.libpng.org/pub/png/libpng.html|grep -m 1 "The current public release"|sed -e 's/.*release,.*libpng *//'|sed -e 's/<\/B.*//'` +if [ f"$LIBPNG_VERSION" != f"$LIBPNG_LATEST_VERSION" ]; then + echo LIBPNG version should have been $LIBPNG_LATEST_VERSION +fi + +LIBOGG_LATEST_VERSION=`curl -s https://xiph.org/downloads/|grep -m 1 libogg-|sed -e 's/.*libogg-//'|sed -e 's/\.tar\..*//'` +if [ f"$LIBOGG_VERSION" != f"$LIBOGG_LATEST_VERSION" ]; then + echo LIBOGG version should have been $LIBOGG_LATEST_VERSION +fi + +LIBVORBIS_LATEST_VERSION=`curl -s https://xiph.org/downloads/|grep -m 1 libvorbis-|sed -e 's/.*libvorbis-//'|sed -e 's/\.tar\..*//'` +if [ f"$LIBVORBIS_VERSION" != f"$LIBVORBIS_LATEST_VERSION" ]; then + echo LIBVORBIS version should have been $LIBVORBIS_LATEST_VERSION +fi + +FLAC_LATEST_VERSION=`curl -s https://xiph.org/downloads/|grep -m 1 flac-|sed -e 's/.*flac-//'|sed -e 's/\.tar\..*//'` +if [ f"$FLAC_VERSION" != f"$FLAC_LATEST_VERSION" ]; then + echo FLAC version should have been $FLAC_LATEST_VERSION +fi + +SDL2_LATEST_VERSION=`curl -s https://github.com/libsdl-org/SDL/releases|grep -m 1 "Link--primary Link.*>2\."|sed -e 's/.*"Link--primary Link">//'|sed -e 's/<.*//'` +if [ f"$SDL2_VERSION" != f"$SDL2_LATEST_VERSION" ]; then + echo SDL2 version should have been $SDL2_LATEST_VERSION +fi + +BROTLI_LATEST_VERSION=`curl -s https://github.com/google/brotli/releases|grep -m 1 "Link--primary Link.*>v[1-9]"|sed -e 's/.*"Link--primary Link">v//'|sed -e 's/<.*//'` +if [ f"$BROTLI_VERSION" != f"$BROTLI_LATEST_VERSION" ]; then + echo BROTLI version should have been $BROTLI_LATEST_VERSION +fi + +HARFBUZZ_LATEST_VERSION=`curl -s https://github.com/harfbuzz/harfbuzz/releases|grep -m 1 "Link--primary Link"|sed -e 's/.*"Link--primary Link">//'|sed -e 's/<.*//'` +if [ f"$HARFBUZZ_VERSION" != f"$HARFBUZZ_LATEST_VERSION" ]; then + echo HARFBUZZ version should have been $HARFBUZZ_LATEST_VERSION +fi + +FREETYPE2_LATEST_VERSION=`curl -s https://sourceforge.net/projects/freetype/files/freetype2/|grep -m 1 'span.*class="name"'|sed -e 's/.*=\"name\">//'|sed -e 's/<\/span.*//'` +if [ f"$FREETYPE2_VERSION" != f"$FREETYPE2_LATEST_VERSION" ]; then + echo FREETYPE2 version should have been $FREETYPE2_LATEST_VERSION +fi + +LIBDISCID_LATEST_VERSION=`curl -s https://github.com/metabrainz/libdiscid/releases|grep -m 1 "Link--primary Link.*>v[0-9]"|sed -e 's/.*"Link--primary Link">v//'|sed -e 's/<.*//'` +if [ f"$LIBDISCID_VERSION" != f"$LIBDISCID_LATEST_VERSION" ]; then + echo LIBDISCID version should have been $LIBDISCID_LATEST_VERSION +fi + +CJSON_LATEST_VERSION=`curl -s https://github.com/DaveGamble/cJSON/releases|grep -m 1 "Link--primary Link.*>v[1-9]"|sed -e 's/.*"Link--primary Link">v//'|sed -e 's/<.*//'` +if [ f"$CJSON_VERSION" != f"$CJSON_LATEST_VERSION" ]; then + echo cJSON version should have been $CJSON_LATEST_VERSION +fi + +ANCIENT_LATEST_VERSION=`curl -s https://github.com/temisu/ancient/releases|grep -m 1 "Link--primary Link.*>Ancient "|sed -e 's/.*"Link--primary Link">Ancient *//'|sed -e 's/<.*//'` +if [ f"$ANCIENT_VERSION" != f"$ANCIENT_LATEST_VERSION" ]; then + echo ANCIENT version should have been $ANCIENT_LATEST_VERSION +fi + +LIBICONV_LATEST_VERSION=`curl -s https://www.gnu.org/software/libiconv/|grep -m 1 'libiconv-.*\.tar\.gz'|sed -e 's/.*libiconv-//'|sed -e 's/\.tar\..*//'` +if [ f"$LIBICONV_VERSION" != f"$LIBICONV_LATEST_VERSION" ]; then + echo LIBICONV version should have been $LIBICONV_LATEST_VERSION +fi + +GAMEMUSICEMU_LATEST_VERSION=`curl -s https://github.com/libgme/game-music-emu/releases|grep -m 1 "Link--primary Link.*>game-music-emu-"|sed -e 's/.*"Link--primary Link">game-music-emu-//'|sed -e 's/<.*//'` +if [ f"$GAMEMUSICEMU_VERSION" != f"$GAMEMUSICEMU_LATEST_VERSION" ]; then + echo Game Music Emu version should have been $GAMEMUSICEMU_LATEST_VERSION +fi + +UNIFONT_LATEST_VERSION=`curl -s https://unifoundry.com/unifont/index.html|grep -m 1 "unifont-.*otf"|sed -e 's/.*unifont-//'|sed -e 's/\.otf.*//'` +if [ f"$UNIFONT_VERSION" != f"$UNIFONT_LATEST_VERSION" ]; then + echo UNIFONT version should have been $UNIFONT_LATEST_VERSION +fi diff --git a/mingw/versionsconf.sh b/mingw/versionsconf.sh new file mode 100644 index 00000000..417d6415 --- /dev/null +++ b/mingw/versionsconf.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +BZIP2_VERSION="1.0.8" +LIBMAD_VERSION="0.15.1b" +LIBJPEGTURBO_VERSION="3.1.0" +LIBPNG_VERSION="1.6.44" +LIBOGG_VERSION="1.3.5" +LIBVORBIS_VERSION="1.3.7" +FLAC_VERSION="1.4.3" +SDL2_VERSION="2.30.10" +BROTLI_VERSION="1.1.0" +HARFBUZZ_VERSION="10.1.0" +FREETYPE2_VERSION="2.13.3" +LIBDISCID_VERSION="0.6.4" +CJSON_VERSION="1.7.18" +ANCIENT_VERSION="2.2.0" +LIBICONV_VERSION="1.18" +GAMEMUSICEMU_VERSION="0.6.3" +UNIFONT_VERSION="16.0.02"