From 8567f6a7ee159ff29f72214328c73d8740c41036 Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Sat, 20 Mar 2021 16:12:19 +0100 Subject: [PATCH] Add desktop entry and svg icon in build-package script Close #117 --- build-packages.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/build-packages.sh b/build-packages.sh index 59280e92..e9e952d3 100755 --- a/build-packages.sh +++ b/build-packages.sh @@ -95,7 +95,7 @@ lite_build_package_macosx () { local arch="$2" local os="macosx" local pdir=".package-build/lite-xl.app/Contents/MacOS" - if [ $portable == "true" ]; then + if [ "$portable" == "-portable" ]; then local bindir="$pdir" local datadir="$pdir/data" else @@ -131,8 +131,7 @@ lite_build_package_linux () { local arch="$2" local os="linux" local pdir=".package-build/lite-xl" - if [ $portable == "true" ]; then - echo "WARNING: using portable option on unix-like system" + if [ "$portable" == "-portable" ]; then local bindir="$pdir" local datadir="$pdir/data" else @@ -149,6 +148,22 @@ lite_build_package_linux () { done cp "$build/src/lite" "$bindir" strip "$bindir/lite" + if [ -z "$portable" ]; then + mkdir -p "$pdir/share/applications" "$pdir/share/icons/hicolor/scalable/apps" + cat << EOF > "$pdir/share/applications/lite-xl.desktop" +[Desktop Entry] +Type=Application +Name=Lite XL +Comment=A lightweight text editor written in Lua +Exec=lite %F +Icon=lite-xl +Terminal=false +StartupNotify=false +Categories=Utility;TextEditor;Development; +MimeType=text/plain; +EOF + cp "dev-utils/lite.svg" "$pdir/share/icons/hicolor/scalable/apps/lite-xl.svg" + fi pushd ".package-build" local package_name="lite-xl-$os-$arch$portable.tar.gz" tar czf "$package_name" "lite-xl"