From 36e9a891464b00f83be9378334a51e4d51a2ed62 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Sat, 25 Feb 2017 17:06:15 +0100 Subject: community/yarn: move from testing --- community/yarn/APKBUILD | 63 ++++++++++++++++++++++ community/yarn/add-apk-install-method.patch | 39 ++++++++++++++ .../yarn/remove-support-for-legacy-nodejs.patch | 23 ++++++++ testing/yarn/APKBUILD | 62 --------------------- testing/yarn/add-apk-install-method.patch | 39 -------------- .../yarn/remove-support-for-legacy-nodejs.patch | 23 -------- 6 files changed, 125 insertions(+), 124 deletions(-) create mode 100644 community/yarn/APKBUILD create mode 100644 community/yarn/add-apk-install-method.patch create mode 100644 community/yarn/remove-support-for-legacy-nodejs.patch delete mode 100644 testing/yarn/APKBUILD delete mode 100644 testing/yarn/add-apk-install-method.patch delete mode 100644 testing/yarn/remove-support-for-legacy-nodejs.patch diff --git a/community/yarn/APKBUILD b/community/yarn/APKBUILD new file mode 100644 index 0000000000..2a1c803d17 --- /dev/null +++ b/community/yarn/APKBUILD @@ -0,0 +1,63 @@ +# Contributor: Ed Robinson +# Maintainer: Ed Robinson +pkgname=yarn +pkgver=0.20.3 +pkgrel=0 +pkgdesc="Fast, reliable, and secure dependency management for Node.js" +url="https://yarnpkg.com/" +arch="noarch" +license="BSD-2" +depends="nodejs" +source="https://yarnpkg.com/downloads/$pkgver/$pkgname-v$pkgver.tar.gz + add-apk-install-method.patch + remove-support-for-legacy-nodejs.patch" +builddir="$srcdir/dist" + +prepare() { + default_prepare || return 1 + + cd "$builddir" + + # These tests runs only on Ubuntu, so delete them. + rm -r end_to_end_tests + + # Remove support for legacy nodejs. + rm -r lib-legacy + + # Remove some unneeded files. + # Node does not load *.min.js files, so these are useless for us. + # We respect licenses, but really don't wanna waste disk space (~1 MiB) + # with dozens copies of the same files. + rm yarn.lock + find . \( -iname '*.md' \ + -o -iname '*.md~' \ + -o -iname '*.cmd' \ + -o -name '*.min.js' \ + -o -name '*.map' \ + -o -name 'bower.json' \ + -o -name 'Gruntfile.js' \ + -o -iname 'license*' -a ! -name '*.js' \ + -o -type f -a -name '.*' \) \ + -delete +} + +package() { + local destdir="usr/share/node_modules/$pkgname" + + mkdir -p "$pkgdir"/$destdir + cp -R "$builddir"/* "$pkgdir"/$destdir/ || return 1 + + mkdir -p "$pkgdir"/usr/bin + ln -s /$destdir/bin/yarn "$pkgdir"/usr/bin/yarn + ln -s /$destdir/bin/yarn "$pkgdir"/usr/bin/yarnpkg +} + +md5sums="9520b108ce17c2d3a0c8ce7e9b1e99ed yarn-v0.20.3.tar.gz +d05646de21975bc27b58067d0cf63a2f add-apk-install-method.patch +3f3440fa9a2f50df2ee083f5269e31e5 remove-support-for-legacy-nodejs.patch" +sha256sums="e7d052aba18716616213a602d66528eda7a2bdda7962fc23644ce53e74b1e1d5 yarn-v0.20.3.tar.gz +fab9750005b60229edd316b6e48a22b06ea46d41489df5a20fde093566a2592b add-apk-install-method.patch +084958810b3f7a81bf6c6a9d7edae563722f8006134d28e82494892a795680d9 remove-support-for-legacy-nodejs.patch" +sha512sums="a924ca7dc834a14be165a099337da07b4b18c7b3e29c60d7cad50632a95093ce0e7eb8b5373bd8f4192abee93ccdb1f64add9b5d6ef704d8c0413143183c00a8 yarn-v0.20.3.tar.gz +e43e0db54dbc60541c6c0dd82f0d401c2de437a728848b931314a783fab68bda976f4877ebf98395ab37bc0aea0e4743fcc2ab2ff4d8f7016def34edcd43322b add-apk-install-method.patch +d62bb07f1361039018ed0a3a3fbff5958c51430e21c356b265768eb494fc74c3c6977e4fdd4629d4914f9afd17864b4a13c8fcda9c92ba9c630badd2f9cea7ad remove-support-for-legacy-nodejs.patch" diff --git a/community/yarn/add-apk-install-method.patch b/community/yarn/add-apk-install-method.patch new file mode 100644 index 0000000000..9577804bb6 --- /dev/null +++ b/community/yarn/add-apk-install-method.patch @@ -0,0 +1,39 @@ +diff -urp dist/lib/cli/commands/install.js patched/lib/cli/commands/install.js +--- dist/lib/cli/commands/install.js 2017-02-01 00:36:23.000000000 +0000 ++++ patched/lib/cli/commands/install.js 2017-02-01 01:25:41.000000000 +0000 +@@ -226,6 +226,10 @@ function getUpdateCommand() { + return 'choco upgrade yarn'; + } + ++ if (YARN_INSTALL_METHOD === 'apk') { ++ return 'apk update && apk add -u yarn'; ++ } ++ + return null; + } + +diff -urp dist/lib-legacy/cli/commands/install.js patched/lib-legacy/cli/commands/install.js +--- dist/lib-legacy/cli/commands/install.js 2017-01-30 14:13:43.000000000 +0000 ++++ patched/lib-legacy/cli/commands/install.js 2017-02-01 01:32:32.000000000 +0000 +@@ -238,6 +238,10 @@ function getUpdateCommand() { + return 'choco upgrade yarn'; + } + ++ if (YARN_INSTALL_METHOD === 'apk') { ++ return 'apk update && apk add -u yarn'; ++ } ++ + return null; + } + +diff -urp dist/package.json patched/package.json +--- dist/package.json 2017-02-01 01:23:37.000000000 +0000 ++++ patched/package.json 2017-02-01 01:23:50.000000000 +0000 +@@ -1,6 +1,6 @@ + { + "name": "yarn", +- "installationMethod": "tar", ++ "installationMethod": "apk", + "version": "0.20.3", + "license": "BSD-2-Clause", + "preferGlobal": true, diff --git a/community/yarn/remove-support-for-legacy-nodejs.patch b/community/yarn/remove-support-for-legacy-nodejs.patch new file mode 100644 index 0000000000..dbb7d9d71d --- /dev/null +++ b/community/yarn/remove-support-for-legacy-nodejs.patch @@ -0,0 +1,23 @@ +diff -urp dist/bin/yarn.js patched/bin/yarn.js +--- dist/bin/yarn.js 2017-01-30 14:11:29.000000000 +0000 ++++ patched/bin/yarn.js 2017-02-01 02:41:32.000000000 +0000 +@@ -16,17 +16,14 @@ var _err; + if (semver.satisfies(ver, '>=5.0.0')) { + possibles.push('../updates/current/lib/cli/index.js'); + possibles.push('../lib/cli/index.js'); +-} else if (semver.satisfies(ver, '>=4.0.0')) { +- possibles.push('../updates/current/lib-legacy/cli/index.js'); +- possibles.push('../lib-legacy/cli/index.js'); + } else { +- console.log(require('chalk').red('Node version ' + ver + ' is not supported, please use Node.js 4.0 or higher.')); ++ console.log(require('chalk').red('Node version ' + ver + ' is not supported, please use Node.js 5.0 or higher.')); + process.exit(1); + } + + // ensure cache directory exists + var mkdirp = require('mkdirp'); +-var constants = require('../lib-legacy/constants'); ++var constants = require('../lib/constants'); + mkdirp.sync(constants.MODULE_CACHE_DIRECTORY); + + // init roadrunner diff --git a/testing/yarn/APKBUILD b/testing/yarn/APKBUILD deleted file mode 100644 index be22c1069d..0000000000 --- a/testing/yarn/APKBUILD +++ /dev/null @@ -1,62 +0,0 @@ -# Contributor: Ed Robinson -# Maintainer: Ed Robinson -pkgname=yarn -pkgver=0.20.3 -pkgrel=0 -pkgdesc="Fast, reliable, and secure dependency management for Node.js" -url="https://yarnpkg.com/" -arch="noarch" -license="BSD-2" -depends="nodejs" -source="https://yarnpkg.com/downloads/$pkgver/$pkgname-v$pkgver.tar.gz - add-apk-install-method.patch - remove-support-for-legacy-nodejs.patch" -builddir="$srcdir/dist" - -prepare() { - default_prepare || return 1 - - cd "$builddir" - - # These tests runs only on Ubuntu, so delete them. - rm -r end_to_end_tests - - # Remove support for legacy nodejs. - rm -r lib-legacy - - # Remove some unneeded files. - # Node does not load *.min.js files, so these are useless for us. - # We respect licenses, but really don't wanna waste disk space (~1 MiB) - # with dozens copies of the same files. - rm yarn.lock - find . \( -iname '*.md' \ - -o -iname '*.md~' \ - -o -iname '*.cmd' \ - -o -name '*.min.js' \ - -o -name '*.map' \ - -o -name 'bower.json' \ - -o -name 'Gruntfile.js' \ - -o -iname 'license*' -a ! -name '*.js' \ - -o -type f -a -name '.*' \) \ - -delete -} - -package() { - local destdir="usr/share/node_modules/$pkgname" - - mkdir -p "$pkgdir"/$destdir - cp -R "$builddir"/* "$pkgdir"/$destdir/ || return 1 - - mkdir -p "$pkgdir"/usr/bin - ln -s /$destdir/bin/yarn "$pkgdir"/usr/bin/yarn - ln -s /$destdir/bin/yarn "$pkgdir"/usr/bin/yarnpkg -} -md5sums="9520b108ce17c2d3a0c8ce7e9b1e99ed yarn-v0.20.3.tar.gz -d05646de21975bc27b58067d0cf63a2f add-apk-install-method.patch -3f3440fa9a2f50df2ee083f5269e31e5 remove-support-for-legacy-nodejs.patch" -sha256sums="e7d052aba18716616213a602d66528eda7a2bdda7962fc23644ce53e74b1e1d5 yarn-v0.20.3.tar.gz -fab9750005b60229edd316b6e48a22b06ea46d41489df5a20fde093566a2592b add-apk-install-method.patch -084958810b3f7a81bf6c6a9d7edae563722f8006134d28e82494892a795680d9 remove-support-for-legacy-nodejs.patch" -sha512sums="a924ca7dc834a14be165a099337da07b4b18c7b3e29c60d7cad50632a95093ce0e7eb8b5373bd8f4192abee93ccdb1f64add9b5d6ef704d8c0413143183c00a8 yarn-v0.20.3.tar.gz -e43e0db54dbc60541c6c0dd82f0d401c2de437a728848b931314a783fab68bda976f4877ebf98395ab37bc0aea0e4743fcc2ab2ff4d8f7016def34edcd43322b add-apk-install-method.patch -d62bb07f1361039018ed0a3a3fbff5958c51430e21c356b265768eb494fc74c3c6977e4fdd4629d4914f9afd17864b4a13c8fcda9c92ba9c630badd2f9cea7ad remove-support-for-legacy-nodejs.patch" diff --git a/testing/yarn/add-apk-install-method.patch b/testing/yarn/add-apk-install-method.patch deleted file mode 100644 index 9577804bb6..0000000000 --- a/testing/yarn/add-apk-install-method.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff -urp dist/lib/cli/commands/install.js patched/lib/cli/commands/install.js ---- dist/lib/cli/commands/install.js 2017-02-01 00:36:23.000000000 +0000 -+++ patched/lib/cli/commands/install.js 2017-02-01 01:25:41.000000000 +0000 -@@ -226,6 +226,10 @@ function getUpdateCommand() { - return 'choco upgrade yarn'; - } - -+ if (YARN_INSTALL_METHOD === 'apk') { -+ return 'apk update && apk add -u yarn'; -+ } -+ - return null; - } - -diff -urp dist/lib-legacy/cli/commands/install.js patched/lib-legacy/cli/commands/install.js ---- dist/lib-legacy/cli/commands/install.js 2017-01-30 14:13:43.000000000 +0000 -+++ patched/lib-legacy/cli/commands/install.js 2017-02-01 01:32:32.000000000 +0000 -@@ -238,6 +238,10 @@ function getUpdateCommand() { - return 'choco upgrade yarn'; - } - -+ if (YARN_INSTALL_METHOD === 'apk') { -+ return 'apk update && apk add -u yarn'; -+ } -+ - return null; - } - -diff -urp dist/package.json patched/package.json ---- dist/package.json 2017-02-01 01:23:37.000000000 +0000 -+++ patched/package.json 2017-02-01 01:23:50.000000000 +0000 -@@ -1,6 +1,6 @@ - { - "name": "yarn", -- "installationMethod": "tar", -+ "installationMethod": "apk", - "version": "0.20.3", - "license": "BSD-2-Clause", - "preferGlobal": true, diff --git a/testing/yarn/remove-support-for-legacy-nodejs.patch b/testing/yarn/remove-support-for-legacy-nodejs.patch deleted file mode 100644 index dbb7d9d71d..0000000000 --- a/testing/yarn/remove-support-for-legacy-nodejs.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -urp dist/bin/yarn.js patched/bin/yarn.js ---- dist/bin/yarn.js 2017-01-30 14:11:29.000000000 +0000 -+++ patched/bin/yarn.js 2017-02-01 02:41:32.000000000 +0000 -@@ -16,17 +16,14 @@ var _err; - if (semver.satisfies(ver, '>=5.0.0')) { - possibles.push('../updates/current/lib/cli/index.js'); - possibles.push('../lib/cli/index.js'); --} else if (semver.satisfies(ver, '>=4.0.0')) { -- possibles.push('../updates/current/lib-legacy/cli/index.js'); -- possibles.push('../lib-legacy/cli/index.js'); - } else { -- console.log(require('chalk').red('Node version ' + ver + ' is not supported, please use Node.js 4.0 or higher.')); -+ console.log(require('chalk').red('Node version ' + ver + ' is not supported, please use Node.js 5.0 or higher.')); - process.exit(1); - } - - // ensure cache directory exists - var mkdirp = require('mkdirp'); --var constants = require('../lib-legacy/constants'); -+var constants = require('../lib/constants'); - mkdirp.sync(constants.MODULE_CACHE_DIRECTORY); - - // init roadrunner -- cgit v1.2.3