Skip to content

Commit

Permalink
Revert "Remove 32bit support and any mention of 64bit"
Browse files Browse the repository at this point in the history
The point of this fork is to build 32-bit installers, so I don't want
this change.

This reverts commit 19b98a2.
  • Loading branch information
jeremyd2019 committed Sep 3, 2022
1 parent aad16ad commit 3cc3aed
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 15 deletions.
27 changes: 18 additions & 9 deletions make-msys2-installer
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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|<ReleaseDate>${_dateqif}<|<ReleaseDate>@DATE@<|g" "{}" \;
find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" \) -exec sed -i "s|<Version>${_version}<|<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() {
Expand All @@ -52,21 +61,21 @@ 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
popd > /dev/null

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=$?
Expand All @@ -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
}

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions qt-ifw/config/config.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>MSYS2</Name>
<Name>MSYS2 @BITNESS@bit</Name>
<Version>@VERSION@</Version>
<Title>MSYS2</Title>
<Title>MSYS2 @BITNESS@bit</Title>
<Publisher>The MSYS2 Developers</Publisher>
<ControlScript>control.js</ControlScript>
<StartMenuDir>MSYS2</StartMenuDir>
<StartMenuDir>MSYS2 @BITNESS@bit</StartMenuDir>
<RunProgram>@TargetDir@/mingw64.exe</RunProgram>
<RunProgramArguments></RunProgramArguments>
<InstallerApplicationIcon>../../msys2</InstallerApplicationIcon>
Expand Down
5 changes: 5 additions & 0 deletions qt-ifw/packages/com.msys2.root.base/meta/installscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"]);
}
Expand Down
2 changes: 1 addition & 1 deletion qt-ifw/packages/com.msys2.root.base/meta/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<Package>
<DisplayName>MSYS2 base</DisplayName>
<DisplayName>MSYS2 @BITNESS@bit base</DisplayName>
<Description>Cygwin-derived Posix-like env. for Windows with Arch Linux's Pacman</Description>
<Version>@VERSION@</Version>
<ReleaseDate>@DATE@</ReleaseDate>
Expand Down
2 changes: 1 addition & 1 deletion qt-ifw/packages/com.msys2.root/meta/installscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion qt-ifw/packages/com.msys2.root/meta/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<Package>
<DisplayName>MSYS2</DisplayName>
<DisplayName>MSYS2 @BITNESS@bit</DisplayName>
<Description>Cygwin-derived Posix-like env. for Windows with Arch Linux's Pacman</Description>
<Version>@VERSION@</Version>
<ReleaseDate>@DATE@</ReleaseDate>
Expand Down

0 comments on commit 3cc3aed

Please sign in to comment.