diff --git a/make-msys2-installer b/make-msys2-installer index 8cf08cd..d734502 100644 --- a/make-msys2-installer +++ b/make-msys2-installer @@ -11,11 +11,16 @@ _filename=msys2-${_arch}-${_date}.exe _filename2=msys2-base-${_arch}-${_date}.tar.xz _filename3=msys2-base-${_arch}-${_date}.sfx.exe _log=/tmp/installer-${_arch}-${_date}.log -_archivegen=/mingw64/bin/archivegen.exe -_binarycreator=/mingw64/bin/binarycreator.exe -_installerbase=/mingw64/bin/installerbase.exe +if [ "${_arch}" = "x86_64" ]; then + _bitness=64 +else + _bitness=32 +fi +_archivegen=/mingw${_bitness}/bin/archivegen.exe +_binarycreator=/mingw${_bitness}/bin/binarycreator.exe +_installerbase=/mingw${_bitness}/bin/installerbase.exe _newmsysbase=/tmp/newmsys -_newmsys=${_newmsysbase}/msys64 +_newmsys=${_newmsysbase}/msys"${_bitness}" declare -a undo_commands @@ -38,12 +43,16 @@ exit_cleanly() { do_seds() { find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" \) -exec sed -i "s|@DATE@|${_dateqif}|g" "{}" \; find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" \) -exec sed -i "s|@VERSION@|${_version}|g" "{}" \; + find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" -or -name "installscript.js" \) -exec sed -i "s|@BITNESS@|${_bitness}|g" "{}" \; undo_commands+=("undo_seds") } undo_seds() { find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" \) -exec sed -i "s|${_dateqif}<|@DATE@<|g" "{}" \; find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" \) -exec sed -i "s|${_version}<|@VERSION@<|g" "{}" \; + find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" -or -name "installscript.js" \) -exec sed -i "s|msys${_bitness}|msys@BITNESS@|g" "{}" \; + find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" -or -name "installscript.js" \) -exec sed -i "s|${_bitness}bit|@BITNESS@bit|g" "{}" \; + find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" -or -name "installscript.js" \) -exec sed -i "s|if (\"@BITNESS@bit\" === \"@BITNESS@bit\")|if (\"@BITNESS@bit\" === \"32bit\")|g" "{}" \; } create_archives() { @@ -52,13 +61,13 @@ create_archives() { mkdir -p "${_data}" local _dirs="${_newmsys}/"* - local _compress_cmd="${_archivegen} --compression 9 ${_data}/msys64.7z ${_dirs}" + local _compress_cmd="${_archivegen} --compression 9 ${_data}/msys${_bitness}.7z ${_dirs}" pushd / > /dev/null echo "Run: ${_compress_cmd} ..." | tee -a ${_log} eval "${_compress_cmd}" 2>&1 | tee -a ${_log} _result=$? if [ "${_result}" -eq "0" ]; then - echo " archivegen succeeded. Created ${_data}/msys64.7z" | tee -a ${_log} + echo " archivegen succeeded. Created ${_data}/msys${_bitness}.7z" | tee -a ${_log} else exit_cleanly "3" "archivegen failed. See ${_log}" fi @@ -66,7 +75,7 @@ create_archives() { pushd ${_newmsysbase} > /dev/null export XZ_OPT="-e9T0" - local _compress_cmd2="/usr/bin/tar --transform='s/:/_/g' --dereference --hard-dereference -cJf ${_thisdir}/${_filename2} msys64" + local _compress_cmd2="/usr/bin/tar --transform='s/:/_/g' --dereference --hard-dereference -cJf ${_thisdir}/${_filename2} msys${_bitness}" echo "Run: ${_compress_cmd2} ..." | tee -a ${_log} eval "${_compress_cmd2}" 2>&1 | tee -a ${_log} _result=$? @@ -77,7 +86,7 @@ create_archives() { fi # self extracting cli 7z archive - "${_thisdir}/create-sfx.sh" "msys64" "${_thisdir}/${_filename3}" + "${_thisdir}/create-sfx.sh" "msys${_bitness}" "${_thisdir}/${_filename3}" popd > /dev/null } @@ -115,7 +124,7 @@ create_chroot_system() { } if [ ! -f "${_archivegen}" ]; then - eval "pacman -S --noconfirm mingw64/mingw-w64-${_arch}-qt-installer-framework" | tee -a ${_log} + eval "pacman -S --noconfirm mingw${_bitness}/mingw-w64-${_arch}-qt-installer-framework" | tee -a ${_log} fi if [ ! -f "${_archivegen}" ]; then diff --git a/qt-ifw/config/config.xml b/qt-ifw/config/config.xml index 9545587..d9b26ea 100644 --- a/qt-ifw/config/config.xml +++ b/qt-ifw/config/config.xml @@ -1,11 +1,11 @@ - MSYS2 + MSYS2 @BITNESS@bit @VERSION@ - MSYS2 + MSYS2 @BITNESS@bit The MSYS2 Developers control.js - MSYS2 + MSYS2 @BITNESS@bit @TargetDir@/mingw64.exe ../../msys2 diff --git a/qt-ifw/packages/com.msys2.root.base/meta/installscript.js b/qt-ifw/packages/com.msys2.root.base/meta/installscript.js index eb5d95c..f1fa66a 100644 --- a/qt-ifw/packages/com.msys2.root.base/meta/installscript.js +++ b/qt-ifw/packages/com.msys2.root.base/meta/installscript.js @@ -23,6 +23,11 @@ function createShortcuts() component.addOperation("CreateShortcut", "@TargetDir@/clang64.exe", "@StartMenuDir@/MSYS2 CLANG64.lnk", "iconPath=@TargetDir@/clang64.exe"); component.addOperation("CreateShortcut", "@TargetDir@/msys2.exe", "@StartMenuDir@/MSYS2 MSYS.lnk", "iconPath=@TargetDir@/msys2.exe"); + if ("@BITNESS@bit" === "32bit") { + component.addOperation( "Execute", + ["@TargetDir@\\autorebase.bat"]); + } + component.addOperation( "Execute", ["@TargetDir@\\usr\\bin\\bash.exe", "--login", "-c", "exit"]); } diff --git a/qt-ifw/packages/com.msys2.root.base/meta/package.xml b/qt-ifw/packages/com.msys2.root.base/meta/package.xml index df50dc5..4295da8 100644 --- a/qt-ifw/packages/com.msys2.root.base/meta/package.xml +++ b/qt-ifw/packages/com.msys2.root.base/meta/package.xml @@ -1,6 +1,6 @@ - MSYS2 base + MSYS2 @BITNESS@bit base Cygwin-derived Posix-like env. for Windows with Arch Linux's Pacman @VERSION@ @DATE@ diff --git a/qt-ifw/packages/com.msys2.root/meta/installscript.js b/qt-ifw/packages/com.msys2.root/meta/installscript.js index 14265fe..8e04293 100644 --- a/qt-ifw/packages/com.msys2.root/meta/installscript.js +++ b/qt-ifw/packages/com.msys2.root/meta/installscript.js @@ -4,7 +4,7 @@ function Component() { if (systemDrive === "") { systemDrive = "C:"; } - var targetDir = installer.value("TargetDir", systemDrive+"\\msys64") + var targetDir = installer.value("TargetDir", systemDrive+"\\msys@BITNESS@") installer.setValue("TargetDir", targetDir); installer.setDefaultPageVisible(QInstaller.Introduction, false); diff --git a/qt-ifw/packages/com.msys2.root/meta/package.xml b/qt-ifw/packages/com.msys2.root/meta/package.xml index ee0e335..942691f 100644 --- a/qt-ifw/packages/com.msys2.root/meta/package.xml +++ b/qt-ifw/packages/com.msys2.root/meta/package.xml @@ -1,6 +1,6 @@ - MSYS2 + MSYS2 @BITNESS@bit Cygwin-derived Posix-like env. for Windows with Arch Linux's Pacman @VERSION@ @DATE@