diff options
author | solaraquarion | 2021-02-27 20:16:37 -0500 |
---|---|---|
committer | solaraquarion | 2021-02-27 20:16:37 -0500 |
commit | e356edc210bb6a337715fe38ebb6e94a5151e4af (patch) | |
tree | 9dc0e4dbe3f37817546dbf3b1f802d5e2fefa419 | |
download | aur-apm-community.tar.gz |
initial commit
-rw-r--r-- | .SRCINFO | 28 | ||||
-rw-r--r-- | PKGBUILD | 114 | ||||
-rw-r--r-- | apm.js | 11 | ||||
-rw-r--r-- | git-utils.patch | 10 | ||||
-rw-r--r-- | no-scripts.patch | 21 | ||||
-rw-r--r-- | use-system-npm.patch | 10 |
6 files changed, 194 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..806fed4accd9 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = apm-community + pkgdesc = Atom package manager + pkgver = 2.6.1 + pkgrel = 1 + url = https://github.com/atom/apm + arch = x86_64 + license = MIT + makedepends = git + depends = libsecret + depends = nodejs>=10 + depends = npm + depends = python + provides = nodejs-atom-package-manager + conflicts = nodejs-atom-package-manager + replaces = nodejs-atom-package-manager + options = !emptydirs + source = apm-community-2.6.1.tar.gz::https://github.com/atom-community/apm/archive/2.6.1-atomic.1.0.tar.gz + source = apm.js + source = no-scripts.patch + source = use-system-npm.patch + source = git-utils.patch + sha512sums = edaffed317b83dfdd99a3de4d483d67f667bd82c9f478760e2960fbbed2e56cc08fbf8e494fb2e933f80cb98adc13954ac30d52d46a3606ae2211f0d830fe52e + sha512sums = c02c18e00c378fc968cd593bfed3ff0636a2786fa9ef212547efc30c54576f55dc94ac503b827ec79283c5deb87a22a7046565d8c630d55ed20d0ad020f8a77f + sha512sums = a962ecc1557bcfe92c8d771a44c3bbbd72d0bf9c81285662ef26a1f99f3604efcca0307e7edb59eb99c2cbc83db4ab844f0db0532ca990581eff28e50c42acd6 + sha512sums = de912b3da4f0433be1d960e849dbaf664b6b0d9366b9b8fb784e79f4d5ea35a24cc76c11c9f662b615a66b14ac92c1009d6b85e2c02395d87e27b15daaaa59b8 + sha512sums = bf9f4023bfbdc7240e5ed8a87bc9097eb7a57b2bae44f1044098eb380b15ff8a12f92347b99b6754c6adb537b8310d1f47bdfd3e60db411e4d69d575ce70b2a6 + +pkgname = apm-community diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..033524733e4e --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,114 @@ +# Maintainer: Nicola Squartini <tensor5@gmail.com> + +pkgname=apm-community +pkgver=2.6.1 +pkgrel=1 +_atomic=atomic.1.0 +pkgdesc='Atom package manager' +arch=('x86_64') +url='https://github.com/atom/apm' +license=('MIT') +depends=('libsecret' 'nodejs>=10' 'npm' 'python') +makedepends=('git') +provides=('nodejs-atom-package-manager') +conflicts=('nodejs-atom-package-manager') +replaces=('nodejs-atom-package-manager') +options=(!emptydirs) +source=("${pkgname}-${pkgver}.tar.gz::https://github.com/atom-community/apm/archive/${pkgver}-${_atomic}.tar.gz" + 'apm.js' + 'no-scripts.patch' + 'use-system-npm.patch' + 'git-utils.patch') +sha512sums=('edaffed317b83dfdd99a3de4d483d67f667bd82c9f478760e2960fbbed2e56cc08fbf8e494fb2e933f80cb98adc13954ac30d52d46a3606ae2211f0d830fe52e' + 'c02c18e00c378fc968cd593bfed3ff0636a2786fa9ef212547efc30c54576f55dc94ac503b827ec79283c5deb87a22a7046565d8c630d55ed20d0ad020f8a77f' + 'a962ecc1557bcfe92c8d771a44c3bbbd72d0bf9c81285662ef26a1f99f3604efcca0307e7edb59eb99c2cbc83db4ab844f0db0532ca990581eff28e50c42acd6' + 'de912b3da4f0433be1d960e849dbaf664b6b0d9366b9b8fb784e79f4d5ea35a24cc76c11c9f662b615a66b14ac92c1009d6b85e2c02395d87e27b15daaaa59b8' + 'bf9f4023bfbdc7240e5ed8a87bc9097eb7a57b2bae44f1044098eb380b15ff8a12f92347b99b6754c6adb537b8310d1f47bdfd3e60db411e4d69d575ce70b2a6') + +_apmdir='/usr/lib/node_modules/atom-package-manager' + +prepare() { + rm -rf "${srcdir}"/apm-build + + cd apm-${pkgver}-${_atomic} + + # Use custom launcher + rm bin/apm{,.cmd} bin/npm{,.cmd} + rm src/cli.coffee + install -m755 "${srcdir}"/apm.js bin/apm + + # Use system npm + patch -Np1 -i "${srcdir}"/use-system-npm.patch + + # Don't download binary Node + patch -Np1 -i "${srcdir}"/no-scripts.patch + rm BUNDLED_NODE_VERSION script/* +} + +build() { + cd apm-${pkgver}-${_atomic} + + npm install + npx coffee --compile --output lib src + npm uninstall coffee-script coffeelint express jasmine-focused shx node-gyp + + cd node_modules/git-utils + patch -Np1 -i "${srcdir}/git-utils.patch" + node-gyp rebuild + cd ../.. + + npm pack +} + +package() { + cd apm-${pkgver}-${_atomic} + + install -d -m755 "${pkgdir}${_apmdir}" + tar -xf atom-ide-community-atom-package-manager-${pkgver}-${_atomic}.tgz --strip-components 1 \ + -C "${pkgdir}${_apmdir}" + cp -r node_modules "${pkgdir}${_apmdir}" + + install -d -m755 "${pkgdir}/usr/bin" + ln -s \ + "$(realpath --relative-to="${pkgdir}/usr/bin" "${pkgdir}${_apmdir}/bin/apm")" \ + "${pkgdir}/usr/bin" + + # Install license file + install -d -m755 "${pkgdir}/usr/share/licenses/${pkgname}" + ln -s \ + "$(realpath --relative-to="${pkgdir}/usr/share/licenses/${pkgname}" "${pkgdir}${_apmdir}/LICENSE.md")" \ + "${pkgdir}/usr/share/licenses/${pkgname}" + + # Remove occurrences of ${srcdir} + find "${pkgdir}" -name "package.json" \ + -exec sed -e "s|${srcdir}/apm-${pkgver}|${_apmdir}|" \ + -i '{}' \; + + # Remove useless stuff + find "${pkgdir}"/usr/lib \ + -name ".*" -prune -exec rm -r '{}' \; \ + -or -name "*.a" -exec rm '{}' \; \ + -or -name "*.bat" -exec rm '{}' \; \ + -or -name "*.mk" -exec rm '{}' \; \ + -or -path "*/git-utils/binding.gyp" -exec rm '{}' \; \ + -or -path "*/git-utils/src/*.cc" -exec rm '{}' \; \ + -or -path "*/git-utils/src/*.h" -exec rm '{}' \; \ + -or -path "*/keytar/binding.gyp" -exec rm '{}' \; \ + -or -path "*/keytar/src" -prune -exec rm -r '{}' \; \ + -or -path "*/oniguruma/binding.gyp" -exec rm '{}' \; \ + -or -path "*/oniguruma/src" -prune -exec rm -r '{}' \; \ + -or -name "appveyor.yml" -exec rm '{}' \; \ + -or -name "benchmark" -prune -exec rm -r '{}' \; \ + -or -name "binding.Makefile" -exec rm '{}' \; \ + -or -name "config.gypi" -exec rm '{}' \; \ + -or -name "deps" -prune -exec rm -r '{}' \; \ + -or -name "doc" -prune -exec rm -r '{}' \; \ + -or -name "html" -prune -exec rm -r '{}' \; \ + -or -name "Makefile" -exec rm '{}' \; \ + -or -name "man" -prune -exec rm -r '{}' \; \ + -or -name "obj.target" -prune -exec rm -r '{}' \; \ + -or -name "samples" -prune -exec rm -r '{}' \; \ + -or -name "scripts" -prune -exec rm -r '{}' \; \ + -or -name "test" -prune -exec rm -r '{}' \; \ + -or -name "tests" -prune -exec rm -r '{}' \; +} diff --git a/apm.js b/apm.js new file mode 100644 index 000000000000..5c1ce6bd63a7 --- /dev/null +++ b/apm.js @@ -0,0 +1,11 @@ +#!/usr/bin/node + +"use strict"; + +process.env.ATOM_RESOURCE_PATH = process.env.ATOM_RESOURCE_PATH || "/usr/lib/atom"; + +process.env.ATOM_ELECTRON_VERSION = process.env.ATOM_ELECTRON_VERSION || require("fs").readFileSync("/usr/lib/electron6/version", "utf8"); + +require("../lib/apm-cli.js").run(process.argv.slice(2), function (error) { + process.exitCode = Number(Boolean(error)); +}); diff --git a/git-utils.patch b/git-utils.patch new file mode 100644 index 000000000000..b991b94a9133 --- /dev/null +++ b/git-utils.patch @@ -0,0 +1,10 @@ +--- a/binding.gyp ++++ b/binding.gyp +@@ -162,6 +162,7 @@ + 'deps/libgit2/src/message.h', + 'deps/libgit2/src/mwindow.c', + 'deps/libgit2/src/mwindow.h', ++ 'deps/libgit2/src/net.c', + 'deps/libgit2/src/netops.c', + 'deps/libgit2/src/netops.h', + 'deps/libgit2/src/notes.c', diff --git a/no-scripts.patch b/no-scripts.patch new file mode 100644 index 000000000000..12662e9743c9 --- /dev/null +++ b/no-scripts.patch @@ -0,0 +1,21 @@ +--- a/package.json ++++ b/package.json +@@ -14,18 +14,6 @@ + "bin": { + "apm": "bin/apm" + }, +- "scripts": { +- "check-version": "node script/check-version.js", +- "clean:bin": "shx rm -rf bin/node_darwin_x64 bin/node.exe bin/node", +- "clean:lib": "shx rm -rf lib && shx mkdir -p lib", +- "clean": "npm run clean:lib && npm run clean:bin", +- "lint": "coffeelint src spec", +- "coffee": "coffee --compile --output lib src", +- "build": "npm run clean:lib && npm run coffee", +- "prepare": "npm run build", +- "postinstall": "node script/postinstall.js", +- "test": "npm run check-version && npm run lint && jasmine-focused --captureExceptions --coffee spec" +- }, + "dependencies": { + "@atom/plist": "0.4.4", + "asar-require": "0.3.0", diff --git a/use-system-npm.patch b/use-system-npm.patch new file mode 100644 index 000000000000..7b2ea4c3f354 --- /dev/null +++ b/use-system-npm.patch @@ -0,0 +1,10 @@ +--- a/package.json ++++ b/package.json +@@ -39,7 +39,6 @@ + "keytar": "^6.0.1", + "mv": "2.1.1", + "ncp": "~2.0.0", +- "npm": "^6.14.9", + "open": "7.3.0", + "q": "~1.5.1", + "read": "~1.0.7", |