diff options
Diffstat (limited to 'windows/cross_build_mxe.sh')
| -rwxr-xr-x | windows/cross_build_mxe.sh | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/windows/cross_build_mxe.sh b/windows/cross_build_mxe.sh index 4862d32..827ea94 100755 --- a/windows/cross_build_mxe.sh +++ b/windows/cross_build_mxe.sh @@ -26,8 +26,12 @@ set -o pipefail MXE_REPO_URL='https://github.com/mxe/mxe.git' MXE_COMMIT=${MXE_COMMIT:-a9135e50775889ef9448cf12b72da0ea25aa04c1} MXE_TARGETS='i686-w64-mingw32.shared x86_64-w64-mingw32.shared' -MXE_PACKAGES='cc qtbase ffmpeg openssl miniupnpc libevent sqlite webrtc-audio-processing nsis' +MXE_PACKAGES='cc qtbase ffmpeg openssl miniupnpc libevent sqlite webrtc-audio-processing zxing-cpp nsis' MXE_PATCHES='mxe_qtbase_strip_excess_deps.patch mxe_ffmpeg_strip_excess_deps.patch' +# Package recipes MXE does not have (yet), kept in this directory and copied +# into the MXE tree's src/ - the recipe and, where there is one, the test +# program it compiles. +MXE_EXTRA_RECIPES='zxing-cpp.mk zxing-cpp-test.cpp' windows_dir=$(cd "$(dirname "$0")" && pwd) mxe_dir=$windows_dir/mxe @@ -143,6 +147,32 @@ apply the patch again (the affected libraries will be rebuilt by MXE)." done } +# step 3b: copy our own package recipes into the MXE tree. They are new files +# there, untracked by MXE's git, so they neither count as local modifications +# for checkout_mxe_commit nor get in the way of the patches above. Copied on +# every run so that a recipe changed here reaches the tree; MXE does not rebuild +# a package that is already built because its recipe changed, though - remove +# usr/<target>/installed/<package> for that. +function copy_mxe_recipes { + local recipe + + for recipe in $MXE_EXTRA_RECIPES + do + test -f "$windows_dir/$recipe" || die "recipe $windows_dir/$recipe not found" + + if cmp -s "$windows_dir/$recipe" "$mxe_dir/src/$recipe" + then + echo "*** $recipe is already in place, skipping" + continue + fi + + test -e "$mxe_dir/src/$recipe" && echo "*** WARNING: replacing $mxe_dir/src/$recipe, which differs from $windows_dir/$recipe" >&2 + + echo "*** copying $recipe into $mxe_dir/src" + cp "$windows_dir/$recipe" "$mxe_dir/src/$recipe" + done +} + # MXE packages from $MXE_PACKAGES that are not built yet, as 'package (target)' function missing_mxe_packages { local target package @@ -228,7 +258,7 @@ rm -rf build_pica-pica mkdir -p build_pica-pica cd build_pica-pica #MXE builds qtbase 5, while configure defaults to Qt 6 -../../../configure --host=$arch --prefix=$PREFIX --with-qt=qt5 --enable-d3d12va +../../../configure --host=$arch --prefix=$PREFIX --with-qt=qt5 --enable-d3d12va --enable-qrcode make -j$(nproc) make install make clean @@ -300,6 +330,7 @@ cd .. clone_mxe checkout_mxe_commit apply_mxe_patches +copy_mxe_recipes build_mxe_packages cd "$mxe_dir" |
