mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-28 05:24:44 +00:00
Merge branch 'stable' into stable-android
This commit is contained in:
@@ -89,8 +89,7 @@ sudo rm -rf /opt/hostedtoolcache/PyPy || :
|
||||
# 376MB
|
||||
sudo rm -rf /opt/hostedtoolcache/node || :
|
||||
# Remove Web browser packages
|
||||
sudo apt purge -y \
|
||||
firefox \
|
||||
google-chrome-stable \
|
||||
microsoft-edge-stable
|
||||
for pkg in firefox google-chrome-stable microsoft-edge-stable; do
|
||||
sudo apt purge -y "$pkg" || echo "Failed or not installed: $pkg"
|
||||
done
|
||||
df -h
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
set -e
|
||||
|
||||
|
||||
ARCH="$(uname -m)"
|
||||
|
||||
function readlink() {
|
||||
echo "$(cd "$(dirname "$1")"; pwd -P)"
|
||||
}
|
||||
@@ -36,14 +39,28 @@ sed -i 's|Icon=.*|Icon=simplex|g' *imple*.desktop
|
||||
cp *imple*.desktop usr/share/applications/
|
||||
cp $multiplatform_dir/desktop/src/jvmMain/resources/distribute/*.appdata.xml usr/share/metainfo
|
||||
|
||||
if [ ! -f ../appimagetool-x86_64.AppImage ]; then
|
||||
wget --secure-protocol=TLSv1_3 https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O ../appimagetool-x86_64.AppImage
|
||||
chmod +x ../appimagetool-x86_64.AppImage
|
||||
if [ ! -f ../appimagetool-${ARCH}.AppImage ]; then
|
||||
wget --secure-protocol=TLSv1_3 https://github.com/simplex-chat/appimagetool/releases/download/continuous/appimagetool-${ARCH}.AppImage -O ../appimagetool-${ARCH}.AppImage
|
||||
chmod +x ../appimagetool-${ARCH}.AppImage
|
||||
fi
|
||||
if [ ! -f ../runtime-x86_64 ]; then
|
||||
wget --secure-protocol=TLSv1_3 https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-x86_64 -O ../runtime-x86_64
|
||||
chmod +x ../runtime-x86_64
|
||||
if [ ! -f ../runtime-${ARCH} ]; then
|
||||
wget --secure-protocol=TLSv1_3 https://github.com/simplex-chat/type2-runtime/releases/download/continuous/runtime-${ARCH} -O ../runtime-${ARCH}
|
||||
chmod +x ../runtime-${ARCH}
|
||||
fi
|
||||
../appimagetool-x86_64.AppImage --runtime-file ../runtime-x86_64 .
|
||||
|
||||
# Determenistic build
|
||||
|
||||
export SOURCE_DATE_EPOCH=1704067200
|
||||
|
||||
# Delete redundant jar file and modify cfg
|
||||
rm -f ./usr/lib/app/*skiko-awt-runtime-linux*
|
||||
sed -i -e '/skiko-awt-runtime-linux/d' ./usr/lib/app/simplex.cfg
|
||||
|
||||
# Set all files to fixed time
|
||||
find . -exec touch -d "@$SOURCE_DATE_EPOCH" {} +
|
||||
|
||||
../appimagetool-${ARCH}.AppImage --verbose --no-appstream --runtime-file ../runtime-${ARCH} .
|
||||
mv *imple*.AppImage ../../
|
||||
|
||||
# Just a safeguard
|
||||
strip-nondeterminism ../../*imple*.AppImage
|
||||
|
||||
Executable
+46
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
ARCH="$(uname -m)"
|
||||
|
||||
scripts/desktop/build-lib-linux.sh
|
||||
cd apps/multiplatform
|
||||
./gradlew packageDeb
|
||||
|
||||
# Workaround for skiko library
|
||||
#
|
||||
# Compose Multiplatform depends on skiko library, that
|
||||
# handles all of the window managment and graphics drawing.
|
||||
#
|
||||
# This skiko library comes with two jar's:
|
||||
# - platform-agnostic "skiko-awt"
|
||||
# - and platform-specific "skiko-awt-runtime"
|
||||
#
|
||||
# In case of Linux, second jar is called "skiko-awt-runtime-linux-x64".
|
||||
# Essentially, this jar has the Linux .so library called "libskiko-linux-x64.so"
|
||||
# that is being unpacked to runtime libs.
|
||||
#
|
||||
# Since the jar is nothing more than a zip archive, extracting library
|
||||
# from "skiko-awt-runtime-linux-x64" modifies it's timestamps
|
||||
# with current time, which in changes it's hash, which in turn
|
||||
# makes the whole build unreproducible.
|
||||
#
|
||||
# It seems to be there is no way to handle this extraction in our code and
|
||||
# https://docs.gradle.org/current/userguide/working_with_files.html#sec:reproducible_archives
|
||||
# unfortunately doesn't solve the issue.
|
||||
#
|
||||
# Instead, just modify the deb, removing the redundant skiko library.
|
||||
#
|
||||
# Also, it seems this is related to:
|
||||
# https://youtrack.jetbrains.com/issue/CMP-1971/createDistributable-produces-duplicated-skiko-awt.jar-and-skiko-awt-runtime-windows-x64.jar
|
||||
|
||||
export SOURCE_DATE_EPOCH=1704067200
|
||||
|
||||
dpkg-deb -R ./release/main/deb/simplex*.deb ./extracted
|
||||
|
||||
rm -f ./extracted/opt/*imple*/lib/app/*skiko-awt-runtime-linux*
|
||||
sed -i -e '/skiko-awt-runtime-linux/d' ./extracted/opt/*imple*/lib/app/simplex.cfg
|
||||
find ./extracted/ -exec touch -d "@$SOURCE_DATE_EPOCH" {} +
|
||||
|
||||
dpkg-deb --build --root-owner-group --uniform-compression ./extracted ./release/main/deb/simplex_${ARCH}.deb
|
||||
|
||||
strip-nondeterminism ./release/main/deb/simplex_${ARCH}.deb
|
||||
@@ -2,19 +2,23 @@
|
||||
|
||||
set -e
|
||||
|
||||
ARCH="$(uname -m)"
|
||||
|
||||
function readlink() {
|
||||
echo "$(cd "$(dirname "$1")"; pwd -P)"
|
||||
}
|
||||
root_dir="$(dirname "$(dirname "$(readlink "$0")")")"
|
||||
vlc_dir=$root_dir/apps/multiplatform/common/src/commonMain/cpp/desktop/libs/linux-x86_64/vlc
|
||||
vlc_dir=$root_dir/apps/multiplatform/common/src/commonMain/cpp/desktop/libs/linux-${ARCH}/vlc
|
||||
|
||||
mkdir $vlc_dir || exit 0
|
||||
|
||||
vlc_tag='v3.0.21-1'
|
||||
vlc_url="https://github.com/simplex-chat/vlc/releases/download/${vlc_tag}/vlc-linux-${ARCH}.appimage"
|
||||
|
||||
cd /tmp
|
||||
mkdir tmp 2>/dev/null || true
|
||||
cd tmp
|
||||
curl --tlsv1.2 https://github.com/cmatomic/VLCplayer-AppImage/releases/download/3.0.11.1/VLC_media_player-3.0.11.1-x86_64.AppImage -L -o appimage
|
||||
curl --tlsv1.2 "${vlc_url}" -L -o appimage
|
||||
chmod +x appimage
|
||||
./appimage --appimage-extract
|
||||
cp -r squashfs-root/usr/lib/* $vlc_dir
|
||||
|
||||
@@ -9,7 +9,9 @@ if [ "$ARCH" == "arm64" ]; then
|
||||
else
|
||||
vlc_arch=intel64
|
||||
fi
|
||||
vlc_version=3.0.19
|
||||
|
||||
vlc_tag='v3.0.21-1'
|
||||
vlc_url="https://github.com/simplex-chat/vlc/releases/download/${vlc_tag}/vlc-macos-${ARCH}.zip"
|
||||
|
||||
function readlink() {
|
||||
echo "$(cd "$(dirname "$1")"; pwd -P)"
|
||||
@@ -23,7 +25,7 @@ mkdir -p $vlc_dir/vlc || exit 0
|
||||
cd /tmp
|
||||
mkdir tmp 2>/dev/null || true
|
||||
cd tmp
|
||||
curl --tlsv1.2 https://github.com/simplex-chat/vlc/releases/download/v$vlc_version/vlc-macos-$ARCH.zip -L -o vlc
|
||||
curl --tlsv1.2 "${vlc_url}" -L -o vlc
|
||||
unzip -oqq vlc
|
||||
install_name_tool -add_rpath "@loader_path/VLC.app/Contents/MacOS/lib" vlc-cache-gen
|
||||
cd VLC.app/Contents/MacOS/lib
|
||||
|
||||
@@ -10,10 +10,13 @@ vlc_dir=$root_dir/apps/multiplatform/common/src/commonMain/cpp/desktop/libs/wind
|
||||
rm -rf $vlc_dir
|
||||
mkdir -p $vlc_dir/vlc || exit 0
|
||||
|
||||
vlc_tag='v3.0.21-1'
|
||||
vlc_url="https://github.com/simplex-chat/vlc/releases/download/${vlc_tag}/vlc-win-x86_64.zip"
|
||||
|
||||
cd /tmp
|
||||
mkdir tmp 2>/dev/null || true
|
||||
cd tmp
|
||||
curl --tlsv1.2 https://irltoolkit.mm.fcix.net/videolan-ftp/vlc/3.0.18/win64/vlc-3.0.18-win64.zip -L -o vlc
|
||||
curl --tlsv1.2 "${vlc_url}" -L -o vlc
|
||||
$WINDIR\\System32\\tar.exe -xf vlc
|
||||
cd vlc-*
|
||||
# Setting the same date as the date that will be on the file after extraction from JAR to make VLC cache checker happy
|
||||
|
||||
@@ -38,6 +38,187 @@
|
||||
</description>
|
||||
|
||||
<releases>
|
||||
<release version="6.4.5" date="2025-09-08">
|
||||
<url type="details">https://simplex.chat/blog/20250729-simplex-chat-v6-4-1-welcome-contacts-protect-groups-app-security.html</url>
|
||||
<description>
|
||||
<p>New in v6.4.5:</p>
|
||||
<ul>
|
||||
<li>fixes for chats with admins.</li>
|
||||
<li>better information about network errors.</li>
|
||||
</ul>
|
||||
<p>New in v6.4-6.4.4:</p>
|
||||
<ul>
|
||||
<li>new UX to connect.</li>
|
||||
<li>review new group members.</li>
|
||||
<li>chat with group admins.</li>
|
||||
<li>new UI languages: Catalan, Indonesian, Romanian and Vietnamese.</li>
|
||||
<li>Linux app builds for aarch64 CPUs</li>
|
||||
<li>UI support for bot commands.</li>
|
||||
<li>support markdown hyperlinks, such as [click here](https://example.com).</li>
|
||||
<li>option to remove tracking parameters from the links.</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="6.4.4" date="2025-08-28">
|
||||
<url type="details">https://simplex.chat/blog/20250729-simplex-chat-v6-4-1-welcome-contacts-protect-groups-app-security.html</url>
|
||||
<description>
|
||||
<p>New in v6.4.4:</p>
|
||||
<ul>
|
||||
<li>reduced battery usage.</li>
|
||||
<li>fixes.</li>
|
||||
</ul>
|
||||
<p>New in v6.4-6.4.3.1:</p>
|
||||
<ul>
|
||||
<li>new UX to connect.</li>
|
||||
<li>review new group members.</li>
|
||||
<li>chat with group admins.</li>
|
||||
<li>new UI languages: Catalan, Indonesian, Romanian and Vietnamese.</li>
|
||||
<li>Linux app builds for aarch64 CPUs</li>
|
||||
<li>UI support for bot commands.</li>
|
||||
<li>support markdown hyperlinks, such as [click here](https://example.com).</li>
|
||||
<li>option to remove tracking parameters from the links.</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="6.4.3.1" date="2025-08-10">
|
||||
<url type="details">https://simplex.chat/blog/20250729-simplex-chat-v6-4-1-welcome-contacts-protect-groups-app-security.html</url>
|
||||
<description>
|
||||
<p>New in v6.4.3.1:</p>
|
||||
<ul>
|
||||
<li>UI support for bot commands.</li>
|
||||
<li>support markdown hyperlinks, such as [click here](https://example.com).</li>
|
||||
<li>option to remove tracking parameters from the links.</li>
|
||||
</ul>
|
||||
<p>New in v6.4-6.4.2:</p>
|
||||
<ul>
|
||||
<li>new UX to connect.</li>
|
||||
<li>review new group members.</li>
|
||||
<li>chat with group admins.</li>
|
||||
<li>new UI languages: Catalan, Indonesian, Romanian and Vietnamese.</li>
|
||||
<li>Linux app builds for aarch64 CPUs</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="6.4.2" date="2025-08-02">
|
||||
<url type="details">https://simplex.chat/blog/20250729-simplex-chat-v6-4-1-welcome-contacts-protect-groups-app-security.html</url>
|
||||
<description>
|
||||
<p>New in v6.4.2:</p>
|
||||
<ul>
|
||||
<li>manually accept member contact requests, with option to auto-accept.</li>
|
||||
<li>ignore contact requests from blocked group members.</li>
|
||||
<li>markdown (links etc.) in profile bio/group purpose.</li>
|
||||
<li>Linux app builds for aarch64 CPUs</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="6.4.1" date="2025-07-29">
|
||||
<url type="details">https://simplex.chat/blog/20250729-simplex-chat-v6-4-1-welcome-contacts-protect-groups-app-security.html</url>
|
||||
<description>
|
||||
<p>New in v6.4.1:</p>
|
||||
<ul>
|
||||
<li>welcome your contacts: set profile bio and welcome message.</li>
|
||||
<li>enable disappearing messages by default for new contacts.</li>
|
||||
<li>short SimpleX addresses and group links now include profile images and welcome messages.</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="6.4.0" date="2025-07-16">
|
||||
<url type="details">https://simplex.chat/blog/20250703-simplex-network-protocol-extension-for-securely-connecting-people.html</url>
|
||||
<description>
|
||||
<p>New in v6.4.0:</p>
|
||||
<ul>
|
||||
<li>Connect faster: message instantly once you tap Connect.</li>
|
||||
<li>Review group members: chat with new members before they join.</li>
|
||||
<li>Chat with admins: send your private feedback to group owners.</li>
|
||||
<li>New group role: Moderator - can remove messages and block members.</li>
|
||||
<li>Improved message delivery - less traffic on mobile networks.</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="6.3.7" date="2025-07-01">
|
||||
<url type="details">https://simplex.chat/blog/20250308-simplex-chat-v6-3-new-user-experience-safety-in-public-groups.html</url>
|
||||
<description>
|
||||
<p>New in v6.3.1-7:</p>
|
||||
<ul>
|
||||
<li>fix changing the user profile of the invitation link.</li>
|
||||
<li>forward compatibility with short link data.</li>
|
||||
<li>fixes</li>
|
||||
<li>fixes mentions with trailing punctuation (e.g., hello @name!).</li>
|
||||
<li>recognizes domain names as links (e.g., simplex.chat).</li>
|
||||
<li>forward compatibility with "knocking" (a feature for group admins to review and to chat with the new members prior to admitting them to groups, it will be released in 6.4)</li>
|
||||
<li>support for connecting via short connection links.</li>
|
||||
<li>fix related to backward/forward compatibility of the app in some rare cases.</li>
|
||||
<li>scrolling/navigation improvements.</li>
|
||||
<li>faster onboarding (conditions and operators are combined to one screen).</li>
|
||||
</ul>
|
||||
<p>New in v6.3.0:</p>
|
||||
<ul>
|
||||
<li>Mention members and get notified when mentioned.</li>
|
||||
<li>Send private reports to moderators.</li>
|
||||
<li>Delete, block and change role for multiple members at once</li>
|
||||
<li>Faster sending messages and faster deletion.</li>
|
||||
<li>Organize chats into lists to keep track of what's important.</li>
|
||||
<li>Jump to found and forwarded messages.</li>
|
||||
<li>Private media file names.</li>
|
||||
<li>Message expiration in chats.</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="6.3.6" date="2025-06-14">
|
||||
<url type="details">https://simplex.chat/blog/20250308-simplex-chat-v6-3-new-user-experience-safety-in-public-groups.html</url>
|
||||
<description>
|
||||
<p>New in v6.3.1-6:</p>
|
||||
<ul>
|
||||
<li>forward compatibility with short link data.</li>
|
||||
<li>fixes</li>
|
||||
<li>fixes mentions with trailing punctuation (e.g., hello @name!).</li>
|
||||
<li>recognizes domain names as links (e.g., simplex.chat).</li>
|
||||
<li>forward compatibility with "knocking" (a feature for group admins to review and to chat with the new members prior to admitting them to groups, it will be released in 6.4)</li>
|
||||
<li>support for connecting via short connection links.</li>
|
||||
<li>fix related to backward/forward compatibility of the app in some rare cases.</li>
|
||||
<li>scrolling/navigation improvements.</li>
|
||||
<li>faster onboarding (conditions and operators are combined to one screen).</li>
|
||||
</ul>
|
||||
<p>New in v6.3.0:</p>
|
||||
<ul>
|
||||
<li>Mention members and get notified when mentioned.</li>
|
||||
<li>Send private reports to moderators.</li>
|
||||
<li>Delete, block and change role for multiple members at once</li>
|
||||
<li>Faster sending messages and faster deletion.</li>
|
||||
<li>Organize chats into lists to keep track of what's important.</li>
|
||||
<li>Jump to found and forwarded messages.</li>
|
||||
<li>Private media file names.</li>
|
||||
<li>Message expiration in chats.</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="6.3.5" date="2025-06-09">
|
||||
<url type="details">https://simplex.chat/blog/20250308-simplex-chat-v6-3-new-user-experience-safety-in-public-groups.html</url>
|
||||
<description>
|
||||
<p>New in v6.3.1-5:</p>
|
||||
<ul>
|
||||
<li>fixes</li>
|
||||
<li>fixes mentions with trailing punctuation (e.g., hello @name!).</li>
|
||||
<li>recognizes domain names as links (e.g., simplex.chat).</li>
|
||||
<li>forward compatibility with "knocking" (a feature for group admins to review and to chat with the new members prior to admitting them to groups, it will be released in 6.4)</li>
|
||||
<li>support for connecting via short connection links.</li>
|
||||
<li>fix related to backward/forward compatibility of the app in some rare cases.</li>
|
||||
<li>scrolling/navigation improvements.</li>
|
||||
<li>faster onboarding (conditions and operators are combined to one screen).</li>
|
||||
</ul>
|
||||
<p>New in v6.3.0:</p>
|
||||
<ul>
|
||||
<li>Mention members and get notified when mentioned.</li>
|
||||
<li>Send private reports to moderators.</li>
|
||||
<li>Delete, block and change role for multiple members at once</li>
|
||||
<li>Faster sending messages and faster deletion.</li>
|
||||
<li>Organize chats into lists to keep track of what's important.</li>
|
||||
<li>Jump to found and forwarded messages.</li>
|
||||
<li>Private media file names.</li>
|
||||
<li>Message expiration in chats.</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="6.3.4" date="2025-05-12">
|
||||
<url type="details">https://simplex.chat/blog/20250308-simplex-chat-v6-3-new-user-experience-safety-in-public-groups.html</url>
|
||||
<description>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"https://github.com/simplex-chat/simplexmq.git"."3d62a383d5dcae6529d6d866233857182bcb4d47" = "133xm8jkim7agd6drwm3lbx1z7v8nf4l3asrm46ag3n2q201yfxc";
|
||||
"https://github.com/simplex-chat/simplexmq.git"."538dcb6a4c53e115655dc07266c4ff386d45511d" = "01g6dicws9cdgk4slmlqyvl3i84nw3gyqwmqwr2rwbq0yx7fcmmq";
|
||||
"https://github.com/simplex-chat/hs-socks.git"."a30cc7a79a08d8108316094f8f2f82a0c5e1ac51" = "0yasvnr7g91k76mjkamvzab2kvlb1g5pspjyjn2fr6v83swjhj38";
|
||||
"https://github.com/simplex-chat/direct-sqlcipher.git"."f814ee68b16a9447fbb467ccc8f29bdd3546bfd9" = "1ql13f4kfwkbaq7nygkxgw84213i0zm7c1a8hwvramayxl38dq5d";
|
||||
"https://github.com/simplex-chat/sqlcipher-simple.git"."a46bd361a19376c5211f1058908fc0ae6bf42446" = "1z0r78d8f0812kxbgsm735qf6xx8lvaz27k1a0b4a2m0sshpd5gl";
|
||||
|
||||
@@ -6,9 +6,14 @@ TAG="$1"
|
||||
tempdir="$(mktemp -d)"
|
||||
init_dir="$PWD"
|
||||
|
||||
ghc='9.6.3'
|
||||
|
||||
repo_name="simplex-chat"
|
||||
repo="https://github.com/simplex-chat/${repo_name}"
|
||||
|
||||
image_name='sx-local'
|
||||
container_name='sx-builder'
|
||||
|
||||
cabal_local='ignore-project: False
|
||||
package direct-sqlcipher
|
||||
flags: +openssl'
|
||||
@@ -16,105 +21,151 @@ package direct-sqlcipher
|
||||
export DOCKER_BUILDKIT=1
|
||||
|
||||
cleanup() {
|
||||
docker exec -t builder sh -c 'rm -rf ./dist-newstyle' 2>/dev/null || :
|
||||
rm -rf -- "$tempdir"
|
||||
docker rm --force builder 2>/dev/null || :
|
||||
docker image rm local 2>/dev/null || :
|
||||
cd "$init_dir"
|
||||
docker exec -t "${container_name}" sh -c 'rm -rf ./dist-newstyle ./apps' 2>/dev/null || :
|
||||
rm -rf -- "${tempdir}"
|
||||
docker rm --force "${container_name}" 2>/dev/null || :
|
||||
docker image rm "${image_name}" 2>/dev/null || :
|
||||
cd "${init_dir}"
|
||||
}
|
||||
trap 'cleanup' EXIT INT
|
||||
|
||||
mkdir -p "$init_dir/$TAG-$repo_name/from-source" "$init_dir/$TAG-$repo_name/prebuilt"
|
||||
mkdir -p "${init_dir}/${TAG}-${repo_name}/from-source" "${init_dir}/${TAG}-${repo_name}/prebuilt"
|
||||
|
||||
git -C "$tempdir" clone "$repo.git" &&\
|
||||
cd "$tempdir/${repo_name}" &&\
|
||||
git checkout "$TAG"
|
||||
git -C "${tempdir}" clone "${repo}.git" &&\
|
||||
cd "${tempdir}/${repo_name}" &&\
|
||||
git checkout "${TAG}"
|
||||
|
||||
for os in 22.04 24.04; do
|
||||
os_url="$(printf '%s' "$os" | tr '.' '_')"
|
||||
for os in '22.04' '24.04'; do
|
||||
os_url="$(printf '%s' "${os}" | tr '.' '_')"
|
||||
|
||||
cli_name="simplex-chat-ubuntu-${os_url}-x86_64"
|
||||
deb_name="simplex-desktop-ubuntu-${os_url}-x86_64.deb"
|
||||
appimage_name="simplex-desktop-x86_64.AppImage"
|
||||
|
||||
# Build image
|
||||
docker build \
|
||||
--no-cache \
|
||||
--build-arg TAG=${os} \
|
||||
--build-arg GHC=9.6.3 \
|
||||
-f "$tempdir/${repo_name}/Dockerfile.build" \
|
||||
-t local \
|
||||
--build-arg TAG="${os}" \
|
||||
--build-arg GHC="${ghc}" \
|
||||
-f "${tempdir}/${repo_name}/Dockerfile.build" \
|
||||
-t "${image_name}" \
|
||||
.
|
||||
|
||||
printf '%s' "$cabal_local" > "$tempdir/${repo_name}/cabal.project.local"
|
||||
printf '%s' "${cabal_local}" > "${tempdir}/${repo_name}/cabal.project.local"
|
||||
|
||||
# Run container in background
|
||||
docker run -t -d \
|
||||
--name builder \
|
||||
-v "$tempdir/${repo_name}:/project" \
|
||||
local
|
||||
--name "${container_name}" \
|
||||
--device /dev/fuse \
|
||||
--cap-add SYS_ADMIN \
|
||||
--security-opt apparmor:unconfined \
|
||||
-v "${tempdir}/${repo_name}:/project" \
|
||||
"${image_name}"
|
||||
|
||||
# Consistent permissions
|
||||
docker exec \
|
||||
-t \
|
||||
builder \
|
||||
sh -c 'cabal clean && cabal update && cabal build -j --enable-tests && mkdir -p /out && for i in simplex-chat; do bin=$(find /project/dist-newstyle -name "$i" -type f -executable) && chmod +x "$bin" && mv "$bin" /out/; done && strip /out/simplex-chat'
|
||||
-t "${container_name}" \
|
||||
sh -c 'find /project -type d -exec chmod 755 {} \; ; find /project -type f -perm /111 -exec chmod 755 {} \; ; find /project -type f ! -perm /111 -exec chmod 644 {} \;'
|
||||
|
||||
# CLI
|
||||
docker exec \
|
||||
-t "${container_name}" \
|
||||
sh -c 'cabal clean && cabal update && cabal build -j && mkdir -p /out && for i in simplex-chat; do bin=$(find /project/dist-newstyle -name "$i" -type f -executable) && chmod +x "$bin" && mv "$bin" /out/; done && strip /out/simplex-chat'
|
||||
|
||||
# Copy CLI
|
||||
docker cp \
|
||||
builder:/out/simplex-chat \
|
||||
"$init_dir/$TAG-$repo_name/from-source/simplex-chat-ubuntu-${os_url}-x86-64"
|
||||
"${container_name}":/out/simplex-chat \
|
||||
"${init_dir}/${TAG}-${repo_name}/from-source/${cli_name}"
|
||||
|
||||
# Download prebuilt postgresql binary
|
||||
# Download prebuilt CLI binary
|
||||
curl -L \
|
||||
--output-dir "$init_dir/$TAG-$repo_name/prebuilt/" \
|
||||
-O \
|
||||
"$repo/releases/download/${TAG}/simplex-chat-ubuntu-${os_url}-x86-64"
|
||||
--output-dir "${init_dir}/${TAG}-${repo_name}/prebuilt/" \
|
||||
-O "${repo}/releases/download/${TAG}/${cli_name}"
|
||||
|
||||
# Desktop: deb
|
||||
docker exec \
|
||||
-t "${container_name}" \
|
||||
sh -c './scripts/desktop/make-deb-linux.sh'
|
||||
|
||||
# Copy deb
|
||||
docker cp \
|
||||
"${container_name}":/project/apps/multiplatform/release/main/deb/simplex_x86_64.deb \
|
||||
"${init_dir}/${TAG}-${repo_name}/from-source/${deb_name}"
|
||||
|
||||
# Download prebuilt deb package
|
||||
curl -L \
|
||||
--output-dir "${init_dir}/${TAG}-${repo_name}/prebuilt/" \
|
||||
-O "${repo}/releases/download/${TAG}/${deb_name}"
|
||||
|
||||
# Desktop: appimage. Build only on 22.04
|
||||
case "$os" in
|
||||
22.04)
|
||||
# Appimage
|
||||
docker exec \
|
||||
-t "${container_name}" \
|
||||
sh -c './scripts/desktop/make-appimage-linux.sh && mv ./apps/multiplatform/release/main/*imple*.AppImage ./apps/multiplatform/release/main/simplex.appimage'
|
||||
|
||||
# Copy appimage
|
||||
docker cp \
|
||||
"${container_name}":/project/apps/multiplatform/release/main/simplex.appimage \
|
||||
"${init_dir}/${TAG}-${repo_name}/from-source/${appimage_name}"
|
||||
|
||||
# Download prebuilt appimage binary
|
||||
curl -L \
|
||||
--output-dir "${init_dir}/${TAG}-${repo_name}/prebuilt/" \
|
||||
-O "${repo}/releases/download/${TAG}/${appimage_name}"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Important! Remove dist-newstyle for the next interation
|
||||
docker exec \
|
||||
-t \
|
||||
builder \
|
||||
sh -c 'rm -rf ./dist-newstyle'
|
||||
-t "${container_name}" \
|
||||
sh -c 'rm -rf ./dist-newstyle ./apps/multiplatform'
|
||||
|
||||
# Also restore git to previous state
|
||||
git reset --hard && git clean -dfx
|
||||
|
||||
# Stop containers, delete images
|
||||
docker stop builder
|
||||
docker rm --force builder
|
||||
docker image rm local
|
||||
docker stop "${container_name}"
|
||||
docker rm --force "${container_name}"
|
||||
docker image rm "${image_name}"
|
||||
done
|
||||
|
||||
# Cleanup
|
||||
rm -rf -- "$tempdir"
|
||||
cd "$init_dir"
|
||||
rm -rf -- "${tempdir}"
|
||||
cd "${init_dir}"
|
||||
|
||||
# Final stage: compare hashes
|
||||
|
||||
# Path to binaries
|
||||
path_bin="$init_dir/$TAG-$repo_name"
|
||||
path_bin="${init_dir}/${TAG}-${repo_name}"
|
||||
|
||||
# Assume everything is okay for now
|
||||
bad=0
|
||||
|
||||
# Check hashes for all binaries
|
||||
for file in "$path_bin"/from-source/*; do
|
||||
for file in "${path_bin}"/from-source/*; do
|
||||
# Extract binary name
|
||||
app="$(basename $file)"
|
||||
app="$(basename ${file})"
|
||||
|
||||
# Compute hash for compiled binary
|
||||
compiled=$(sha256sum "$path_bin/from-source/$app" | awk '{print $1}')
|
||||
compiled=$(sha256sum "${path_bin}/from-source/${app}" | awk '{print $1}')
|
||||
# Compute hash for prebuilt binary
|
||||
prebuilt=$(sha256sum "$path_bin/prebuilt/$app" | awk '{print $1}')
|
||||
prebuilt=$(sha256sum "${path_bin}/prebuilt/${app}" | awk '{print $1}')
|
||||
|
||||
# Compare
|
||||
if [ "$compiled" != "$prebuilt" ]; then
|
||||
if [ "${compiled}" != "${prebuilt}" ]; then
|
||||
# If hashes doesn't match, set bad...
|
||||
bad=1
|
||||
|
||||
# ... and print affected binary
|
||||
printf "%s - sha256sum hash doesn't match\n" "$app"
|
||||
printf "%s - sha256sum hash doesn't match\n" "${app}"
|
||||
fi
|
||||
done
|
||||
|
||||
# If everything is still okay, compute checksums file
|
||||
if [ "$bad" = 0 ]; then
|
||||
sha256sum "$path_bin"/from-source/* | sed -e "s|$PWD/||g" -e 's|from-source/||g' -e "s|-$repo_name||g" > "$path_bin/_sha256sums"
|
||||
if [ "${bad}" = 0 ]; then
|
||||
sha256sum "${path_bin}"/from-source/* | sed -e "s|$PWD/||g" -e 's|from-source/||g' -e "s|-$repo_name||g" > "${path_bin}/_sha256sums"
|
||||
|
||||
printf 'Checksums computed - %s\n' "$path_bin/_sha256sums"
|
||||
printf 'Checksums computed - %s\n' "${path_bin}/_sha256sums"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user