mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-07-20 04:51:05 +00:00
Merge branch 'stable' into stable-android
This commit is contained in:
@@ -25,7 +25,7 @@ for elem in "${exports[@]}"; do count=$(grep -R "$elem$" libsimplex.dll.def | wc
|
||||
for elem in "${exports[@]}"; do count=$(grep -R "\"$elem\"" flake.nix | wc -l); if [ $count -ne 2 ]; then echo Wrong exports in flake.nix. Add \"$elem\" in two places of the file; exit 1; fi ; done
|
||||
|
||||
rm -rf $BUILD_DIR
|
||||
cabal build lib:simplex-chat --ghc-options='-optl-Wl,-rpath,$ORIGIN' --ghc-options="-optl-L$(ghc --print-libdir)/rts -optl-Wl,--as-needed,-lHSrts_thr-ghc$GHC_VERSION" --constraint 'simplexmq +client_library'
|
||||
cabal build lib:simplex-chat --ghc-options='-optl-Wl,-rpath,$ORIGIN -flink-rts -threaded' --ghc-options="-optl-L$(ghc --print-libdir)/rts -optl-Wl,--as-needed,-lHSrts_thr-ghc$GHC_VERSION" --constraint 'simplexmq +client_library' --constraint 'simplex-chat +client_library'
|
||||
cd $BUILD_DIR/build
|
||||
#patchelf --add-needed libHSrts_thr-ghc${GHC_VERSION}.so libHSsimplex-chat-*-inplace-ghc${GHC_VERSION}.so
|
||||
#patchelf --add-rpath '$ORIGIN' libHSsimplex-chat-*-inplace-ghc${GHC_VERSION}.so
|
||||
|
||||
@@ -5,7 +5,8 @@ set -e
|
||||
OS=mac
|
||||
ARCH="${1:-`uname -a | rev | cut -d' ' -f1 | rev`}"
|
||||
COMPOSE_ARCH=$ARCH
|
||||
GHC_VERSION=8.10.7
|
||||
GHC_VERSION=9.6.3
|
||||
DATABASE_BACKEND="${2:-sqlite}"
|
||||
|
||||
if [ "$ARCH" == "arm64" ]; then
|
||||
ARCH=aarch64
|
||||
@@ -23,7 +24,14 @@ for elem in "${exports[@]}"; do count=$(grep -R "$elem$" libsimplex.dll.def | wc
|
||||
for elem in "${exports[@]}"; do count=$(grep -R "\"$elem\"" flake.nix | wc -l); if [ $count -ne 2 ]; then echo Wrong exports in flake.nix. Add \"$elem\" in two places of the file; exit 1; fi ; done
|
||||
|
||||
rm -rf $BUILD_DIR
|
||||
cabal build lib:simplex-chat lib:simplex-chat --ghc-options="-optl-Wl,-rpath,@loader_path -optl-Wl,-L$GHC_LIBS_DIR/rts -optl-lHSrts_thr-ghc8.10.7 -optl-lffi" --constraint 'simplexmq +client_library'
|
||||
|
||||
if [[ "$DATABASE_BACKEND" == "postgres" ]]; then
|
||||
echo "Building with postgres backend..."
|
||||
cabal build -f client_postgres lib:simplex-chat lib:simplex-chat --ghc-options="-optl-Wl,-rpath,@loader_path -optl-Wl,-L$GHC_LIBS_DIR/$ARCH-osx-ghc-$GHC_VERSION -optl-lHSrts_thr-ghc$GHC_VERSION -optl-lffi" --constraint 'simplexmq +client_library' --constraint 'simplex-chat +client_library'
|
||||
else
|
||||
echo "Building with sqlite backend..."
|
||||
cabal build lib:simplex-chat lib:simplex-chat --ghc-options="-optl-Wl,-rpath,@loader_path -optl-Wl,-L$GHC_LIBS_DIR/$ARCH-osx-ghc-$GHC_VERSION -optl-lHSrts_thr-ghc$GHC_VERSION -optl-lffi" --constraint 'simplexmq +client_library' --constraint 'simplex-chat +client_library'
|
||||
fi
|
||||
|
||||
cd $BUILD_DIR/build
|
||||
mkdir deps 2> /dev/null || true
|
||||
@@ -83,8 +91,8 @@ cp $BUILD_DIR/build/libHSsimplex-chat-*-inplace-ghc*.$LIB_EXT apps/multiplatform
|
||||
|
||||
cd apps/multiplatform/common/src/commonMain/cpp/desktop/libs/$OS-$ARCH/
|
||||
|
||||
LIBCRYPTO_PATH=$(otool -l libHSdrct-*.$LIB_EXT | grep libcrypto | cut -d' ' -f11)
|
||||
install_name_tool -change $LIBCRYPTO_PATH @rpath/libcrypto.3.0.$LIB_EXT libHSdrct-*.$LIB_EXT
|
||||
LIBCRYPTO_PATH=$(otool -l libHSsmplxmq-*.$LIB_EXT | grep libcrypto | cut -d' ' -f11)
|
||||
install_name_tool -change $LIBCRYPTO_PATH @rpath/libcrypto.3.0.$LIB_EXT libHSsmplxmq-*.$LIB_EXT
|
||||
cp $LIBCRYPTO_PATH libcrypto.3.0.$LIB_EXT
|
||||
chmod 755 libcrypto.3.0.$LIB_EXT
|
||||
install_name_tool -id "libcrypto.3.0.$LIB_EXT" libcrypto.3.0.$LIB_EXT
|
||||
@@ -95,14 +103,18 @@ if [ -n "$LIBCRYPTO_PATH" ]; then
|
||||
install_name_tool -change $LIBCRYPTO_PATH @rpath/libcrypto.3.0.$LIB_EXT $LIB
|
||||
fi
|
||||
|
||||
LIBCRYPTO_PATH=$(otool -l libHSsmplxmq*.$LIB_EXT | grep libcrypto | cut -d' ' -f11)
|
||||
if [ -n "$LIBCRYPTO_PATH" ]; then
|
||||
install_name_tool -change $LIBCRYPTO_PATH @rpath/libcrypto.3.0.$LIB_EXT libHSsmplxmq*.$LIB_EXT
|
||||
fi
|
||||
# We could change libpq and libHSpstgrsql for postgres (?), remove sqlite condition for exit below.
|
||||
# Unnecessary for now as app with postgres backend is not for distribution.
|
||||
if [[ "$DATABASE_BACKEND" == "sqlite" ]]; then
|
||||
LIBCRYPTO_PATH=$(otool -l libHSdrct-*.$LIB_EXT | grep libcrypto | cut -d' ' -f11)
|
||||
if [ -n "$LIBCRYPTO_PATH" ]; then
|
||||
install_name_tool -change $LIBCRYPTO_PATH @rpath/libcrypto.3.0.$LIB_EXT libHSdrct-*.$LIB_EXT
|
||||
fi
|
||||
|
||||
LIBCRYPTO_PATH=$(otool -l libHSsqlcphr-*.$LIB_EXT | grep libcrypto | cut -d' ' -f11)
|
||||
if [ -n "$LIBCRYPTO_PATH" ]; then
|
||||
install_name_tool -change $LIBCRYPTO_PATH @rpath/libcrypto.3.0.$LIB_EXT libHSsqlcphr-*.$LIB_EXT
|
||||
LIBCRYPTO_PATH=$(otool -l libHSsqlcphr-*.$LIB_EXT | grep libcrypto | cut -d' ' -f11)
|
||||
if [ -n "$LIBCRYPTO_PATH" ]; then
|
||||
install_name_tool -change $LIBCRYPTO_PATH @rpath/libcrypto.3.0.$LIB_EXT libHSsqlcphr-*.$LIB_EXT
|
||||
fi
|
||||
fi
|
||||
|
||||
for lib in $(find . -type f -name "*.$LIB_EXT"); do
|
||||
@@ -116,7 +128,9 @@ LOCAL_DIRS=`for lib in $(find . -type f -name "*.$LIB_EXT"); do otool -l $lib |
|
||||
if [ -n "$LOCAL_DIRS" ]; then
|
||||
echo These libs still point to local directories:
|
||||
echo $LOCAL_DIRS
|
||||
exit 1
|
||||
if [[ "$DATABASE_BACKEND" == "sqlite" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
cd -
|
||||
|
||||
@@ -51,7 +51,7 @@ echo " ghc-options: -shared -threaded -optl-L$openssl_windows_style_path -opt
|
||||
# Very important! Without it the build fails on linking step since the linker can't find exported symbols.
|
||||
# It looks like GHC bug because with such random path the build ends successfully
|
||||
sed -i "s/ld.lld.exe/abracadabra.exe/" `ghc --print-libdir`/settings
|
||||
cabal build lib:simplex-chat --constraint 'simplexmq +client_library'
|
||||
cabal build lib:simplex-chat --constraint 'simplexmq +client_library' --constraint 'simplex-chat +client_library'
|
||||
|
||||
rm -rf apps/multiplatform/common/src/commonMain/cpp/desktop/libs/$OS-$ARCH/
|
||||
rm -rf apps/multiplatform/desktop/build/cmake
|
||||
|
||||
Executable
+96
@@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
# Taken from: https://github.com/apache/arrow/blob/main/ci/scripts/util_free_space.sh
|
||||
|
||||
set -eux
|
||||
|
||||
df -h
|
||||
echo "::group::/usr/local/*"
|
||||
du -hsc /usr/local/*
|
||||
echo "::endgroup::"
|
||||
# ~1GB
|
||||
sudo rm -rf \
|
||||
/usr/local/aws-sam-cil \
|
||||
/usr/local/julia* || :
|
||||
echo "::group::/usr/local/bin/*"
|
||||
du -hsc /usr/local/bin/*
|
||||
echo "::endgroup::"
|
||||
# ~1GB (From 1.2GB to 214MB)
|
||||
sudo rm -rf \
|
||||
/usr/local/bin/aliyun \
|
||||
/usr/local/bin/azcopy \
|
||||
/usr/local/bin/bicep \
|
||||
/usr/local/bin/cmake-gui \
|
||||
/usr/local/bin/cpack \
|
||||
/usr/local/bin/helm \
|
||||
/usr/local/bin/hub \
|
||||
/usr/local/bin/kubectl \
|
||||
/usr/local/bin/minikube \
|
||||
/usr/local/bin/node \
|
||||
/usr/local/bin/packer \
|
||||
/usr/local/bin/pulumi* \
|
||||
/usr/local/bin/sam \
|
||||
/usr/local/bin/stack \
|
||||
/usr/local/bin/terraform || :
|
||||
# 142M
|
||||
sudo rm -rf /usr/local/bin/oc || : \
|
||||
echo "::group::/usr/local/share/*"
|
||||
du -hsc /usr/local/share/*
|
||||
echo "::endgroup::"
|
||||
# 506MB
|
||||
sudo rm -rf /usr/local/share/chromium || :
|
||||
# 1.3GB
|
||||
sudo rm -rf /usr/local/share/powershell || :
|
||||
echo "::group::/usr/local/lib/*"
|
||||
du -hsc /usr/local/lib/*
|
||||
echo "::endgroup::"
|
||||
# 15GB
|
||||
sudo rm -rf /usr/local/lib/android || :
|
||||
# 341MB
|
||||
sudo rm -rf /usr/local/lib/heroku || :
|
||||
# 1.2GB
|
||||
sudo rm -rf /usr/local/lib/node_modules || :
|
||||
echo "::group::/opt/*"
|
||||
du -hsc /opt/*
|
||||
echo "::endgroup::"
|
||||
# 679MB
|
||||
sudo rm -rf /opt/az || :
|
||||
echo "::group::/opt/microsoft/*"
|
||||
du -hsc /opt/microsoft/*
|
||||
echo "::endgroup::"
|
||||
# 197MB
|
||||
sudo rm -rf /opt/microsoft/powershell || :
|
||||
echo "::group::/opt/hostedtoolcache/*"
|
||||
du -hsc /opt/hostedtoolcache/*
|
||||
echo "::endgroup::"
|
||||
# 5.3GB
|
||||
sudo rm -rf /opt/hostedtoolcache/CodeQL || :
|
||||
# 1.4GB
|
||||
sudo rm -rf /opt/hostedtoolcache/go || :
|
||||
# 489MB
|
||||
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
|
||||
df -h
|
||||
Reference in New Issue
Block a user