#!/bin/sh ABI=i686 GLIB= ADW= GTK= use_cache="no" make_zip="no" gtkv="3" for opt in "$@"; do case "$opt" in "-c"|"--cache") use_cache="yes" ;; "-z"|"--zip") make_zip="yes" ;; "-2") gtkv="2" ;; "-3") gtkv="3" ;; "-h"|"--help") echo "gtk-bundle-from-msys2.sh [-c] [-z] [-2 | -3]" echo " -c Use pacman cache. Otherwise pacman will download" echo " archive files" echo " -z Create a zip afterwards" echo " -2 Prefer gtk2" echo " -3 Prefer gtk3" exit 1 ;; *) cachedir="$opt" ;; esac done if [ -z "$cachedir" ]; then cachedir="/var/cache/pacman/pkg" fi if [ "$use_cache" = "yes" ] && ! [ -d "$cachedir" ]; then echo "Cache dir \"$cachedir\" not a directory" exit 1 fi gtk="gtk$gtkv" getpkg() { if [ "$use_cache" = "yes" ]; then ls $cachedir/mingw-w64-$ABI-$1-* | sort -V | tail -n 1 else pacman -Sp mingw-w64-$ABI-$1 fi } GLIB=$(getpkg glib2) ATK=$(getpkg atk) PANGO=$(getpkg pango) CAIRO=$(getpkg cairo) ADW=$(getpkg adwaita-icon-theme) GTK=$(getpkg $gtk) cat <