Skip to content
Snippets Groups Projects
Verified Commit 23cf36fd authored by Anna Wilcox's avatar Anna Wilcox :fox:
Browse files

user/node: new package

parent 6adbc526
No related branches found
No related tags found
No related merge requests found
# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=node
pkgver=10.15.3
pkgrel=0
pkgdesc="JavaScript runtime"
url="https://nodejs.org/"
arch="all"
license="MIT AND ICU AND BSD-3-Clause AND BSD-2-Clause AND ISC AND OpenSSL AND Public-Domain AND Zlib AND Artistic-2.0 AND Apache-2.0 AND CC0-1.0"
depends=""
makedepends="c-ares-dev http-parser-dev icu-dev libexecinfo-dev libuv-dev
nghttp2-dev python3 zlib-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://nodejs.org/download/release/v$pkgver/node-v$pkgver.tar.xz
https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tar.xz
ppc64.patch
stack-silliness.patch
"
builddir="$srcdir/$pkgname-v$pkgver"
unpack() {
default_unpack
[ -z $SKIP_PYTHON ] || return 0
msg "Killing all remaining hope for humanity and building Python 2..."
cd "$srcdir/Python-2.7.15"
[ -d ../python ] && rm -r ../python
# 19:39 <+solar> just make the firefox build process build its own py2 copy
# 20:03 <calvin> TheWilfox: there's always violence
./configure --prefix="$srcdir/python"
make -j $JOBS
make -j $JOBS install
}
build() {
cd "$builddir"
export PATH="$srcdir/python/bin:$PATH"
# We can't use --shared-openssl until 1.1 is available.
python ./configure.py \
--prefix=/usr \
--with-intl=system-icu \
--shared-cares \
--shared-http-parser \
--shared-libuv \
--shared-nghttp2 \
--openssl-no-asm \
--shared-zlib
make
}
check() {
cd "$builddir"
make test-only
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
}
sha512sums="cf741f733af7a7e1fbd37b0f98110078494b4771dbdfccacfda95a5ea4cda6cdcea4f8d31dddcf27477213614e4ab6cf7d1a1f900cb92936333730737ac4f9e8 node-v10.15.3.tar.xz
27ea43eb45fc68f3d2469d5f07636e10801dee11635a430ec8ec922ed790bb426b072da94df885e4dfa1ea8b7a24f2f56dd92f9b0f51e162330f161216bd6de6 Python-2.7.15.tar.xz
583326353de5b0ac14a6c42321f6b031bd943a80550624794e15bd7526470f67bfa14a66558db3c94b4ee2db3053d2e4efed2117f4e7b6dca3c59c171048c094 ppc64.patch
3ea09e36ed0cc31e0475ebc9c92b7609b70e9c1637c5db6c92cf1d6363fb8c6f884ffa20dd81054ca390b721695185327d80c9eeff0688a959e9d46947602471 stack-silliness.patch"
This diff is collapsed.
--- a/deps/v8/src/ppc/assembler-ppc.h.old 2019-03-05 15:16:29.000000000 +0000
+++ b/deps/v8/src/ppc/assembler-ppc.h 2019-04-02 07:05:25.977213735 +0000
@@ -48,7 +48,8 @@
#include "src/ppc/constants-ppc.h"
#if V8_HOST_ARCH_PPC && \
- (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && V8_TARGET_BIG_ENDIAN))
+ (V8_OS_AIX || (V8_TARGET_ARCH_PPC64 && \
+ (V8_TARGET_BIG_ENDIAN && (!defined(_CALL_ELF) || _CALL_ELF == 1))))
#define ABI_USES_FUNCTION_DESCRIPTORS 1
#else
#define ABI_USES_FUNCTION_DESCRIPTORS 0
@@ -60,13 +61,15 @@
#define ABI_PASSES_HANDLES_IN_REGS 0
#endif
-#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || V8_TARGET_LITTLE_ENDIAN
+#if !V8_HOST_ARCH_PPC || !V8_TARGET_ARCH_PPC64 || \
+ (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2))
#define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 1
#else
#define ABI_RETURNS_OBJECT_PAIRS_IN_REGS 0
#endif
-#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN)
+#if !V8_HOST_ARCH_PPC || (V8_TARGET_ARCH_PPC64 && \
+ (V8_TARGET_LITTLE_ENDIAN || (defined(_CALL_ELF) && _CALL_ELF == 2)))
#define ABI_CALL_VIA_IP 1
#else
#define ABI_CALL_VIA_IP 0
@@ -220,7 +220,8 @@
// The following constants describe the stack frame linkage area as
// defined by the ABI. Note that kNumRequiredStackFrameSlots must
// satisfy alignment requirements (rounding up if required).
-#if V8_TARGET_ARCH_PPC64 && V8_TARGET_LITTLE_ENDIAN
+#if V8_TARGET_ARCH_PPC64 && (V8_TARGET_LITTLE_ENDIAN || \
+ defined(_CALL_ELF) && _CALL_ELF == 2)
// [0] back chain
// [1] condition register save area
// [2] link register save area
--- node-v10.15.3/tools/configure.d/nodedownload.py (original)
+++ node-v10.15.3/tools/configure.d/nodedownload.py (refactored)
@@ -1,7 +1,10 @@
#!/usr/bin/env python
# Moved some utilities here from ../../configure
+try:
-import urllib
+ import urllib
+except ImportError:
+ import urllib.request, urllib.parse, urllib.error
import hashlib
import sys
import zipfile
@@ -18,10 +18,10 @@
spin = ".:|'"
return (spin[c % len(spin)])
-class ConfigOpener(urllib.FancyURLopener):
+class ConfigOpener(urllib.request.FancyURLopener):
"""fancy opener used by retrievefile. Set a UA"""
# append to existing version (UA)
- version = '%s node.js/configure' % urllib.URLopener.version
+ version = '%s node.js/configure' % urllib.request.URLopener.version
def reporthook(count, size, total):
"""internal hook used by retrievefile"""
@@ -36,10 +36,10 @@
sys.stdout.write(' <%s>\nConnecting...\r' % url)
sys.stdout.flush()
ConfigOpener().retrieve(url, targetfile, reporthook=reporthook)
- print '' # clear the line
+ print('') # clear the line
return targetfile
except:
- print ' ** Error occurred while downloading\n <%s>' % url
+ print(' ** Error occurred while downloading\n <%s>' % url)
raise
def md5sum(targetfile):
@@ -56,12 +56,12 @@
"""Unpacks packedfile into parent_path. Assumes .zip. Returns parent_path"""
if zipfile.is_zipfile(packedfile):
with contextlib.closing(zipfile.ZipFile(packedfile, 'r')) as icuzip:
- print ' Extracting zipfile: %s' % packedfile
+ print(' Extracting zipfile: %s' % packedfile)
icuzip.extractall(parent_path)
return parent_path
elif tarfile.is_tarfile(packedfile):
with contextlib.closing(tarfile.TarFile.open(packedfile, 'r')) as icuzip:
- print ' Extracting tarfile: %s' % packedfile
+ print(' Extracting tarfile: %s' % packedfile)
icuzip.extractall(parent_path)
return parent_path
else:
@@ -112,16 +112,16 @@
theRet[anOpt] = True
else:
# future proof: ignore unknown types
- print 'Warning: ignoring unknown --download= type "%s"' % anOpt
+ print('Warning: ignoring unknown --download= type "%s"' % anOpt)
# all done
return theRet
def candownload(auto_downloads, package):
- if not (package in auto_downloads.keys()):
+ if not (package in list(auto_downloads.keys())):
raise Exception('Internal error: "%s" is not in the --downloads list. Check nodedownload.py' % package)
if auto_downloads[package]:
return True
else:
- print """Warning: Not downloading package "%s". You could pass "--download=all"
- (Windows: "download-all") to try auto-downloading it.""" % package
+ print("""Warning: Not downloading package "%s". You could pass "--download=all"
+ (Windows: "download-all") to try auto-downloading it.""" % package)
return False
--- node-v10.15.3/tools/configure.d/nodedownload.py.old 2019-04-02 00:56:07.533200475 +0000
+++ node-v10.15.3/tools/configure.d/nodedownload.py 2019-04-02 00:58:09.019947842 +0000
@@ -6,12 +6,11 @@
import sys
import zipfile
import tarfile
-import fpformat
import contextlib
def formatSize(amt):
"""Format a size as a string in MB"""
- return fpformat.fix(amt / 1024000., 1)
+ return "%{size}.1f" % (amt / 1024000.)
def spin(c):
"""print out an ASCII 'spinner' based on the value of counter 'c'"""
--- node-v10.15.3/configure.py.old 2019-03-05 15:16:24.000000000 +0000
+++ node-v10.15.3/configure.py 2019-04-02 01:09:04.948394534 +0000
@@ -649,8 +649,8 @@
except OSError:
return (False, False, '', '')
- proc.stdin.write('__clang__ __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ '
- '__clang_major__ __clang_minor__ __clang_patchlevel__')
+ proc.stdin.write(b'__clang__ __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ '
+ b'__clang_major__ __clang_minor__ __clang_patchlevel__')
values = (proc.communicate()[0].split() + ['0'] * 7)[0:7]
is_clang = values[0] == '1'
@@ -727,7 +727,7 @@
consider adjusting the CC environment variable if you installed
it in a non-standard prefix.''')
- gas_ret = proc.communicate()[1]
+ gas_ret = proc.communicate()[1].decode('utf-8')
match = re.match(r"GNU assembler version ([2-9]\.[0-9]+)", gas_ret)
if match:
@@ -794,7 +794,7 @@
consider adjusting the CC environment variable if you installed
it in a non-standard prefix.''')
- p.stdin.write('\n')
+ p.stdin.write(b'\n')
out = p.communicate()[0]
out = str(out).split('\n')
@@ -1351,7 +1351,7 @@
o['variables']['icu_small'] = b(True)
locs = set(options.with_icu_locales.split(','))
locs.add('root') # must have root
- o['variables']['icu_locales'] = string.join(locs,',')
+ o['variables']['icu_locales'] = ','.join(locs)
# We will check a bit later if we can use the canned deps/icu-small
elif with_intl == 'full-icu':
# full ICU
@@ -1655,7 +1655,7 @@
if options.prefix:
config['PREFIX'] = options.prefix
-config = '\n'.join(map('='.join, config.iteritems())) + '\n'
+config = '\n'.join(map('='.join, config.items())) + '\n'
# On Windows there's no reason to search for a different python binary.
bin_override = None if sys.platform == 'win32' else make_bin_override()
--- node-v10.15.3/configure.py.old 2019-04-02 01:12:29.786049396 +0000
+++ node-v10.15.3/configure.py 2019-04-02 01:21:08.499637208 +0000
@@ -634,7 +634,7 @@
proc = subprocess.Popen(
shlex.split(pkg_config) + ['--silence-errors', flag, pkg],
stdout=subprocess.PIPE)
- val = proc.communicate()[0].strip()
+ val = proc.communicate()[0].strip().decode('utf-8')
except OSError as e:
if e.errno != errno.ENOENT: raise e # Unexpected error.
return (None, None, None, None) # No pkg-config/pkgconf installed.
--- node-v10.15.3/configure.py.old 2019-04-02 01:27:36.437454388 +0000
+++ node-v10.15.3/configure.py 2019-04-02 01:28:06.954136125 +0000
@@ -795,7 +795,7 @@
it in a non-standard prefix.''')
p.stdin.write(b'\n')
- out = p.communicate()[0]
+ out = p.communicate()[0].decode('utf-8')
out = str(out).split('\n')
--- node-v10.15.3/src/inspector_agent.cc.old 2019-03-05 15:16:32.000000000 +0000
+++ node-v10.15.3/src/inspector_agent.cc 2019-04-06 02:03:11.082016553 +0000
@@ -104,9 +104,9 @@
// Don't shrink the thread's stack on FreeBSD. Said platform decided to
// follow the pthreads specification to the letter rather than in spirit:
// https://lists.freebsd.org/pipermail/freebsd-current/2014-March/048885.html
-#ifndef __FreeBSD__
+#ifdef __GLIBC__
CHECK_EQ(0, pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN));
-#endif // __FreeBSD__
+#endif // __GLIBC__
CHECK_EQ(0, pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED));
sigset_t sigmask;
// Mask all signals.
--- node-v10.15.3/deps/v8/tools/node/fetch_deps.py.old 2019-03-05 15:16:31.000000000 +0000
+++ node-v10.15.3/deps/v8/tools/node/fetch_deps.py 2019-04-02 01:01:00.421250178 +0000
@@ -9,6 +9,9 @@
Usage: fetch_deps.py <v8-path>
"""
+# for py2/py3 compatibility
+from __future__ import print_function
+
import os
import subprocess
import sys
@@ -51,9 +55,9 @@
expected_git_dir = os.path.join(v8_path, ".git")
actual_git_dir = git("rev-parse --absolute-git-dir")
if expected_git_dir == actual_git_dir:
- print "V8 is tracked stand-alone by git."
+ print("V8 is tracked stand-alone by git.")
return False
- print "Initializing temporary git repository in v8."
+ print("Initializing temporary git repository in v8.")
git("init")
git("config user.name \"Ada Lovelace\"")
git("config user.email ada@lovela.ce")
@@ -70,7 +74,7 @@
temporary_git = EnsureGit(v8_path)
try:
- print "Fetching dependencies."
+ print("Fetching dependencies.")
env = os.environ.copy()
# gclient needs to have depot_tools in the PATH.
env["PATH"] = depot_tools + os.pathsep + env["PATH"]
--- node-v10.15.3/deps/v8/tools/node/node_common.py.old 2019-03-05 15:16:31.000000000 +0000
+++ node-v10.15.3/deps/v8/tools/node/node_common.py 2019-04-02 01:00:45.522875398 +0000
@@ -3,11 +3,15 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+# for py2/py3 compatibility
+from __future__ import print_function
+
import os
import pipes
import shutil
import stat
import subprocess
+import sys
DEPOT_TOOLS_URL = \
"https://chromium.googlesource.com/chromium/tools/depot_tools.git"
@@ -22,23 +26,27 @@
except:
pass
if fetch_if_not_exist:
- print "Checking out depot_tools."
+ print("Checking out depot_tools.")
# shell=True needed on Windows to resolve git.bat.
subprocess.check_call("git clone {} {}".format(
pipes.quote(DEPOT_TOOLS_URL),
pipes.quote(depot_tools)), shell=True)
+ # Using check_output to hide warning messages.
+ subprocess.check_output(
+ [sys.executable, gclient_path, "metrics", "--opt-out"],
+ cwd=depot_tools)
return depot_tools
return None
depot_tools = _Get(v8_path)
assert depot_tools is not None
- print "Using depot tools in %s" % depot_tools
+ print("Using depot tools in %s" % depot_tools)
return depot_tools
def UninitGit(v8_path):
- print "Uninitializing temporary git repository"
+ print("Uninitializing temporary git repository")
target = os.path.join(v8_path, ".git")
if os.path.isdir(target):
- print ">> Cleaning up %s" % target
+ print(">> Cleaning up %s" % target)
def OnRmError(func, path, exec_info):
# This might happen on Windows
os.chmod(path, stat.S_IWRITE)
--- node-v10.15.3/deps/v8/tools/node/update_node.py.old 2019-03-05 15:16:31.000000000 +0000
+++ node-v10.15.3/deps/v8/tools/node/update_node.py 2019-04-02 01:00:27.184875836 +0000
@@ -23,6 +23,9 @@
--with-patch Also include currently staged files in the V8 checkout.
"""
+# for py2/py3 compatibility
+from __future__ import print_function
+
import argparse
import os
import shutil
@@ -61,9 +64,9 @@
# Node.js owns deps/v8/gypfiles in their downstream repository.
FILES_TO_KEEP = [ "gypfiles" ]
def RunGclient(path):
assert os.path.isdir(path)
- print ">> Running gclient sync"
+ print(">> Running gclient sync")
subprocess.check_call(["gclient", "sync", "--nohooks"], cwd=path)
def CommitPatch(options):
@@ -74,7 +77,7 @@
the fake git clone fetch it into node.js. We can leave the commit, as
bot_update will ensure a clean state on each run.
"""
- print ">> Committing patch"
+ print(">> Committing patch")
subprocess.check_call(
["git", "-c", "user.name=fake", "-c", "user.email=fake@chromium.org",
"commit", "--allow-empty", "-m", "placeholder-commit"],
@@ -84,8 +87,8 @@
def UpdateTarget(repository, options, files_to_keep):
source = os.path.join(options.v8_path, *repository)
target = os.path.join(options.node_path, TARGET_SUBDIR, *repository)
- print ">> Updating target directory %s" % target
- print ">> from active branch at %s" % source
+ print(">> Updating target directory %s" % target)
+ print(">> from active branch at %s" % source)
if not os.path.exists(target):
os.makedirs(target)
# Remove possible remnants of previous incomplete runs.
@@ -98,10 +101,11 @@
git_args.append(["add"] + files_to_keep) # add and commit
git_args.append(["commit", "-m", "keep files"]) # files we want to keep
+ git_args.append(["clean", "-fxd"]) # nuke everything else
git_args.append(["remote", "add", "source", source]) # point to source repo
git_args.append(["fetch", "source", "HEAD"]) # sync to current branch
git_args.append(["checkout", "-f", "FETCH_HEAD"]) # switch to that branch
- git_args.append(["clean", "-fd"]) # delete removed files
+ git_args.append(["clean", "-fxd"]) # delete removed files
if files_to_keep:
git_args.append(["cherry-pick", "master"]) # restore kept files
@@ -117,17 +120,17 @@
def UpdateGitIgnore(options):
file_name = os.path.join(options.node_path, TARGET_SUBDIR, ".gitignore")
assert os.path.isfile(file_name)
- print ">> Updating .gitignore with lines"
+ print(">> Updating .gitignore with lines")
with open(file_name) as gitignore:
content = gitignore.readlines()
content = [x.strip() for x in content]
for x in DELETE_FROM_GITIGNORE:
if x in content:
- print "- %s" % x
+ print("- %s" % x)
content.remove(x)
for x in ADD_TO_GITIGNORE:
if x not in content:
- print "+ %s" % x
+ print("+ %s" % x)
content.append(x)
content.sort(key=lambda x: x[1:] if x.startswith("!") else x)
with open(file_name, "w") as gitignore:
@@ -135,7 +138,7 @@
gitignore.write("%s\n" % x)
def CreateCommit(options):
- print ">> Creating commit."
+ print(">> Creating commit.")
# Find git hash from source.
githash = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"],
cwd=options.v8_path).strip()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment