mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 20:29:53 +00:00
26 lines
1.2 KiB
Bash
26 lines
1.2 KiB
Bash
|
#!/bin/bash
|
||
|
|
||
|
OS=linux
|
||
|
ARCH=${1:-`uname -a | rev | cut -d' ' -f2 | rev`}
|
||
|
GHC_VERSION=8.10.7
|
||
|
|
||
|
BUILD_DIR=dist-newstyle/build/$ARCH-$OS/ghc-${GHC_VERSION}/simplex-chat-*
|
||
|
|
||
|
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"
|
||
|
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
|
||
|
mkdir deps
|
||
|
ldd libHSsimplex-chat-*-inplace-ghc${GHC_VERSION}.so | grep "ghc" | cut -d' ' -f 3 | xargs -I {} cp {} ./deps/
|
||
|
|
||
|
cd -
|
||
|
|
||
|
rm -rf apps/multiplatform/common/src/commonMain/cpp/desktop/libs/$OS-$ARCH/
|
||
|
rm -rf apps/multiplatform/common/src/commonMain/resources/libs/$OS-$ARCH/
|
||
|
rm -rf apps/multiplatform/desktop/build/cmake
|
||
|
|
||
|
mkdir -p apps/multiplatform/common/src/commonMain/cpp/desktop/libs/$OS-$ARCH/
|
||
|
cp -r $BUILD_DIR/build/deps apps/multiplatform/common/src/commonMain/cpp/desktop/libs/$OS-$ARCH/
|
||
|
cp $BUILD_DIR/build/libHSsimplex-chat-*-inplace-ghc${GHC_VERSION}.so apps/multiplatform/common/src/commonMain/cpp/desktop/libs/$OS-$ARCH/
|