mirror of
https://gitdl.cn/https://github.com/chakralinux/gtk.git
synced 2025-01-25 02:22:13 +08:00
67 lines
2.3 KiB
Bash
67 lines
2.3 KiB
Bash
pkgname=atom
|
|
pkgver=1.23.1
|
|
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' 'libxtst' 'libxss' 'alsa-lib' 'nss')
|
|
makedepends=('git' 'npm' 'libgnome-keyring' 'gconf' 'python2' 'libsecret')
|
|
options=(!emptydirs)
|
|
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/atom/atom/archive/v${pkgver}.tar.gz"
|
|
'fix-license-path.patch'
|
|
'fix-restart.patch')
|
|
sha256sums=('56147093f1b8fd98e1cdf9671888694b732ed6b83f7641c199ddbc54df76544f'
|
|
'e9df53a60c1d27d7adf9d6b8d6eb2d3462967875e3a21b672f2cc8fbbefeec0c'
|
|
'34625e26f1089a068582bd43a9a3755b3f5186b90dcc097b519def8f701d9f3a')
|
|
|
|
prepare() {
|
|
cd "${srcdir}/${pkgname}-${pkgver}"
|
|
|
|
patch -Np1 -i "${srcdir}"/fix-license-path.patch
|
|
patch -Np1 -i "${srcdir}"/fix-restart.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))"
|
|
}
|