mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-10-10 21:28:08 +08:00
fix(linux-build): Change package name to Nylas Mail
Need this in order to allow parallel installation of Nylas Pro and Nylas Mail.
This commit is contained in:
parent
15697a9064
commit
2bc6b7ac0f
5 changed files with 16 additions and 131 deletions
|
@ -2,8 +2,8 @@
|
||||||
Name=<%= productName %>
|
Name=<%= productName %>
|
||||||
Comment=<%= description %>
|
Comment=<%= description %>
|
||||||
GenericName=<%= productName %>
|
GenericName=<%= productName %>
|
||||||
Exec=<%= linuxShareDir %>/nylas %U
|
Exec=/usr/bin/nylas-mail %U
|
||||||
Icon=nylas
|
Icon=nylas-mail
|
||||||
Type=Application
|
Type=Application
|
||||||
StartupNotify=true
|
StartupNotify=true
|
||||||
StartupWMClass=<%= productName %>
|
StartupWMClass=<%= productName %>
|
|
@ -1,115 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [ "$(uname)" == 'Darwin' ]; then
|
|
||||||
OS='Mac'
|
|
||||||
elif [ "$(expr substr $(uname -s) 1 5)" == 'Linux' ]; then
|
|
||||||
OS='Linux'
|
|
||||||
elif [ "$(expr substr $(uname -s) 1 10)" == 'MINGW32_NT' ]; then
|
|
||||||
OS='Cygwin'
|
|
||||||
else
|
|
||||||
echo "Your platform ($(uname -a)) is not supported."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
while getopts ":wtfvh-:" opt; do
|
|
||||||
case "$opt" in
|
|
||||||
-)
|
|
||||||
case "${OPTARG}" in
|
|
||||||
wait)
|
|
||||||
WAIT=1
|
|
||||||
;;
|
|
||||||
help|version)
|
|
||||||
REDIRECT_STDERR=1
|
|
||||||
EXPECT_OUTPUT=1
|
|
||||||
;;
|
|
||||||
foreground|test)
|
|
||||||
EXPECT_OUTPUT=1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
w)
|
|
||||||
WAIT=1
|
|
||||||
;;
|
|
||||||
h|v)
|
|
||||||
REDIRECT_STDERR=1
|
|
||||||
EXPECT_OUTPUT=1
|
|
||||||
;;
|
|
||||||
f|t)
|
|
||||||
EXPECT_OUTPUT=1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ $REDIRECT_STDERR ]; then
|
|
||||||
exec 2> /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $EXPECT_OUTPUT ]; then
|
|
||||||
export ELECTRON_ENABLE_LOGGING=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $OS == 'Mac' ]; then
|
|
||||||
NYLAS_APP_NAME="Nylas Mail.app"
|
|
||||||
|
|
||||||
if [ -z "${NYLAS_PATH}" ]; then
|
|
||||||
# If NYLAS_PATH isnt set, check /Applications and then ~/Applications for Nylas Mail.app
|
|
||||||
if [ -x "/Applications/$NYLAS_APP_NAME" ]; then
|
|
||||||
NYLAS_PATH="/Applications"
|
|
||||||
elif [ -x "$HOME/Applications/$NYLAS_APP_NAME" ]; then
|
|
||||||
NYLAS_PATH="$HOME/Applications"
|
|
||||||
else
|
|
||||||
# We havent found an Nylas Mail.app, use spotlight to search for N1
|
|
||||||
NYLAS_PATH="$(mdfind "kMDItemCFBundleIdentifier == 'com.nylas.nylas-mail'" | grep -v ShipIt | head -1 | xargs -0 dirname)"
|
|
||||||
|
|
||||||
# Exit if N1 can't be found
|
|
||||||
if [ ! -x "$NYLAS_PATH/$NYLAS_APP_NAME" ]; then
|
|
||||||
echo "Cannot locate 'Nylas Mail.app', it is usually located in /Applications. Set the NYLAS_PATH environment variable to the directory containing 'Nylas Mail.app'."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $EXPECT_OUTPUT ]; then
|
|
||||||
"$NYLAS_PATH/$NYLAS_APP_NAME/Contents/MacOS/Nylas" --executed-from="$(pwd)" --pid=$$ "$@"
|
|
||||||
exit $?
|
|
||||||
else
|
|
||||||
open -a "$NYLAS_PATH/$NYLAS_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ --path-environment="$PATH" "$@"
|
|
||||||
fi
|
|
||||||
elif [ $OS == 'Linux' ]; then
|
|
||||||
SCRIPT=$(readlink -f "$0")
|
|
||||||
USR_DIRECTORY=$(readlink -f $(dirname $SCRIPT)/..)
|
|
||||||
|
|
||||||
NYLAS_PATH="$USR_DIRECTORY/share/nylas/nylas-mail"
|
|
||||||
NYLAS_HOME="${NYLAS_HOME:-$HOME/.nylas-mail}"
|
|
||||||
mkdir -p "$NYLAS_HOME"
|
|
||||||
|
|
||||||
: ${TMPDIR:=/tmp}
|
|
||||||
|
|
||||||
[ -x "$NYLAS_PATH" ] || NYLAS_PATH="$TMPDIR/nylas-build/Nylas/nylas"
|
|
||||||
|
|
||||||
if [ $EXPECT_OUTPUT ]; then
|
|
||||||
"$NYLAS_PATH" --executed-from="$(pwd)" --pid=$$ "$@"
|
|
||||||
exit $?
|
|
||||||
else
|
|
||||||
(
|
|
||||||
nohup "$NYLAS_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$NYLAS_HOME/nohup.out" 2>&1
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
cat "$NYLAS_HOME/nohup.out"
|
|
||||||
exit $?
|
|
||||||
fi
|
|
||||||
) &
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Exits this process when N1 exits
|
|
||||||
on_die() {
|
|
||||||
exit 0
|
|
||||||
}
|
|
||||||
trap 'on_die' SIGQUIT SIGTERM
|
|
||||||
|
|
||||||
# If the wait flag is set, don't exit this process until N1 tells it to.
|
|
||||||
if [ $WAIT ]; then
|
|
||||||
while true; do
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
fi
|
|
|
@ -59,7 +59,7 @@ module.exports = (grunt) => {
|
||||||
writeFromTemplate(specInFilePath, templateData)
|
writeFromTemplate(specInFilePath, templateData)
|
||||||
|
|
||||||
// This populates nylas.desktop
|
// This populates nylas.desktop
|
||||||
const desktopInFilePath = path.join(linuxAssetsDir, 'nylas.desktop.in')
|
const desktopInFilePath = path.join(linuxAssetsDir, 'nylas-mail.desktop.in')
|
||||||
writeFromTemplate(desktopInFilePath, templateData)
|
writeFromTemplate(desktopInFilePath, templateData)
|
||||||
|
|
||||||
const cmd = path.join('script', 'mkrpm')
|
const cmd = path.join('script', 'mkrpm')
|
||||||
|
@ -92,14 +92,14 @@ module.exports = (grunt) => {
|
||||||
name: grunt.config('appJSON').name,
|
name: grunt.config('appJSON').name,
|
||||||
description: grunt.config('appJSON').description,
|
description: grunt.config('appJSON').description,
|
||||||
productName: grunt.config('appJSON').productName,
|
productName: grunt.config('appJSON').productName,
|
||||||
linuxShareDir: '/usr/share/nylas',
|
linuxShareDir: '/usr/share/nylas-mail',
|
||||||
arch: arch,
|
arch: arch,
|
||||||
section: 'devel',
|
section: 'devel',
|
||||||
maintainer: 'Nylas Team <support@nylas.com>',
|
maintainer: 'Nylas Team <support@nylas.com>',
|
||||||
installedSize: installedSize,
|
installedSize: installedSize,
|
||||||
}
|
}
|
||||||
writeFromTemplate(path.join(linuxAssetsDir, 'debian', 'control.in'), data)
|
writeFromTemplate(path.join(linuxAssetsDir, 'debian', 'control.in'), data)
|
||||||
writeFromTemplate(path.join(linuxAssetsDir, 'nylas.desktop.in'), data)
|
writeFromTemplate(path.join(linuxAssetsDir, 'nylas-mail.desktop.in'), data)
|
||||||
|
|
||||||
const icon = path.join('build', 'resources', 'nylas.png')
|
const icon = path.join('build', 'resources', 'nylas.png')
|
||||||
const cmd = path.join('script', 'mkdeb');
|
const cmd = path.join('script', 'mkdeb');
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "nylas",
|
"name": "nylas-mail",
|
||||||
"productName": "Nylas Mail",
|
"productName": "Nylas Mail",
|
||||||
"version": "1.0.28",
|
"version": "1.0.28",
|
||||||
"description": "The best email app for people and teams at work",
|
"description": "The best email app for people and teams at work",
|
||||||
|
|
|
@ -22,7 +22,7 @@ TARGET="$TARGET_ROOT/nylas-$VERSION-$ARCH"
|
||||||
|
|
||||||
mkdir -m $FILE_MODE -p "$TARGET/usr"
|
mkdir -m $FILE_MODE -p "$TARGET/usr"
|
||||||
mkdir -m $FILE_MODE -p "$TARGET/usr/share"
|
mkdir -m $FILE_MODE -p "$TARGET/usr/share"
|
||||||
cp -r "$APP_CONTENTS_DIRECTORY" "$TARGET/usr/share/nylas"
|
cp -r "$APP_CONTENTS_DIRECTORY" "$TARGET/usr/share/nylas-mail"
|
||||||
|
|
||||||
mkdir -m $FILE_MODE -p "$TARGET/DEBIAN"
|
mkdir -m $FILE_MODE -p "$TARGET/DEBIAN"
|
||||||
cp "$OUTPUT_PATH/control" "$TARGET/DEBIAN/control"
|
cp "$OUTPUT_PATH/control" "$TARGET/DEBIAN/control"
|
||||||
|
@ -31,28 +31,28 @@ cp "$LINUX_ASSETS_DIRECTORY/debian/postinst" "$TARGET/DEBIAN/postinst"
|
||||||
cp "$LINUX_ASSETS_DIRECTORY/debian/postrm" "$TARGET/DEBIAN/postrm"
|
cp "$LINUX_ASSETS_DIRECTORY/debian/postrm" "$TARGET/DEBIAN/postrm"
|
||||||
|
|
||||||
mkdir -m $FILE_MODE -p "$TARGET/usr/bin"
|
mkdir -m $FILE_MODE -p "$TARGET/usr/bin"
|
||||||
cp "$LINUX_ASSETS_DIRECTORY/nylas.sh" "$TARGET/usr/bin/nylas"
|
ln -s "../share/nylas-mail/nylas" "$TARGET/usr/bin/nylas-mail"
|
||||||
chmod +x "$TARGET/usr/bin/nylas"
|
chmod +x "$TARGET/usr/bin/nylas-mail"
|
||||||
|
|
||||||
mkdir -m $FILE_MODE -p "$TARGET/usr/share/applications"
|
mkdir -m $FILE_MODE -p "$TARGET/usr/share/applications"
|
||||||
cp "$OUTPUT_PATH/nylas.desktop" "$TARGET/usr/share/applications"
|
cp "$OUTPUT_PATH/nylas-mail.desktop" "$TARGET/usr/share/applications"
|
||||||
|
|
||||||
mkdir -m $FILE_MODE -p "$TARGET/usr/share/pixmaps"
|
mkdir -m $FILE_MODE -p "$TARGET/usr/share/pixmaps"
|
||||||
cp "$ICON_FILE" "$TARGET/usr/share/pixmaps"
|
cp "$ICON_FILE" "$TARGET/usr/share/pixmaps/nylas-mail.png"
|
||||||
|
|
||||||
mkdir -m $FILE_MODE -p "$TARGET/usr/share/icons/hicolor"
|
mkdir -m $FILE_MODE -p "$TARGET/usr/share/icons/hicolor"
|
||||||
for i in 256 128 64 32 16; do
|
for i in 256 128 64 32 16; do
|
||||||
mkdir -p "$TARGET/usr/share/icons/hicolor/${i}x${i}/apps"
|
mkdir -p "$TARGET/usr/share/icons/hicolor/${i}x${i}/apps"
|
||||||
cp "$LINUX_ASSETS_DIRECTORY/icons/${i}.png" "$TARGET/usr/share/icons/hicolor/${i}x${i}/apps/nylas.png"
|
cp "$LINUX_ASSETS_DIRECTORY/icons/${i}.png" "$TARGET/usr/share/icons/hicolor/${i}x${i}/apps/nylas-mail.png"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Copy generated LICENSE.md to /usr/share/doc/nylas/copyright
|
# Copy generated LICENSE.md to /usr/share/doc/nylas-mail/copyright
|
||||||
mkdir -m $FILE_MODE -p "$TARGET/usr/share/doc/nylas"
|
mkdir -m $FILE_MODE -p "$TARGET/usr/share/doc/nylas-mail"
|
||||||
cp "$TARGET/usr/share/nylas/LICENSE" "$TARGET/usr/share/doc/nylas/copyright"
|
cp "$TARGET/usr/share/nylas-mail/LICENSE" "$TARGET/usr/share/doc/nylas-mail/copyright"
|
||||||
|
|
||||||
# Add lintian overrides
|
# Add lintian overrides
|
||||||
mkdir -m $FILE_MODE -p "$TARGET/usr/share/lintian/overrides"
|
mkdir -m $FILE_MODE -p "$TARGET/usr/share/lintian/overrides"
|
||||||
cp "$ROOT/build/resources/linux/debian/lintian-overrides" "$TARGET/usr/share/lintian/overrides/nylas"
|
cp "$ROOT/build/resources/linux/debian/lintian-overrides" "$TARGET/usr/share/lintian/overrides/nylas-mail"
|
||||||
|
|
||||||
# Remove group write from all files
|
# Remove group write from all files
|
||||||
chmod -R g-w "$TARGET";
|
chmod -R g-w "$TARGET";
|
||||||
|
|
Loading…
Add table
Reference in a new issue