[arch-commits] Commit in apm/trunk (3 files)

Felix Yan felixonmars at archlinux.org
Sat Aug 24 04:39:21 UTC 2019


    Date: Saturday, August 24, 2019 @ 04:39:20
  Author: felixonmars
Revision: 501439

upgpkg: apm 2.4.2-2

rebuild with nodejs 12

Added:
  apm/trunk/0001-git-utils-nodejs-12-update.patch
  apm/trunk/apm-nodejs-12-update.patch
Modified:
  apm/trunk/PKGBUILD

---------------------------------------+
 0001-git-utils-nodejs-12-update.patch |  273 ++++++++++++++++++++++++++++++++
 PKGBUILD                              |   28 ++-
 apm-nodejs-12-update.patch            |   28 +++
 3 files changed, 324 insertions(+), 5 deletions(-)

Added: 0001-git-utils-nodejs-12-update.patch
===================================================================
--- 0001-git-utils-nodejs-12-update.patch	                        (rev 0)
+++ 0001-git-utils-nodejs-12-update.patch	2019-08-24 04:39:20 UTC (rev 501439)
@@ -0,0 +1,273 @@
+From aea3de850594dba287083b6906312ff86ebf4867 Mon Sep 17 00:00:00 2001
+From: "Xl.W" <shawlix+git at gmail.com>
+Date: Thu, 22 Aug 2019 13:40:59 +0800
+Subject: [PATCH] git-utils: nodejs 12 update
+
+---
+ binding.gyp       |  1 +
+ package-lock.json |  2 +-
+ package.json      |  4 ++--
+ src/repository.cc | 56 +++++++++++++++++++++++------------------------
+ 4 files changed, 32 insertions(+), 31 deletions(-)
+
+diff --git a/binding.gyp b/binding.gyp
+index 71fafac..3bb9c0e 100644
+--- 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/package-lock.json b/package-lock.json
+index c4ff155..9ca5d82 100644
+--- a/package-lock.json
++++ b/package-lock.json
+@@ -1595,7 +1595,7 @@
+       "integrity": "sha1-uDx1fIAOaOHW78GjoaE/85/23NI=",
+       "dev": true,
+       "requires": {
+-        "jasmine-node": "jasmine-node at git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef",
++        "jasmine-node": "git+https://github.com/kevinsawicki/jasmine-node.git#81af4f953a2b7dfb5bde8331c05362a4b464c5ef",
+         "underscore-plus": "1.x",
+         "walkdir": "0.0.7"
+       },
+diff --git a/package.json b/package.json
+index 93ea078..ec43547 100644
+--- a/package.json
++++ b/package.json
+@@ -36,8 +36,8 @@
+     "wrench": "~1.4.4"
+   },
+   "dependencies": {
+-    "nan": "^2.0.0",
+-    "fs-plus": "^3.0.0"
++    "fs-plus": "^3.0.0",
++    "nan": "^2.14.0"
+   },
+   "scripts": {
+     "prepublish": "standard src spec",
+diff --git a/src/repository.cc b/src/repository.cc
+index 103e2ba..4f9b423 100644
+--- a/src/repository.cc
++++ b/src/repository.cc
+@@ -64,7 +64,7 @@ void Repository::Init(Local<Object> target) {
+   Nan::SetMethod(proto, "add", Repository::Add);
+ 
+   target->Set(Nan::New<String>("Repository").ToLocalChecked(),
+-                                newTemplate->GetFunction());
++                                Nan::GetFunction(newTemplate).ToLocalChecked());
+ }
+ 
+ NODE_MODULE(git, Repository::Init)
+@@ -87,13 +87,13 @@ git_repository* Repository::GetAsyncRepository(Nan::NAN_METHOD_ARGS_TYPE args) {
+ 
+ int Repository::GetBlob(Nan::NAN_METHOD_ARGS_TYPE args,
+                         git_repository* repo, git_blob*& blob) {
+-  std::string path(*String::Utf8Value(args[0]));
++  std::string path(*Nan::Utf8String(args[0]));
+ 
+   int useIndex = false;
+   if (args.Length() >= 3) {
+     Local<Object> optionsArg(Local<Object>::Cast(args[2]));
+-    if (optionsArg->Get(
+-        Nan::New<String>("useIndex").ToLocalChecked())->BooleanValue())
++    if (Nan::To<bool>(optionsArg->Get(
++        Nan::New<String>("useIndex").ToLocalChecked())).FromJust())
+       useIndex = true;
+   }
+ 
+@@ -266,7 +266,7 @@ NAN_METHOD(Repository::IsIgnored) {
+     return info.GetReturnValue().Set(Nan::New<Boolean>(false));
+ 
+   git_repository* repository = GetRepository(info);
+-  std::string path(*String::Utf8Value(info[0]));
++  std::string path(*Nan::Utf8String(info[0]));
+   int ignored;
+   if (git_ignore_path_is_ignored(&ignored,
+                                  repository,
+@@ -284,7 +284,7 @@ NAN_METHOD(Repository::IsSubmodule) {
+   git_index* index;
+   git_repository* repository = GetRepository(info);
+   if (git_repository_index(&index, repository) == GIT_OK) {
+-    std::string path(*String::Utf8Value(info[0]));
++    std::string path(*Nan::Utf8String(info[0]));
+     const git_index_entry* entry = git_index_get_bypath(index, path.c_str(), 0);
+     Local<Boolean> isSubmodule = Nan::New<Boolean>(
+         entry != NULL && (entry->mode & S_IFMT) == GIT_FILEMODE_COMMIT);
+@@ -305,7 +305,7 @@ NAN_METHOD(Repository::GetConfigValue) {
+   if (git_repository_config_snapshot(&config, repository) != GIT_OK)
+     return info.GetReturnValue().Set(Nan::Null());
+ 
+-  std::string configKey(*String::Utf8Value(info[0]));
++  std::string configKey(*Nan::Utf8String(info[0]));
+   const char* configValue;
+   if (git_config_get_string(
+         &configValue, config, configKey.c_str()) == GIT_OK) {
+@@ -328,8 +328,8 @@ NAN_METHOD(Repository::SetConfigValue) {
+   if (git_repository_config(&config, repository) != GIT_OK)
+     return info.GetReturnValue().Set(Nan::New<Boolean>(false));
+ 
+-  std::string configKey(*String::Utf8Value(info[0]));
+-  std::string configValue(*String::Utf8Value(info[1]));
++  std::string configKey(*Nan::Utf8String(info[0]));
++  std::string configValue(*Nan::Utf8String(info[1]));
+ 
+   int errorCode = git_config_set_string(
+       config, configKey.c_str(), configValue.c_str());
+@@ -386,8 +386,8 @@ class StatusWorker {
+       paths = reinterpret_cast<char **>(malloc(path_count * sizeof(char *)));
+       for (unsigned i = 0; i < path_count; i++) {
+         auto js_path = Local<String>::Cast(js_paths->Get(i));
+-        paths[i] = reinterpret_cast<char *>(malloc(js_path->Utf8Length() + 1));
+-        js_path->WriteUtf8(paths[i]);
++        paths[i] = reinterpret_cast<char *>(malloc(Nan::Utf8String(js_path).length() + 1));
++        js_path->WriteUtf8(v8::Isolate::GetCurrent(), paths[i]);
+       }
+     } else {
+       paths = NULL;
+@@ -434,7 +434,7 @@ NAN_METHOD(Repository::GetStatus) {
+ 
+ NAN_METHOD(Repository::GetStatusForPath) {
+   git_repository* repository = GetRepository(info);
+-  String::Utf8Value path(info[0]);
++  Nan::Utf8String path(info[0]);
+   unsigned int status = 0;
+   if (git_status_file(&status, repository, *path) == GIT_OK)
+     return info.GetReturnValue().Set(Nan::New<Number>(status));
+@@ -447,7 +447,7 @@ NAN_METHOD(Repository::CheckoutHead) {
+   if (info.Length() < 1)
+     return info.GetReturnValue().Set(Nan::New<Boolean>(false));
+ 
+-  String::Utf8Value utf8Path(info[0]);
++  Nan::Utf8String utf8Path(info[0]);
+   char* path = *utf8Path;
+ 
+   git_checkout_options options = GIT_CHECKOUT_OPTIONS_INIT;
+@@ -467,7 +467,7 @@ NAN_METHOD(Repository::GetReferenceTarget) {
+   if (info.Length() < 1)
+     return info.GetReturnValue().Set(Nan::Null());
+ 
+-  std::string refName(*String::Utf8Value(info[0]));
++  std::string refName(*Nan::Utf8String(info[0]));
+   git_oid sha;
+   if (git_reference_name_to_id(
+         &sha, GetRepository(info), refName.c_str()) == GIT_OK) {
+@@ -512,7 +512,7 @@ NAN_METHOD(Repository::GetDiffStats) {
+   if (treeStatus != GIT_OK)
+     return info.GetReturnValue().Set(result);
+ 
+-  String::Utf8Value utf8Path(info[0]);
++  Nan::Utf8String utf8Path(info[0]);
+   char* path = *utf8Path;
+ 
+   git_diff_options options = CreateDefaultGitDiffOptions();
+@@ -573,7 +573,7 @@ NAN_METHOD(Repository::GetHeadBlob) {
+   if (info.Length() < 1)
+     return info.GetReturnValue().Set(Nan::Null());
+ 
+-  std::string path(*String::Utf8Value(info[0]));
++  std::string path(*Nan::Utf8String(info[0]));
+ 
+   git_repository* repo = GetRepository(info);
+   git_reference* head;
+@@ -619,7 +619,7 @@ NAN_METHOD(Repository::GetIndexBlob) {
+   if (info.Length() < 1)
+     return info.GetReturnValue().Set(Nan::Null());
+ 
+-  std::string path(*String::Utf8Value(info[0]));
++  std::string path(*Nan::Utf8String(info[0]));
+ 
+   git_repository* repo = GetRepository(info);
+   git_index* index;
+@@ -713,8 +713,8 @@ class CompareCommitsWorker {
+ 
+   CompareCommitsWorker(git_repository *repository, Local<Value> js_left_id,
+                        Local<Value> js_right_id) : repository(repository) {
+-    left_id = *String::Utf8Value(js_left_id);
+-    right_id = *String::Utf8Value(js_right_id);
++    left_id = *Nan::Utf8String(js_left_id);
++    right_id = *Nan::Utf8String(js_right_id);
+   }
+ };
+ 
+@@ -772,7 +772,7 @@ NAN_METHOD(Repository::GetLineDiffs) {
+   if (info.Length() < 2)
+     return info.GetReturnValue().Set(Nan::Null());
+ 
+-  std::string text(*String::Utf8Value(info[1]));
++  std::string text(*Nan::Utf8String(info[1]));
+ 
+   git_repository* repo = GetRepository(info);
+ 
+@@ -793,7 +793,7 @@ NAN_METHOD(Repository::GetLineDiffs) {
+     ignoreEolWhitespace = optionsArg->Get(
+         Nan::New<String>("ignoreEolWhitespace").ToLocalChecked());
+ 
+-    if (ignoreEolWhitespace->BooleanValue())
++    if (Nan::To<bool>(ignoreEolWhitespace).FromJust())
+       options.flags = GIT_DIFF_IGNORE_WHITESPACE_EOL;
+   }
+ 
+@@ -845,7 +845,7 @@ NAN_METHOD(Repository::GetLineDiffDetails) {
+   if (info.Length() < 2)
+     return info.GetReturnValue().Set(Nan::Null());
+ 
+-  std::string text(*String::Utf8Value(info[1]));
++  std::string text(*Nan::Utf8String(info[1]));
+ 
+   git_repository* repo = GetRepository(info);
+ 
+@@ -866,7 +866,7 @@ NAN_METHOD(Repository::GetLineDiffDetails) {
+     ignoreEolWhitespace = optionsArg->Get(
+         Nan::New<String>("ignoreEolWhitespace").ToLocalChecked());
+ 
+-    if (ignoreEolWhitespace->BooleanValue())
++    if (Nan::To<bool>(ignoreEolWhitespace).FromJust())
+       options.flags = GIT_DIFF_IGNORE_WHITESPACE_EOL;
+   }
+ 
+@@ -971,12 +971,12 @@ NAN_METHOD(Repository::CheckoutReference) {
+     return info.GetReturnValue().Set(Nan::New<Boolean>(false));
+ 
+   bool shouldCreateNewRef;
+-  if (info.Length() > 1 && info[1]->BooleanValue())
++  if (info.Length() > 1 && Nan::To<bool>(info[1]).FromJust())
+     shouldCreateNewRef = true;
+   else
+     shouldCreateNewRef = false;
+ 
+-  std::string strRefName(*String::Utf8Value(info[0]));
++  std::string strRefName(*Nan::Utf8String(info[0]));
+   const char* refName = strRefName.c_str();
+ 
+   git_repository* repo = GetRepository(info);
+@@ -1021,7 +1021,7 @@ NAN_METHOD(Repository::Add) {
+   Nan::HandleScope scope;
+ 
+   git_repository* repository = GetRepository(info);
+-  std::string path(*String::Utf8Value(info[0]));
++  std::string path(*Nan::Utf8String(info[0]));
+ 
+   git_index* index;
+   if (git_repository_index(&index, repository) != GIT_OK) {
+@@ -1057,11 +1057,11 @@ Repository::Repository(Local<String> path, Local<Boolean> search) {
+   Nan::HandleScope scope;
+ 
+   int flags = 0;
+-  if (!search->BooleanValue()) {
++  if (!Nan::To<bool>(search).FromJust()) {
+     flags |= GIT_REPOSITORY_OPEN_NO_SEARCH;
+   }
+ 
+-  String::Utf8Value repository_path(path);
++  Nan::Utf8String repository_path(path);
+   int result = git_repository_open_ext(&repository, *repository_path, flags, NULL);
+   if (result != GIT_OK) {
+     repository = NULL;
+-- 
+2.23.0
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-08-24 03:47:14 UTC (rev 501438)
+++ PKGBUILD	2019-08-24 04:39:20 UTC (rev 501439)
@@ -2,7 +2,7 @@
 
 pkgname=apm
 pkgver=2.4.2
-pkgrel=1
+pkgrel=2
 pkgdesc='Atom package manager'
 arch=('x86_64')
 url='https://github.com/atom/apm'
@@ -13,16 +13,23 @@
 conflicts=('nodejs-atom-package-manager')
 replaces=('nodejs-atom-package-manager')
 options=(!emptydirs)
+_gitutils_tag=5.6.1
 source=("${pkgname}-${pkgver}.tar.gz::https://github.com/atom/apm/archive/v${pkgver}.tar.gz"
+        "git+https://github.com/atom/git-utils#tag=v${_gitutils_tag}"
         'apm.js'
         'no-scripts.patch'
         'python2.patch'
-        'use-system-npm.patch')
+        'use-system-npm.patch'
+        '0001-git-utils-nodejs-12-update.patch'
+        'apm-nodejs-12-update.patch')
 sha256sums=('e04f3cab612a0682a49cd14b489ab83905ce1e9e4959c044c0597252be088963'
+            'SKIP'
             'acbe133eb67d603e815605b1f3d9056a03bfc4a22a7e9db081126b289b385f77'
             '897a82cd23ed5a4f226635dabe56ad28e533cb0949593e2b771ad7928c058bcb'
             '621ae29f99c3fbc410a9a7dc143dd9c912ee94eaa48110ad32c40647f635e792'
-            'cf17bd31f70079fe2a17958712c1a515ce83623dd3f97557a3f01d346da09f19')
+            'cf17bd31f70079fe2a17958712c1a515ce83623dd3f97557a3f01d346da09f19'
+            '06d3404160990aaaa7b1b18f50d566f4c98a0456ffeee57d583c5bc36f26755d'
+            '53c59f698809598b1afcf0c0a77bfeaa3dc113a73852af0def95b284162ee2fc')
 
 _apmdir='/usr/lib/node_modules/atom-package-manager'
 
@@ -29,8 +36,14 @@
 prepare() {
   rm -rf "${srcdir}"/apm-build
 
-  cd apm-${pkgver}
+  cd "${srcdir}"/git-utils
+  git submodule update --init --recursive
+  git apply ../0001-git-utils-nodejs-12-update.patch
+  npm install standard
+  npm pack
 
+  cd "${srcdir}"/apm-${pkgver}
+
   # Use custom launcher
   rm bin/apm{,.cmd} bin/npm{,.cmd}
   rm src/cli.coffee
@@ -45,6 +58,9 @@
 
   # GYP needs Python2
   patch -Np1 -i "${srcdir}"/python2.patch
+
+  # patch apm to support nodejs 12
+  patch -Np1 -i "${srcdir}"/apm-nodejs-12-update.patch
 }
 
 build() {
@@ -80,7 +96,9 @@
       -or -name "*.bat" -exec rm '{}' \; \
       -or -name "*.mk" -exec rm '{}' \; \
       -or -path "*/git-utils/binding.gyp" -exec rm '{}' \; \
-      -or -path "*/git-utils/src" -prune -exec rm -r '{}' \; \
+      -or -path "*/git-utils/*.tgz" -prune -exec rm -r '{}' \; \
+      -or -path "*/git-utils/src/*.cc" -prune -exec rm -r '{}' \; \
+      -or -path "*/git-utils/src/*.h" -prune -exec rm -r '{}' \; \
       -or -path "*/keytar/binding.gyp" -exec rm '{}' \; \
       -or -path "*/keytar/src" -prune -exec rm -r '{}' \; \
       -or -path "*/oniguruma/binding.gyp" -exec rm '{}' \; \

Added: apm-nodejs-12-update.patch
===================================================================
--- apm-nodejs-12-update.patch	                        (rev 0)
+++ apm-nodejs-12-update.patch	2019-08-24 04:39:20 UTC (rev 501439)
@@ -0,0 +1,28 @@
+diff --git a/package.json b/package.json
+index 1537e3f..dcec344 100644
+--- a/package.json
++++ b/package.json
+@@ -19,11 +19,11 @@
+     "asar-require": "0.3.0",
+     "async": "~0.2.8",
+     "colors": "~0.6.1",
+-    "first-mate": "6.2.0",
++    "first-mate": "7.4.0",
+     "fs-plus": "2.x",
+-    "git-utils": "^4.0",
++    "git-utils": "file:../../git-utils/git-utils-5.6.1.tgz",
+     "hosted-git-info": "^2.1.4",
+-    "keytar": "^4.0",
++    "keytar": "^4.13.0",
+     "mv": "2.0.0",
+     "ncp": "~0.5.1",
+     "open": "0.0.5",
+@@ -41,7 +41,7 @@
+     "yargs": "^3.23.0"
+   },
+   "devDependencies": {
+-    "coffee-script": "^1.8.0",
++    "coffee-script": "^1.12.7",
+     "express": "^4.16.3",
+     "grunt": "^1.0.3",
+     "grunt-cli": "^1.2.0",



More information about the arch-commits mailing list