Commit 5431e0b4 authored by gnastyle's avatar gnastyle

atom: imported

parent 37b54caf
*** a/verify-machine-requirements.js Mon May 15 19:46:51 2017
--- b/verify-machine-requirements.js Sun May 21 17:38:05 2017
***************
*** 7,30 ****
const CONFIG = require('../config')
module.exports = function () {
- verifyNode()
verifyNpm()
if (process.platform === 'win32') {
verifyPython()
}
}
- function verifyNode () {
- const fullVersion = process.versions.node
- const majorVersion = fullVersion.split('.')[0]
- if (majorVersion >= 4 && majorVersion < 7) {
- console.log(`Node:\tv${fullVersion}`)
- } else if (majorVersion >= 7) {
- throw new Error(`Atom does not build properly on node v7+. node v${fullVersion} is installed.`)
- } else {
- throw new Error(`node v4+ is required to build Atom. node v${fullVersion} is installed.`)
- }
- }
function verifyNpm () {
const stdout = childProcess.execFileSync(CONFIG.getNpmBinPath(), ['--version'], {env: process.env})
--- 7,18 ----
pkgname=atom
pkgver=1.17.0
pkgrel=1
pkgdesc='A hackable text editor for the 21st Century'
arch=('x86_64')
url='https://github.com/atom/atom'
license=('MIT' 'custom')
depends=('libxkbfile' 'gtk2')
makedepends=('git' 'npm' 'libgnome-keyring' 'gconf' 'python2')
options=(!emptydirs)
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/atom/atom/archive/v${pkgver}.tar.gz"
'fix-license-path.patch'
'fix-restart.patch'
'0001-do-not-check-node-version.patch')
sha256sums=('f9ccf2aa45b82bbf42a6a7fbbe5a3b7fdda99d76e77af8dee949fbcc419e94c6'
'b7a325867a16fe1eece589ff5d70e642e7387557865c6d6c566b760cbe93f4e2'
'83b6a85c8f3d38fcb13682bc8d948137448ae5cd9f616f20f76b5f504f4caa52'
'e42a03465a3944c3f79c67d34f340384d65df742e8aec16491a4c8c265017257')
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
patch -Np1 -i "${srcdir}"/fix-license-path.patch
patch -Np1 -i "${srcdir}"/fix-restart.patch
cd script/lib
patch -Np1 -i "${srcdir}"/0001-do-not-check-node-version.patch
}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
export PYTHON=/usr/bin/python2
export ATOM_RESOURCE_PATH="$srcdir/atom-$pkgver"
# If unset, ~/.atom/.node-gyp/.atom/.npm is used
export NPM_CONFIG_CACHE="${HOME}/.atom/.npm"
cd script
npm install
./build
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
install -d -m 755 "${pkgdir}"/usr/share/atom
cp -r out/atom-$pkgver-amd64/* "${pkgdir}"/usr/share/atom
msg "installing .desktop"
install -d -m 755 "${pkgdir}/usr/share/applications"
sed -e "s|<%= appName %>|Atom|" \
-e "s/<%= description %>/${pkgdesc}/" \
-e "s|<%= installDir %>/share/<%= appFileName %>/atom|/usr/bin/atom|" \
-e "s|<%= iconPath %>|atom|" \
resources/linux/atom.desktop.in > "${pkgdir}/usr/share/applications/atom.desktop"
msg "installing icons"
for size in 16 24 32 48 64 128 256 512 1024; do
install -D -m 644 resources/app-icons/stable/png/${size}.png \
"${pkgdir}"/usr/share/icons/hicolor/${size}x${size}/apps/atom.png
done
ln -sf ../../../share/icons/hicolor/1024x1024/apps/atom.png \
"${pkgdir}"/usr/share/atom/resources/atom.png
msg "installing atom.sh"
install -D -m 755 atom.sh "${pkgdir}/usr/bin/atom"
msg "installing license"
install -d -m 755 "${pkgdir}/usr/share/licenses/${pkgname}"
node -e "require('./script/lib/get-license-text')().then((licenseText) => require('fs').writeFileSync('${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.md', licenseText))"
}
--- a/atom.sh
+++ b/atom.sh
@@ -1,20 +1,5 @@
#!/bin/bash
-if [ "$(uname)" == 'Darwin' ]; then
- OS='Mac'
-elif [ "$(expr substr $(uname -s) 1 5)" == 'Linux' ]; then
- OS='Linux'
-else
- echo "Your platform ($(uname -a)) is not supported."
- exit 1
-fi
-
-if [ "$(basename $0)" == 'atom-beta' ]; then
- BETA_VERSION=true
-else
- BETA_VERSION=
-fi
-
export ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT=true
while getopts ":wtfvh-:" opt; do
@@ -54,79 +39,22 @@
export ELECTRON_ENABLE_LOGGING=1
fi
-if [ $OS == 'Mac' ]; then
- if [ -L "$0" ]; then
- SCRIPT="$(readlink "$0")"
- else
- SCRIPT="$0"
- fi
- ATOM_APP="$(dirname "$(dirname "$(dirname "$(dirname "$SCRIPT")")")")"
- if [ "$ATOM_APP" == . ]; then
- unset ATOM_APP
- else
- ATOM_PATH="$(dirname "$ATOM_APP")"
- ATOM_APP_NAME="$(basename "$ATOM_APP")"
- fi
-
- if [ -n "$BETA_VERSION" ]; then
- ATOM_EXECUTABLE_NAME="Atom Beta"
- else
- ATOM_EXECUTABLE_NAME="Atom"
- fi
-
- if [ -z "${ATOM_PATH}" ]; then
- # If ATOM_PATH isn't set, check /Applications and then ~/Applications for Atom.app
- if [ -x "/Applications/$ATOM_APP_NAME" ]; then
- ATOM_PATH="/Applications"
- elif [ -x "$HOME/Applications/$ATOM_APP_NAME" ]; then
- ATOM_PATH="$HOME/Applications"
- else
- # We haven't found an Atom.app, use spotlight to search for Atom
- ATOM_PATH="$(mdfind "kMDItemCFBundleIdentifier == 'com.github.atom'" | grep -v ShipIt | head -1 | xargs -0 dirname)"
-
- # Exit if Atom can't be found
- if [ ! -x "$ATOM_PATH/$ATOM_APP_NAME" ]; then
- echo "Cannot locate ${ATOM_APP_NAME}, it is usually located in /Applications. Set the ATOM_PATH environment variable to the directory containing ${ATOM_APP_NAME}."
- exit 1
- fi
- fi
- fi
-
- if [ $EXPECT_OUTPUT ]; then
- "$ATOM_PATH/$ATOM_APP_NAME/Contents/MacOS/$ATOM_EXECUTABLE_NAME" --executed-from="$(pwd)" --pid=$$ "$@"
- exit $?
- else
- open -a "$ATOM_PATH/$ATOM_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)/..)
-
- if [ -n "$BETA_VERSION" ]; then
- ATOM_PATH="$USR_DIRECTORY/share/atom-beta/atom"
- else
- ATOM_PATH="$USR_DIRECTORY/share/atom/atom"
- fi
-
- ATOM_HOME="${ATOM_HOME:-$HOME/.atom}"
- mkdir -p "$ATOM_HOME"
-
- : ${TMPDIR:=/tmp}
+ATOM_PATH="electron --app=/usr/lib/atom"
- [ -x "$ATOM_PATH" ] || ATOM_PATH="$TMPDIR/atom-build/Atom/atom"
+ATOM_HOME="${ATOM_HOME:-$HOME/.atom}"
+mkdir -p "$ATOM_HOME"
- if [ $EXPECT_OUTPUT ]; then
- "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@"
+if [ $EXPECT_OUTPUT ]; then
+ $ATOM_PATH --executed-from="$(pwd)" --pid=$$ "$@"
+ exit $?
+else
+ (
+ nohup $ATOM_PATH --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1
+ if [ $? -ne 0 ]; then
+ cat "$ATOM_HOME/nohup.out"
exit $?
- else
- (
- nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1
- if [ $? -ne 0 ]; then
- cat "$ATOM_HOME/nohup.out"
- exit $?
- fi
- ) &
fi
+ ) &
fi
# Exits this process when Atom is used as $EDITOR
--- a/src/main-process/atom-application.coffee
+++ b/src/main-process/atom-application.coffee
@@ -262,7 +262,7 @@
@openPathOnEvent('application:open-your-keymap', 'atom://.atom/keymap')
@openPathOnEvent('application:open-your-snippets', 'atom://.atom/snippets')
@openPathOnEvent('application:open-your-stylesheet', 'atom://.atom/stylesheet')
- @openPathOnEvent('application:open-license', path.join(process.resourcesPath, 'LICENSE.md'))
+ @openPathOnEvent('application:open-license', '/usr/share/licenses/atom/LICENSE.md')
@disposable.add ipcHelpers.on app, 'before-quit', (event) =>
unless @quitting
--- a/src/workspace.js
+++ b/src/workspace.js
@@ -1046,7 +1046,7 @@
// Open Atom's license in the active pane.
openLicense () {
- return this.open(path.join(process.resourcesPath, 'LICENSE.md'))
+ return this.open('/usr/share/licenses/atom/LICENSE.md')
}
// Synchronously open the given URI in the active pane. **Only use this method
\ No newline at end of file
--- a/src/main-process/atom-application.coffee
+++ b/src/main-process/atom-application.coffee
@@ -821,7 +821,7 @@
@restart()
restart: ->
- args = []
+ args = ["--app=/usr/lib/atom"]
args.push("--safe") if @safeMode
args.push("--log-file=#{@logFile}") if @logFile?
args.push("--socket-path=#{@socketPath}") if @socketPath?
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment