Compare commits

..

No commits in common. "2dc4e9c13b33ae38099f159a9fd87b4c8ea31978" and "1eee1831a5f6af817c835fbf69bb8c31bde4cb49" have entirely different histories.

4 changed files with 24 additions and 39 deletions

View File

@ -68,7 +68,7 @@ dependencies listed at the beginning of 'msys2-configure.sh',
plus rsvg-convert from librsvg2, and icotool from icoutils. plus rsvg-convert from librsvg2, and icotool from icoutils.
Beware that the build will take up about a gigabyte of disk space. Beware that the build will take up about a gigabyte of disk space.
$ sh -e msys2-configure.sh builddir $ sh -e msys2-cross-configure.sh builddir
$ meson install -C builddir $ meson install -C builddir
If everything succeeds, you will find a portable build of the application If everything succeeds, you will find a portable build of the application

3
fiv.c
View File

@ -1438,9 +1438,6 @@ on_key_press(G_GNUC_UNUSED GtkWidget *widget, GdkEventKey *event,
break; break;
case 0: case 0:
switch (event->keyval) { switch (event->keyval) {
case GDK_KEY_BackSpace:
go_back();
return TRUE;
case GDK_KEY_q: case GDK_KEY_q:
gtk_widget_destroy(g.window); gtk_widget_destroy(g.window);
return TRUE; return TRUE;

View File

@ -1,25 +1,14 @@
#!/bin/sh -e #!/bin/sh -e
# msys2-configure.sh: set up an MSYS2-based Meson build (x86-64 by default) # msys2-configure.sh: set up an MSYS2-based Meson build targeting x86-64.
# # Dependencies: AWK, sed, sha256sum, cURL, bsdtar,
# Dependencies: AWK, sed, coreutils, cURL, bsdtar (libarchive),
# wine64, Meson, mingw-w64-binutils, mingw-w64-gcc, pkg-config # wine64, Meson, mingw-w64-binutils, mingw-w64-gcc, pkg-config
# repository=https://repo.msys2.org/mingw/mingw64/
# We support running directly from within MSYS2 on Windows,
# albeit while still downloading a complete copy of runtime depencies.
pkg=${MINGW_PACKAGE_PREFIX:-mingw-w64-x86_64}
prefix=${MSYSTEM_PREFIX:-/mingw64}
repo=https://repo.msys2.org/mingw$prefix
chost=${MSYSTEM_CHOST:-x86_64-w64-mingw32}
carch=${MSYSTEM_CARCH:-x86_64}
[ "$carch" = "i686" ] && carch=x86
# Support running directly from within MSYS2 on Windows.
if [ -n "$MSYSTEM" ] if [ -n "$MSYSTEM" ]
then then
wine64() { "$@"; } wine64() { "$@"; }
awk() { command awk -v RS='\r?\n' "$@"; } awk() { command awk -v RS='\r?\n' "$@"; }
pacman -S --needed libarchive $pkg-ca-certificates $pkg-gcc $pkg-icoutils \
$pkg-librsvg $pkg-meson $pkg-pkgconf
fi fi
status() { status() {
@ -28,7 +17,7 @@ status() {
dbsync() { dbsync() {
status Fetching repository DB status Fetching repository DB
[ -f db.tsv ] || curl -# "$repo$prefix.db" | bsdtar -xOf- | awk ' [ -f db.tsv ] || curl -# "$repository/mingw64.db" | bsdtar -xOf- | awk '
function flush() { print f["%NAME%"] f["%FILENAME%"] f["%DEPENDS%"] } function flush() { print f["%NAME%"] f["%FILENAME%"] f["%DEPENDS%"] }
NR > 1 && $0 == "%FILENAME%" { flush(); for (i in f) delete f[i] } NR > 1 && $0 == "%FILENAME%" { flush(); for (i in f) delete f[i] }
!/^[^%]/ { field = $0; next } { f[field] = f[field] $0 "\t" } !/^[^%]/ { field = $0; next } { f[field] = f[field] $0 "\t" }
@ -49,7 +38,7 @@ fetch() {
} for (i = 0; i < ARGC; i++) get(ARGV[i]) }' "$@" | while IFS= read -r name } for (i = 0; i < ARGC; i++) get(ARGV[i]) }' "$@" | while IFS= read -r name
do do
status Fetching "$name" status Fetching "$name"
[ -f "packages/$name" ] || curl -#o "packages/$name" "$repo/$name" [ -f "packages/$name" ] || curl -#o "packages/$name" "$repository/$name"
done done
version=$(curl -# https://exiftool.org/ver.txt) version=$(curl -# https://exiftool.org/ver.txt)
@ -70,8 +59,7 @@ extract() {
do [ -d "$subdir" -a "$subdir" != packages ] && rm -rf -- "$subdir" do [ -d "$subdir" -a "$subdir" != packages ] && rm -rf -- "$subdir"
done done
for i in packages/* for i in packages/*
do bsdtar -xf "$i" --strip-components 1 \ do bsdtar -xf "$i" --strip-components 1 mingw64
--exclude '*/share/man' --exclude '*/share/doc'
done done
bsdtar -xf exiftool.tar.gz bsdtar -xf exiftool.tar.gz
@ -93,30 +81,28 @@ configure() {
setup() { setup() {
status Setting up Meson status Setting up Meson
wrap=true pclibdir=$msys2_root/share/pkgconfig:$msys2_root/lib/pkgconfig [ -n "$MSYSTEM" ] && wrap=false || wrap=true
[ -n "$MSYSTEM" ] && \
wrap=false pclibdir="$(pwd -W)/share/pkgconfig;$(pwd -W)/lib/pkgconfig"
cat >"$toolchain" <<-EOF cat >"$toolchain" <<-EOF
[binaries] [binaries]
c = '$chost-gcc' c = 'x86_64-w64-mingw32-gcc'
cpp = '$chost-g++' cpp = 'x86_64-w64-mingw32-g++'
ar = '$chost-gcc-ar' ar = 'x86_64-w64-mingw32-gcc-ar'
ranlib = '$chost-gcc-ranlib' ranlib = 'x86_64-w64-mingw32-gcc-ranlib'
strip = '$chost-strip' strip = 'x86_64-w64-mingw32-strip'
windres = '$chost-windres' windres = 'x86_64-w64-mingw32-windres'
pkgconfig = 'pkg-config' pkgconfig = 'pkg-config'
[properties] [properties]
sys_root = '$builddir' sys_root = '$builddir'
msys2_root = '$msys2_root' msys2_root = '$msys2_root'
pkg_config_libdir = '$pclibdir' pkg_config_libdir = '$msys2_root/share/pkgconfig:$msys2_root/lib/pkgconfig'
needs_exe_wrapper = $wrap needs_exe_wrapper = $wrap
[host_machine] [host_machine]
system = 'windows' system = 'windows'
cpu_family = '$carch' cpu_family = 'x86_64'
cpu = '$carch' cpu = 'x86_64'
endian = 'little' endian = 'little'
EOF EOF
@ -131,13 +117,15 @@ toolchain=$builddir/msys2-cross-toolchain.meson
# This directory name matches the prefix in .pc files, so we don't need to # This directory name matches the prefix in .pc files, so we don't need to
# modify them (pkgconf has --prefix-variable, but Meson can't pass that option). # modify them (pkgconf has --prefix-variable, but Meson can't pass that option).
msys2_root=$builddir$prefix msys2_root=$builddir/mingw64
mkdir -p "$msys2_root" mkdir -p "$msys2_root"
cd "$msys2_root" cd "$msys2_root"
dbsync dbsync
fetch $pkg-gtk3 $pkg-lcms2 $pkg-libraw $pkg-libheif $pkg-perl \ fetch mingw-w64-x86_64-gtk3 mingw-w64-x86_64-lcms2 \
$pkg-perl-win32-api $pkg-libwinpthread-git # Because we don't do "provides"? mingw-w64-x86_64-libraw mingw-w64-x86_64-libheif \
mingw-w64-x86_64-perl mingw-w64-x86_64-perl-win32-api \
mingw-w64-x86_64-libwinpthread-git # Because we don't do "provides"?
verify verify
extract extract
configure configure

View File

@ -161,7 +161,7 @@ static bool
tiffer_subifd( tiffer_subifd(
const struct tiffer *self, uint32_t offset, struct tiffer *subreader) const struct tiffer *self, uint32_t offset, struct tiffer *subreader)
{ {
if (self->begin > self->end || self->end - self->begin < offset) if (self->end - self->begin < offset)
return false; return false;
*subreader = *self; *subreader = *self;