Skip to content

Commit 7af7ad1

Browse files
committed
Delete symlinks stubs and download prebuild in just one step
1 parent f10fbbd commit 7af7ad1

File tree

3 files changed

+45
-67
lines changed

3 files changed

+45
-67
lines changed

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nodeos-cross-toolchain",
3-
"version": "1.0.0-RC2",
3+
"version": "1.0.0-RC2.1",
44
"description": "Cross-toolchain to build NodeOS based on Compressed Linux From Scratch Embedded",
55
"bin": {
66
"addr2line": "bin/addr2line",
@@ -29,8 +29,7 @@
2929
"scripts": {
3030
"BigRedButton": "scripts/BigRedButton",
3131
"build": "scripts/build",
32-
"install": "prebuild-install -d https://github.com/NodeOS/nodeos-cross-toolchain/releases/download/v{version}/{platform}-{arch}.tar.gz || npm run build",
33-
"postinstall": "scripts/postinstall",
32+
"install": "scripts/install",
3433
"prebuild": "scripts/prebuild",
3534
"prepublish": "scripts/prepublish",
3635
"test": "scripts/test",

scripts/install

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env bash
2+
3+
set -o pipefail
4+
5+
6+
DOWNLOAD=https://github.com/NodeOS/nodeos-cross-toolchain/releases/download/v{version}/{platform}-{arch}.tar.gz
7+
SYMLINKS=(addr2line ar as c++filt elfedit gprof ld ld.bfd nm objcopy objdump \
8+
ranlib readelf size strings strip c++ cpp g++ gcc gcov gcov-tool)
9+
10+
11+
#
12+
# Delete symlinks stubs
13+
#
14+
15+
rm -rf bin || exit 10
16+
17+
18+
#
19+
# Download or build cross-toolchain
20+
#
21+
22+
prebuild-install -d $DOWNLOAD || npm run build || exit 20
23+
24+
25+
# If host platform is not based on musl, don't create un-prefixed symlinks
26+
readlink /lib/ld-linux.so.2 | grep musl || exit 0
27+
28+
29+
#
30+
# Create symbolic links for native platform binaries
31+
#
32+
33+
PLATFORM=
34+
CPU=
35+
36+
source scripts/adjustEnvVars.sh || exit $?
37+
38+
mkdir -p bin || exit 20
39+
40+
for i in "${SYMLINKS[@]}"
41+
do
42+
ln -sf $TARGET-$i bin/$i || exit 21
43+
done

scripts/postinstall

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)