From c6b08f21e77c1356248a1b1d142b6abe134cae36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Sun, 20 Sep 2020 15:16:15 +0200 Subject: [PATCH 1/8] Windows: Create GTK bundle for x86_64 and suppt non-native execution Changes in the bundle creation script: - the GTK (and other dependencies) bundle is now created for the x86_64 platform - the new parameter "-x" allows to run script on a Linux system using Wine, therefore it is necessary to run the post-install scripts after all packages have been extracted. - use "-Sdd" for Pacman to ignore dependencies as we resolve them manually - do not use "tar -x --xz" as Pacman nowadays also downloads .zst packages, instead just download the file and let tar choose the format automatically based on the filename - install grep with Pacman as the build and target platform are now identical - update GTK dependencies to match current packages --- scripts/gtk-bundle-from-msys2.sh | 105 +++++++++++++++++++------------ 1 file changed, 64 insertions(+), 41 deletions(-) diff --git a/scripts/gtk-bundle-from-msys2.sh b/scripts/gtk-bundle-from-msys2.sh index b6ad18a535..5015381704 100644 --- a/scripts/gtk-bundle-from-msys2.sh +++ b/scripts/gtk-bundle-from-msys2.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Fetch and extract Geany dependencies for Windows/MSYS2 # This script will download (or use Pacman's cache) to extract @@ -6,16 +6,19 @@ # To be run within a MSYS2 shell. The extracted files will be # placed into the current directory. -ABI=i686 +ABI=x86_64 # do not change, i686 is not supported any longer use_cache="no" make_zip="no" gtkv="3" run_pi="y" +cross="no" UNX_UTILS_URL="https://download.geany.org/contrib/UnxUpdates.zip" -# path to an installation of a MSYS2 installation in the native architecture matching $ABI -# leave empty if the script is called already from the same MSYS2 architecture as $ABI -MSYS2_ABI_PATH="/c/msys32" + +# Wine commands for 32bit and 64bit binaries (we still need 32bit for UnxUtils sort.exe) +# Used only when "-x" is set +EXE_WRAPPER_32="mingw-w64-i686-wine" +EXE_WRAPPER_64="mingw-w64-x86_64-wine" package_urls="" gtk3_dependency_pkgs=" @@ -26,18 +29,25 @@ adwaita-icon-theme packages=" gcc-libs +grep pcre +xz zlib +zstd expat libffi libiconv brotli bzip2 +freeglut libffi libpng gettext glib2 graphite2 +jasper +libjpeg-turbo +libtiff libwinpthread-git harfbuzz fontconfig @@ -67,6 +77,9 @@ handle_command_line_options() { "-n") run_pi="" ;; + "-x") + cross="yes" + ;; "-h"|"--help") echo "gtk-bundle-from-msys2.sh [-c] [-h] [-n] [-z] [-3] [CACHEDIR]" echo " -c Use pacman cache. Otherwise pacman will download" @@ -75,6 +88,7 @@ handle_command_line_options() { echo " -n Do not run post install scripts of the packages" echo " -z Create a zip afterwards" echo " -3 Prefer gtk3" + echo " -x Set when the script is executed in a cross-compilation context (e.g. to use wine)" echo "CACHEDIR Directory where to look for cached packages (default: /var/cache/pacman/pkg)" exit 1 ;; @@ -85,6 +99,8 @@ handle_command_line_options() { done } +set -e # stop on errors + initialize() { if [ -z "$cachedir" ]; then cachedir="/var/cache/pacman/pkg" @@ -95,6 +111,12 @@ initialize() { exit 1 fi + if [ "$cross" != "yes" ]; then + # if running natively, we do not need wine or any other wrappers + EXE_WRAPPER_32="" + EXE_WRAPPER_64="" + fi + gtk="gtk$gtkv" eval "gtk_dependency_pkgs=\${${gtk}_dependency_pkgs}" @@ -107,17 +129,18 @@ ${gtk} _getpkg() { if [ "$use_cache" = "yes" ]; then - package_info=`pacman -Qi mingw-w64-$ABI-$1` - package_version=`echo "$package_info" | grep "^Version " | cut -d':' -f 2 | tr -d '[[:space:]]'` + package_info=$(pacman -Qi mingw-w64-$ABI-$1) + package_version=$(echo "$package_info" | grep "^Version " | cut -d':' -f 2 | tr -d '[[:space:]]') ls $cachedir/mingw-w64-${ABI}-${1}-${package_version}-* | sort -V | tail -n 1 else - pacman -Sp mingw-w64-${ABI}-${1} + # -dd to ignore dependencies as we listed them already above in $packages + pacman -Sddp mingw-w64-${ABI}-${1} fi } _remember_package_source() { if [ "$use_cache" = "yes" ]; then - package_url=`pacman -Sp mingw-w64-${ABI}-${2}` + package_url=$(pacman -Sddp mingw-w64-${ABI}-${2}) else package_url="${1}" fi @@ -138,11 +161,10 @@ extract_packages() { fi else echo "Download $pkg using curl" - curl -L "$pkg" | tar -x --xz - fi - if [ -n "$run_pi" ] && [ -f .INSTALL ]; then - echo "Running post_install script for \"$i\"" - /bin/bash -c ". .INSTALL; post_install" + filename=$(basename "$pkg") + curl -s -o "$filename" -l "$pkg" + tar xf "$filename" + rm "$filename" fi if [ "$make_zip" = "yes" -a "$i" = "$gtk" ]; then VERSION=$(grep ^pkgver .PKGINFO | sed -e 's,^pkgver = ,,' -e 's,-.*$,,') @@ -153,16 +175,27 @@ extract_packages() { move_extracted_files() { echo "Move extracted data to destination directory" - if [ -d mingw32 ]; then + if [ -d mingw64 ]; then for d in bin etc home include lib locale share var; do - if [ -d "mingw32/$d" ]; then + if [ -d "mingw64/$d" ]; then rm -rf $d # prevent sporadic 'permission denied' errors on my system, not sure why they happen sleep 0.5 - mv mingw32/$d . + mv mingw64/$d . fi done - rmdir mingw32 + rmdir mingw64 + fi +} + +delayed_post_install() { + if [ "$run_pi" ]; then + echo "Execute delayed post install tasks" + # Commands have been collected manually from the various .INSTALL scripts + ${EXE_WRAPPER_64} bin/fc-cache.exe -f + ${EXE_WRAPPER_64} bin/gdk-pixbuf-query-loaders.exe --update-cache + ${EXE_WRAPPER_64} bin/gtk-update-icon-cache-3.0.exe -q -t -f share/icons/hicolor + ${EXE_WRAPPER_64} bin/gtk-update-icon-cache-3.0.exe -q -t -f share/icons/Adwaita fi } @@ -190,40 +223,27 @@ cleanup_unnecessary_files() { rm -rf share/doc rm -rf share/gdb rm -rf share/gettext + rm -rf share/gettext-* rm -rf share/gir-1.0 rm -rf share/glib-2.0/codegen rm -rf share/glib-2.0/gdb rm -rf share/glib-2.0/gettext + rm -rf share/glib-2.0/schemas rm -rf share/graphite2 rm -rf share/gtk-3.0 rm -rf share/gtk-doc + rm -rf share/icons/Adwaita/cursors rm -rf share/info rm -rf share/man + rm -rf share/thumbnailers rm -rf share/xml + rm -rf usr/share/libalpm # cleanup binaries and libs (delete anything except *.dll and GSpawn helper binaries) - find bin ! -name '*.dll' ! -name 'gspawn-win32-helper*.exe' -type f -delete + find bin ! -name '*.dll' ! -name 'grep.exe' ! -name 'gspawn-win32-helper*.exe' -type f -delete # cleanup empty directories find . -type d -empty -delete } -copy_grep_and_dependencies() { - own_arch=$(arch) - if [ "${own_arch}" == "${ABI}" -o -z "${MSYS2_ABI_PATH}" ]; then - bin_dir="/usr/bin" - else - # TODO extract grep and dependencies from Pacman packages according to the target ABI - bin_dir="${MSYS2_ABI_PATH}/usr/bin" - fi - echo "Copy 'grep' from ${bin_dir}" - cp "${bin_dir}/grep.exe" "bin/" - # dependencies for grep.exe - cp "${bin_dir}/msys-2.0.dll" "bin/" - cp "${bin_dir}/msys-gcc_s-1.dll" "bin/" - cp "${bin_dir}/msys-iconv-2.dll" "bin/" - cp "${bin_dir}/msys-intl-8.dll" "bin/" - cp "${bin_dir}/msys-pcre-1.dll" "bin/" -} - download_and_extract_sort() { echo "Download and unpack 'sort'" # add sort to the bin directory @@ -234,8 +254,11 @@ download_and_extract_sort() { } create_bundle_dependency_info_file() { - grep_version="$(bin/grep --version | head -n1)" - sort_version="$(bin/sort --version | head -n1)" + # sort.exe from UnxUtils is a 32bit binary, so use $EXE_WRAPPER_32 + sort_version="$(${EXE_WRAPPER_32} bin/sort.exe --version | sed -n 1p)" + # use "sed -n 1p" instead of "head -n1" as grep will otherwise prints a weird error, + # probably because the output pipe is closed prematurely + grep_version="$(${EXE_WRAPPER_64} bin/grep.exe --version | sed -n 1p)" filename="ReadMe.Dependencies.Geany.txt" cat << EOF > "${filename}" This installation contains dependencies for Geany which are distributed @@ -248,7 +271,7 @@ sort.exe is extracted from the ZIP archive at ${UNX_UTILS_URL}. Sort version: ${sort_version} -grep.exe is taken from a 32bit MSYS2 installation and +grep.exe is taken from a 64bit MSYS2 installation and is bundled together with its dependencies. Grep version: ${grep_version} @@ -275,8 +298,8 @@ handle_command_line_options $@ initialize extract_packages move_extracted_files +delayed_post_install cleanup_unnecessary_files -copy_grep_and_dependencies download_and_extract_sort create_bundle_dependency_info_file create_zip_archive From a2b125b76848f143b49fcbdbcea3e7980deb41d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Sun, 20 Sep 2020 15:39:07 +0200 Subject: [PATCH 2/8] Remove hard-coded paths and installer name from NSIS installer script This makes the paths for external resources configurable using command line flags (e.g. /DGEANY_THEMES_DIR=/something/geany-themes) and also the resulting installer filename can be set via command line flags. The "INCLUDE_GTK" command line is removed as we always include the GTK bundle. The GTK version detection was removed and now we always bundle the GTK3 specific CSS files. --- geany.nsi.in | 96 +++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 49 deletions(-) diff --git a/geany.nsi.in b/geany.nsi.in index ac2959463d..9a9e1e66f2 100644 --- a/geany.nsi.in +++ b/geany.nsi.in @@ -42,7 +42,6 @@ Unicode true !define PRODUCT_EXE "$INSTDIR\bin\Geany.exe" !define PRODUCT_REGNAME "Geany.ProjectFile" !define PRODUCT_EXT ".geany" -!define RESOURCEDIR "geany-${PRODUCT_VERSION}" !define GTK_VERSION @GTK_VERSION@ ;;;;;;;;;;;;;;;;;;;;; @@ -55,19 +54,28 @@ VIAddVersionKey "ProductVersion" "${PRODUCT_VERSION}" VIAddVersionKey "LegalCopyright" "Copyright 2005 The Geany contributors" VIAddVersionKey "FileDescription" "${PRODUCT_NAME} Installer" -BrandingText "$(^NAME) installer (NSIS 3.04)" -InstallDir "$PROGRAMFILES\Geany" +BrandingText "$(^NAME) installer (NSIS ${NSIS_VERSION})" +InstallDir "$PROGRAMFILES64\Geany" Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" SetCompressor /SOLID lzma ShowInstDetails hide ShowUnInstDetails hide XPStyle on ManifestSupportedOS all -!ifdef INCLUDE_GTK -OutFile "geany-${PRODUCT_VERSION}_setup.exe" -!else -OutFile "geany-${PRODUCT_VERSION}_nogtk_setup.exe" +!ifndef GEANY_INSTALLER_NAME +!define GEANY_INSTALLER_NAME "geany-${PRODUCT_VERSION}_setup.exe" !endif +!ifndef GEANY_RELEASE_DIR +!define GEANY_RELEASE_DIR "geany-${PRODUCT_VERSION}" +!endif +!ifndef GEANY_THEMES_DIR +!define GEANY_THEMES_DIR "..\geany-themes" +!endif +!ifndef GTK_BUNDLE_DIR +!define GTK_BUNDLE_DIR "gtk" +!endif + +OutFile "${GEANY_INSTALLER_NAME}" Var Answer Var UserName @@ -93,7 +101,7 @@ ReserveFile "${NSISDIR}\Plugins\x86-unicode\LangDLL.dll" !insertmacro MUI_PAGE_WELCOME ; License page ;!define MUI_LICENSEPAGE_RADIOBUTTONS -!insertmacro MUI_PAGE_LICENSE "${RESOURCEDIR}\Copying.txt" +!insertmacro MUI_PAGE_LICENSE "${GEANY_RELEASE_DIR}\Copying.txt" ; Components page !insertmacro MUI_PAGE_COMPONENTS ; Directory page @@ -129,45 +137,41 @@ Section "!Program Files" SEC01 SetOverwrite ifnewer SetOutPath "$INSTDIR" - File "${RESOURCEDIR}\*.txt" + File "${GEANY_RELEASE_DIR}\*.txt" SetOutPath "$INSTDIR\bin" - File "${RESOURCEDIR}\bin\Geany.exe" - File "${RESOURCEDIR}\bin\*Geany*.dll" + File "${GEANY_RELEASE_DIR}\bin\Geany.exe" + File "${GEANY_RELEASE_DIR}\bin\*Geany*.dll" # non-GTK dependencies - File "gtk\bin\libgcc_s_dw*.dll" - File "gtk\bin\libstdc++-*.dll" - File "gtk\bin\libwinpthread*.dll" + File "${GTK_BUNDLE_DIR}\bin\libgcc_s_seh*.dll" + File "${GTK_BUNDLE_DIR}\bin\libstdc++-*.dll" + File "${GTK_BUNDLE_DIR}\bin\libwinpthread*.dll" SetOutPath "$INSTDIR\libexec" - File /r "${RESOURCEDIR}\libexec\*" + File /r "${GEANY_RELEASE_DIR}\libexec\*" SetOutPath "$INSTDIR\data" - File "${RESOURCEDIR}\data\GPL-2" - File "${RESOURCEDIR}\data\filetype_extensions.conf" - File "${RESOURCEDIR}\data\geany.glade" -!if ${GTK_VERSION} >= 3 - File "${RESOURCEDIR}\data\geany-3.20.css" - File "${RESOURCEDIR}\data\geany.css" -!else - File "${RESOURCEDIR}\data\geany.gtkrc" -!endif - File "${RESOURCEDIR}\data\snippets.conf" - File "${RESOURCEDIR}\data\ui_toolbar.xml" + File "${GEANY_RELEASE_DIR}\data\GPL-2" + File "${GEANY_RELEASE_DIR}\data\filetype_extensions.conf" + File "${GEANY_RELEASE_DIR}\data\geany.glade" + File "${GEANY_RELEASE_DIR}\data\geany-3.20.css" + File "${GEANY_RELEASE_DIR}\data\geany.css" + File "${GEANY_RELEASE_DIR}\data\snippets.conf" + File "${GEANY_RELEASE_DIR}\data\ui_toolbar.xml" SetOutPath "$INSTDIR\data\filedefs" - File /r "${RESOURCEDIR}\data\filedefs\*" + File /r "${GEANY_RELEASE_DIR}\data\filedefs\*" SetOutPath "$INSTDIR\data\templates" - File /r "${RESOURCEDIR}\data\templates\*" + File /r "${GEANY_RELEASE_DIR}\data\templates\*" SetOutPath "$INSTDIR\data\colorschemes" - File /r "${RESOURCEDIR}\data\colorschemes\*" + File /r "${GEANY_RELEASE_DIR}\data\colorschemes\*" # Geany color schemes project, don't bail out if they are missing - File /nonfatal /r "..\geany-themes\colorschemes\*.conf" + File /nonfatal /r "${GEANY_THEMES_DIR}\colorschemes\*.conf" SetOutPath "$INSTDIR\share\icons" - File /r "${RESOURCEDIR}\share\icons\*" + File /r "${GEANY_RELEASE_DIR}\share\icons\*" SetOutPath "$INSTDIR" @@ -192,24 +196,22 @@ Section "Plugins" SEC02 SectionIn 1 SetOverwrite ifnewer SetOutPath "$INSTDIR\lib\geany" - File "${RESOURCEDIR}\lib\geany\*.dll" + File "${GEANY_RELEASE_DIR}\lib\geany\*.dll" SectionEnd Section "Language Files" SEC03 SectionIn 1 SetOutPath "$INSTDIR\share\locale" - File /r "${RESOURCEDIR}\share\locale\*" -!ifdef INCLUDE_GTK + File /r "${GEANY_RELEASE_DIR}\share\locale\*" SetOutPath "$INSTDIR\share\locale" - File /r "gtk\share\locale\*" -!endif + File /r "${GTK_BUNDLE_DIR}\share\locale\*" SectionEnd Section "Documentation" SEC04 SectionIn 1 SetOverwrite ifnewer SetOutPath "$INSTDIR\share\doc" - File /r "${RESOURCEDIR}\share\doc\*" + File /r "${GEANY_RELEASE_DIR}\share\doc\*" WriteIniStr "$INSTDIR\Documentation.url" "InternetShortcut" "URL" "$INSTDIR\share\doc\geany\html\index.html" !insertmacro MUI_STARTMENU_WRITE_BEGIN ${PRODUCT_NAME} CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Documentation.lnk" "$INSTDIR\Documentation.url" @@ -220,26 +222,24 @@ Section "Autocompletion Tags" SEC05 SectionIn 1 SetOverwrite ifnewer SetOutPath "$INSTDIR\data\tags" - File /r "${RESOURCEDIR}\data\tags\*" + File /r "${GEANY_RELEASE_DIR}\data\tags\*" SectionEnd ; Include GTK runtime library but only if desired from command line -!ifdef INCLUDE_GTK Section "GTK ${GTK_VERSION} Runtime Environment" SEC06 SectionIn 1 SetOverwrite ifnewer SetOutPath "$INSTDIR" - File "gtk\ReadMe.Dependencies.Geany.txt" + File "${GTK_BUNDLE_DIR}\ReadMe.Dependencies.Geany.txt" SetOutPath "$INSTDIR\bin" - File /r "gtk\bin\*" + File /r "${GTK_BUNDLE_DIR}\bin\*" SetOutPath "$INSTDIR\etc" - File /r "gtk\etc\*" + File /r "${GTK_BUNDLE_DIR}\etc\*" SetOutPath "$INSTDIR\lib" - File /r "gtk\lib\*" + File /r "${GTK_BUNDLE_DIR}\lib\*" SetOutPath "$INSTDIR\share" - File /r /x "*.mo" "gtk\share\*" + File /r /x "*.mo" "${GTK_BUNDLE_DIR}\share\*" SectionEnd -!endif Section "Context Menus" SEC07 SectionIn 1 @@ -258,10 +258,10 @@ SectionEnd Section "Development files" SEC09 SetOverwrite ifnewer SetOutPath "$INSTDIR\include" - File /r "${RESOURCEDIR}\include\*" + File /r "${GEANY_RELEASE_DIR}\include\*" SetOutPath "$INSTDIR\lib\pkgconfig" - File "${RESOURCEDIR}\lib\pkgconfig\geany.pc" + File "${GEANY_RELEASE_DIR}\lib\pkgconfig\geany.pc" SectionEnd Section -AdditionalIcons @@ -348,9 +348,7 @@ SectionEnd !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "Various translations of Geany's interface." !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Manual in Text and HTML format." !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} "Symbol lists necessary for auto completion of symbols." -!ifdef INCLUDE_GTK !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} "You need these files to run Geany. If you have already installed a GTK Runtime Environment (${GTK_VERSION} or higher), you can skip it." -!endif !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} "Add context menu item 'Open With Geany'" !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} "Create shortcuts for Geany on the desktop and in the Quicklaunch Bar" !insertmacro MUI_DESCRIPTION_TEXT ${SEC09} "You need these files only if you want to develop own plugins for Geany. If unsure, you can skip it." From b9dd79b6e5d40ddd46fc0598df4ab0fe52413cbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Sat, 7 Nov 2020 12:03:11 +0100 Subject: [PATCH 3/8] Windows: Replace GTK2 by (upcoming) GTK4 in bundle script --- scripts/gtk-bundle-from-msys2.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/gtk-bundle-from-msys2.sh b/scripts/gtk-bundle-from-msys2.sh index 5015381704..fe81e2cdcc 100644 --- a/scripts/gtk-bundle-from-msys2.sh +++ b/scripts/gtk-bundle-from-msys2.sh @@ -21,11 +21,8 @@ EXE_WRAPPER_32="mingw-w64-i686-wine" EXE_WRAPPER_64="mingw-w64-x86_64-wine" package_urls="" -gtk3_dependency_pkgs=" -libepoxy -hicolor-icon-theme -adwaita-icon-theme -" +gtk3_dependency_pkgs="" +gtk4_dependency_pkgs="" packages=" gcc-libs @@ -46,6 +43,7 @@ gettext glib2 graphite2 jasper +libepoxy libjpeg-turbo libtiff libwinpthread-git @@ -60,6 +58,8 @@ pango cairo pixman gdk-pixbuf2 +hicolor-icon-theme +adwaita-icon-theme " handle_command_line_options() { @@ -74,6 +74,9 @@ handle_command_line_options() { "-3") gtkv="3" ;; + "-4") + gtkv="4" + ;; "-n") run_pi="" ;; @@ -81,13 +84,14 @@ handle_command_line_options() { cross="yes" ;; "-h"|"--help") - echo "gtk-bundle-from-msys2.sh [-c] [-h] [-n] [-z] [-3] [CACHEDIR]" + echo "gtk-bundle-from-msys2.sh [-c] [-h] [-n] [-z] [-3 | -4] [CACHEDIR]" echo " -c Use pacman cache. Otherwise pacman will download" echo " archive files" echo " -h Show this help screen" echo " -n Do not run post install scripts of the packages" echo " -z Create a zip afterwards" echo " -3 Prefer gtk3" + echo " -4 Prefer gtk4" echo " -x Set when the script is executed in a cross-compilation context (e.g. to use wine)" echo "CACHEDIR Directory where to look for cached packages (default: /var/cache/pacman/pkg)" exit 1 From 4af8f8ac0bdb8df67dfaa69e3d1ba33d7a8f0bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Tue, 31 Aug 2021 00:12:37 +0200 Subject: [PATCH 4/8] Windows: Ignore package signatures on bundle creation --- scripts/gtk-bundle-from-msys2.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/gtk-bundle-from-msys2.sh b/scripts/gtk-bundle-from-msys2.sh index fe81e2cdcc..907c14633c 100644 --- a/scripts/gtk-bundle-from-msys2.sh +++ b/scripts/gtk-bundle-from-msys2.sh @@ -104,6 +104,8 @@ handle_command_line_options() { } set -e # stop on errors +# enable extended globbing as we need it in _getpkg +shopt -s extglob initialize() { if [ -z "$cachedir" ]; then @@ -135,7 +137,8 @@ _getpkg() { if [ "$use_cache" = "yes" ]; then package_info=$(pacman -Qi mingw-w64-$ABI-$1) package_version=$(echo "$package_info" | grep "^Version " | cut -d':' -f 2 | tr -d '[[:space:]]') - ls $cachedir/mingw-w64-${ABI}-${1}-${package_version}-* | sort -V | tail -n 1 + # use @(gz|xz|zst) to filter out signature files (e.g. mingw-w64-x86_64-...-any.pkg.tar.zst.sig) + ls $cachedir/mingw-w64-${ABI}-${1}-${package_version}-*.tar.@(gz|xz|zst) | sort -V | tail -n 1 else # -dd to ignore dependencies as we listed them already above in $packages pacman -Sddp mingw-w64-${ABI}-${1} From 398811444231eefdfd8ce20af3e9a165c2992ff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Tue, 31 Aug 2021 00:17:25 +0200 Subject: [PATCH 5/8] Windows: Ignore Pacman cache on bundle creation Also use long command line arguments for curl to fix a typo in -L. --- scripts/gtk-bundle-from-msys2.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/gtk-bundle-from-msys2.sh b/scripts/gtk-bundle-from-msys2.sh index 907c14633c..ded468d1f0 100644 --- a/scripts/gtk-bundle-from-msys2.sh +++ b/scripts/gtk-bundle-from-msys2.sh @@ -140,8 +140,9 @@ _getpkg() { # use @(gz|xz|zst) to filter out signature files (e.g. mingw-w64-x86_64-...-any.pkg.tar.zst.sig) ls $cachedir/mingw-w64-${ABI}-${1}-${package_version}-*.tar.@(gz|xz|zst) | sort -V | tail -n 1 else - # -dd to ignore dependencies as we listed them already above in $packages - pacman -Sddp mingw-w64-${ABI}-${1} + # -dd to ignore dependencies as we listed them already above in $packages and + # make pacman ignore its possibly existing cache (otherwise we would get an URL to the cache) + pacman -Sddp --cachedir /nonexistent mingw-w64-${ABI}-${1} fi } @@ -169,7 +170,7 @@ extract_packages() { else echo "Download $pkg using curl" filename=$(basename "$pkg") - curl -s -o "$filename" -l "$pkg" + curl --silent --location --output "$filename" "$pkg" tar xf "$filename" rm "$filename" fi From cfa51b8948dbd924c59518c9afebeb904509745b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Tue, 31 Aug 2021 00:19:12 +0200 Subject: [PATCH 6/8] Windows: Compile and include GSettings schemas on bundle creation Without these schemas, Geany crashes when the file open dialog is shown. --- scripts/gtk-bundle-from-msys2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gtk-bundle-from-msys2.sh b/scripts/gtk-bundle-from-msys2.sh index ded468d1f0..cd30fa17ac 100644 --- a/scripts/gtk-bundle-from-msys2.sh +++ b/scripts/gtk-bundle-from-msys2.sh @@ -204,6 +204,7 @@ delayed_post_install() { ${EXE_WRAPPER_64} bin/gdk-pixbuf-query-loaders.exe --update-cache ${EXE_WRAPPER_64} bin/gtk-update-icon-cache-3.0.exe -q -t -f share/icons/hicolor ${EXE_WRAPPER_64} bin/gtk-update-icon-cache-3.0.exe -q -t -f share/icons/Adwaita + ${EXE_WRAPPER_64} bin/glib-compile-schemas share/glib-2.0/schemas/ fi } @@ -236,7 +237,6 @@ cleanup_unnecessary_files() { rm -rf share/glib-2.0/codegen rm -rf share/glib-2.0/gdb rm -rf share/glib-2.0/gettext - rm -rf share/glib-2.0/schemas rm -rf share/graphite2 rm -rf share/gtk-3.0 rm -rf share/gtk-doc From d4982871a628463142caf143589797be5d273a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Wed, 1 Sep 2021 23:28:27 +0200 Subject: [PATCH 7/8] Windows: Update indirect dependencies for bundle creation --- scripts/gtk-bundle-from-msys2.sh | 44 ++++++++++++++------------------ 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/scripts/gtk-bundle-from-msys2.sh b/scripts/gtk-bundle-from-msys2.sh index cd30fa17ac..a6767fc8ea 100644 --- a/scripts/gtk-bundle-from-msys2.sh +++ b/scripts/gtk-bundle-from-msys2.sh @@ -25,41 +25,35 @@ gtk3_dependency_pkgs="" gtk4_dependency_pkgs="" packages=" -gcc-libs -grep -pcre -xz -zlib -zstd -expat -libffi -libiconv +adwaita-icon-theme +atk brotli bzip2 -freeglut -libffi -libpng +cairo +expat +fontconfig +freetype +fribidi +gcc-libs +gdk-pixbuf2 gettext glib2 graphite2 -jasper -libepoxy -libjpeg-turbo -libtiff -libwinpthread-git +grep +gtk-update-icon-cache harfbuzz -fontconfig -freetype -atk -fribidi +hicolor-icon-theme libdatrie +libepoxy +libffi +libiconv +libpng libthai +libwinpthread-git pango -cairo +pcre pixman -gdk-pixbuf2 -hicolor-icon-theme -adwaita-icon-theme +zlib " handle_command_line_options() { From 1b8c828a51a0c5ad735635fb2402514a48cdff78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Mon, 6 Sep 2021 23:33:17 +0200 Subject: [PATCH 8/8] Windows: Install development files by default with "Full" install target This helps with automated CI installations and should be OK for ordinary users. --- geany.nsi.in | 1 + 1 file changed, 1 insertion(+) diff --git a/geany.nsi.in b/geany.nsi.in index 9a9e1e66f2..95b7a038bd 100644 --- a/geany.nsi.in +++ b/geany.nsi.in @@ -256,6 +256,7 @@ SectionEnd ; Development files Section "Development files" SEC09 + SectionIn 1 SetOverwrite ifnewer SetOutPath "$INSTDIR\include" File /r "${GEANY_RELEASE_DIR}\include\*"