[arch-commits] Commit in atom/trunk (PKGBUILD)
Caleb Maclennan
alerque at gemini.archlinux.org
Thu Apr 7 12:23:15 UTC 2022
Date: Thursday, April 7, 2022 @ 12:23:14
Author: alerque
Revision: 1182792
Sucessfully build atom 1.61beta0, still needs electron11 fixes
Modified:
atom/trunk/PKGBUILD
----------+
PKGBUILD | 176 ++++++++++++++++++++++++++++++-------------------------------
1 file changed, 89 insertions(+), 87 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2022-04-07 11:37:32 UTC (rev 1182791)
+++ PKGBUILD 2022-04-07 12:23:14 UTC (rev 1182792)
@@ -1,10 +1,11 @@
# Maintainer: Caleb Maclennan <caleb at alerque.com>
# Contributor: Nicola Squartini <tensor5 at gmail.com>
+# Contributor: loqs
pkgname=atom
pkgver=1.61.0beta0
_sha=a19b6eed206e3d635367fbff69e2777bb04feb1d
-pkgrel=0
+pkgrel=1
pkgdesc='A hackable text editor for the 21st Century'
arch=(x86_64)
url="https://github.com/atom/$pkgname"
@@ -51,110 +52,111 @@
_electron_version=$(< /usr/lib/$_electron/version)
prepare() {
- cd "$_archive"
- patch -Np1 -i ../fix-$pkgname-sh.patch
- patch -Np1 -i <(sed -e "s/@ELECTRON@/$_electron/" ../use-system-electron.patch)
- patch -Np1 -i ../use-system-apm.patch
- patch -Np1 -i ../fix-license-path.patch
- patch -Np1 -i ../fix-restart.patch
- patch -Np1 -i ../node-env-production.patch
- patch -Np1 -i ../no-unsafe-eval-warning.patch
+ cd "$_archive"
+ patch -Np1 -i ../fix-$pkgname-sh.patch
+ patch -Np1 -i <(sed -e "s/@ELECTRON@/$_electron/" ../use-system-electron.patch)
+ patch -Np1 -i ../use-system-apm.patch
+ patch -Np1 -i ../fix-license-path.patch
+ patch -Np1 -i ../fix-restart.patch
+ patch -Np1 -i ../node-env-production.patch
+ patch -Np1 -i ../no-unsafe-eval-warning.patch
- rm {,script/}package-lock.json
- set -x
+ CXXFLAGS="${CXXFLAGS/ -fexceptions/}"
+ env \
+ ATOM_RESOURCE_PATH="$PWD" ATOM_HOME="$srcdir/.atom" \
+ npm_config_build_from_source=true \
+ npm_config_target=$_electron_version \
+ GYP_DEFINES="openssl_fips=" \
+ apm install --cache "$srcdir/npm-cache"
- env \
- ATOM_RESOURCE_PATH="$PWD" \
- npm_config_build_from_source=true \
- npm_config_target=$_electron_version \
- apm install --cache "$srcdir/npm-cache"
+ # Use system ctags
+ pushd node_modules/symbols-view
+ patch -Np1 -i "$srcdir/symbols-view-use-system-ctags.patch"
+ rm -r lib/ctags-config vendor
+ popd
- # Use system ctags
- pushd node_modules/symbols-view
- patch -Np1 -i "$srcdir/symbols-view-use-system-ctags.patch"
- rm -r lib/ctags-config vendor
- popd
+ # Use system git
+ pushd node_modules/dugite
+ patch -Np1 -i "$srcdir/dugite-use-system-git.patch"
+ rm -r git
+ popd
- # Use system git
- pushd node_modules/dugite
- patch -Np1 -i "$srcdir/dugite-use-system-git.patch"
- rm -r git
- popd
+ # Fix issue with:
+ # build/Release/git.node: undefined symbol: git_net_url_is_default_port
+ pushd node_modules/git-utils
+ patch -Np1 -i "$srcdir/git-utils.patch"
+ popd
- # Fix issue with:
- # build/Release/git.node: undefined symbol: git_net_url_is_default_port
- pushd node_modules/git-utils
- patch -Np1 -i "$srcdir/git-utils.patch"
- popd
-
- pushd script
- npm install --cache "$srcdir/npm-cache"
+ pushd script
+ npm install --cache "$srcdir/npm-cache"
}
build() {
- cd "$_archive"
- set -x
+ cd "$_archive"
- pushd node_modules/git-utils
- env \
- npm_config_disturl=https://electronjs.org/headers \
- npm_config_runtime=$_electron \
- npm_config_target=$_electron_version \
- node-gyp rebuild
- popd
+ CXXFLAGS="${CXXFLAGS/ -fexceptions/}"
+ pushd node_modules/git-utils
+ env \
+ npm_config_disturl=https://electronjs.org/headers \
+ npm_config_runtime=$_electron \
+ npm_config_target=$_electron_version \
+ GYP_DEFINES="openssl_fips=" \
+ node-gyp rebuild
+ popd
- pushd script
- # Hack to avoid using Node > 12 (https://github.com/babel/babel/issues/11216)
- # Set ELECTRON_VERSION (see use-system-electron.patch)
- env \
- ELECTRON_RUN_AS_NODE=1 \
- ELECTRON_VERSION=$_electron_version \
- $_electron build --no-bootstrap
+ pushd script
+ # Hack to avoid using Node > 12 (https://github.com/babel/babel/issues/11216)
+ # Set ELECTRON_VERSION (see use-system-electron.patch)
+ env \
+ ELECTRON_RUN_AS_NODE=1 \
+ ELECTRON_VERSION=$_electron_version \
+ $_electron build --no-bootstrap
}
package() {
- cd "$_archive"
+ cd "$_archive"
- install -dm0755 "$pkgdir/usr/lib"
- cp -r out/app "$pkgdir/usr/lib/$pkgname"
- install -m0644 out/startup.js "$pkgdir/usr/lib/$pkgname"
- sed -e "s/@ELECTRON@/$_electron/" "$srcdir/$pkgname.js" |
- install -Dm0755 /dev/stdin "$pkgdir/usr/lib/$pkgname/$pkgname"
+ install -dm0755 "$pkgdir/usr/lib"
+ cp -r out/app "$pkgdir/usr/lib/$pkgname"
+ install -m0644 out/startup.js "$pkgdir/usr/lib/$pkgname"
+ sed -e "s/@ELECTRON@/$_electron/" "$srcdir/$pkgname.js" |
+ install -Dm0755 /dev/stdin "$pkgdir/usr/lib/$pkgname/$pkgname"
- ln -sf /usr/bin/rg "$pkgdir/usr/lib/$pkgname/node_modules/vscode-ripgrep/bin/rg"
+ ln -sf /usr/bin/rg "$pkgdir/usr/lib/$pkgname/node_modules/vscode-ripgrep/bin/rg"
- install -dm0755 "$pkgdir/usr/share/applications"
- sed -e "s|<%= appName %>|Atom|" \
- -e "s/<%= description %>/$pkgdesc/" \
- -e "s|<%= installDir %>|/usr|" \
- -e "s|<%= appFileName %>|$pkgname|" \
- -e "s|<%= iconPath %>|$pkgname|" \
- resources/linux/atom.desktop.in > "$pkgdir/usr/share/applications/$pkgname.desktop"
+ install -dm0755 "$pkgdir/usr/share/applications"
+ sed -e "s|<%= appName %>|Atom|" \
+ -e "s/<%= description %>/$pkgdesc/" \
+ -e "s|<%= installDir %>|/usr|" \
+ -e "s|<%= appFileName %>|$pkgname|" \
+ -e "s|<%= iconPath %>|$pkgname|" \
+ resources/linux/atom.desktop.in > "$pkgdir/usr/share/applications/$pkgname.desktop"
- for size in 16 24 32 48 64 128 256 512 1024; do
- install -Dm0644 "resources/app-icons/stable/png/$size.png" \
- "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/$pkgname.png"
- done
- ln -sf "../../../share/icons/hicolor/1024x1024/apps/$pkgname.png" \
- "$pkgdir/usr/lib/$pkgname/resources/$pkgname.png"
+ for size in 16 24 32 48 64 128 256 512 1024; do
+ install -Dm0644 "resources/app-icons/stable/png/$size.png" \
+ "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/$pkgname.png"
+ done
+ ln -sf "../../../share/icons/hicolor/1024x1024/apps/$pkgname.png" \
+ "$pkgdir/usr/lib/$pkgname/resources/$pkgname.png"
- install -Dm0755 "$pkgname.sh" "$pkgdir/usr/bin/$pkgname"
+ install -Dm0755 "$pkgname.sh" "$pkgdir/usr/bin/$pkgname"
- install -dm0755 "$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))"
+ install -dm0755 "$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))"
- # Remove useless stuff
- find "$pkgdir/usr/lib/$pkgname/node_modules" \
- -name '*.a' -exec rm '{}' \; \
- -or -name '*.bat' -exec rm '{}' \; \
- -or -name '*.c' -exec rm '{}' \; \
- -or -name '*.cpp' -exec rm '{}' \; \
- -or -name '*.node' -exec chmod a-x '{}' \; \
- -or -name 'benchmark' -prune -exec rm -r '{}' \; \
- -or -name 'doc' -prune -exec rm -r '{}' \; \
- -or -name 'html' -prune -exec rm -r '{}' \; \
- -or -name 'man' -prune -exec rm -r '{}' \; \
- -or -name 'scripts' -prune -exec rm -r '{}' \; \
- -or -path '*/less/gradle' -prune -exec rm -r '{}' \; \
- -or -path '*/task-lists/src' -prune -exec rm -r '{}' \;
+ # Remove useless stuff
+ find "$pkgdir/usr/lib/$pkgname/node_modules" \
+ -name '*.a' -exec rm '{}' \; \
+ -or -name '*.bat' -exec rm '{}' \; \
+ -or -name '*.c' -exec rm '{}' \; \
+ -or -name '*.cpp' -exec rm '{}' \; \
+ -or -name '*.node' -exec chmod a-x '{}' \; \
+ -or -name 'benchmark' -prune -exec rm -r '{}' \; \
+ -or -name 'doc' -prune -exec rm -r '{}' \; \
+ -or -name 'html' -prune -exec rm -r '{}' \; \
+ -or -name 'man' -prune -exec rm -r '{}' \; \
+ -or -name 'scripts' -prune -exec rm -r '{}' \; \
+ -or -path '*/.github/workflows' -prune -exec rm -r '{}' \; \
+ -or -path '*/less/gradle' -prune -exec rm -r '{}' \; \
+ -or -path '*/task-lists/src' -prune -exec rm -r '{}' \;
}
More information about the arch-commits
mailing list