trilium/bin/build-linux-x64.sh

44 lines
1.1 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
2019-10-12 03:22:59 +08:00
SRC_DIR=./dist/trilium-linux-x64-src
if [ "$1" != "DONTCOPY" ]
then
./bin/copy-trilium.sh $SRC_DIR
fi
echo "Copying required linux-x64 binaries"
2019-10-12 03:22:59 +08:00
rm -r $SRC_DIR/node_modules/sqlite3/lib/binding/*
rm -r $SRC_DIR/node_modules/pngquant-bin/vendor/*
2020-04-16 03:49:36 +08:00
rm -r $SRC_DIR/src/public/app-dist/*.mobile.*
2020-04-12 20:22:51 +08:00
2019-10-12 03:22:59 +08:00
cp -r bin/deps/linux-x64/sqlite/* $SRC_DIR/node_modules/sqlite3/lib/binding/
cp bin/deps/linux-x64/image/pngquant $SRC_DIR/node_modules/pngquant-bin/vendor/
2019-01-13 02:48:45 +08:00
2019-10-12 03:22:59 +08:00
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=linux --arch=x64 --overwrite
2019-10-12 03:22:59 +08:00
BUILD_DIR=./dist/trilium-linux-x64
rm -rf $BUILD_DIR
mv "./dist/Trilium Notes-linux-x64" $BUILD_DIR
cp images/app-icons/png/128x128.png $BUILD_DIR/icon.png
# removing software WebGL binaries because they are pretty huge and not necessary
rm -r $BUILD_DIR/swiftshader
cp bin/tpl/portable-trilium.sh $BUILD_DIR/
chmod 755 $BUILD_DIR/portable-trilium.sh
echo "Packaging linux x64 electron distribution..."
VERSION=`jq -r ".version" package.json`
2019-01-13 02:48:45 +08:00
2019-01-17 06:57:09 +08:00
cd dist
tar cJf trilium-linux-x64-${VERSION}.tar.xz trilium-linux-x64
2019-10-12 03:22:59 +08:00
cd ..
bin/build-debian.sh