Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 963d7f4

Browse files
committed
Use buildDependencies module and prebuild packages
1 parent 33486dd commit 963d7f4

File tree

4 files changed

+37
-8
lines changed

4 files changed

+37
-8
lines changed

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ node_modules/
22
build/
33
out/
44
npm-debug.log
5+
prebuilds/

‎package.json

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
"version": "1.0.0-RC3.0",
44
"description": "Generate a NodeOS initramfs",
55
"scripts": {
6-
"docker": "docker run",
7-
"dockerBuild": "docker build -t initramfs .",
86
"build": "scripts/build",
7+
"install": "prebuild-install || (buildDependencies && npm run build)",
98
"start": "scripts/start",
109
"postinstall": "scripts/postinstall",
1110
"prepublish": "scripts/prepublish",
@@ -15,18 +14,30 @@
1514
"author": "Jesús Leganés Combarro 'piranna' <piranna@gmail.com>",
1615
"license": "MIT",
1716
"dependencies": {
17+
"builddependencies": "0.0.1",
18+
"prebuild-install": "^2.1.0"
19+
},
20+
"buildDependencies": [
21+
"exclfs",
22+
"jocker",
23+
"libfuse",
24+
"nodeos-boot-multiUser",
25+
"nodeos-cross-toolchain",
26+
"nodeos-nodejs",
27+
"usrbinenv"
28+
],
29+
"devDependencies": {
1830
"exclfs": "piranna/exclfs",
1931
"jocker": "^0.0.0",
2032
"libfuse": "^2.9.8-3",
33+
"nodeos-barebones": "NodeOS/nodeos-barebones",
2134
"nodeos-boot-multiUser": "^0.4.2",
2235
"nodeos-cross-toolchain": "^1.0.0-RC3.0",
23-
"usrbinenv": "^0.1.0"
24-
},
25-
"devDependencies": {
26-
"nodeos-barebones": "^1.0.0-RC3.0",
2736
"nodeos-nodejs": "^6.9.4",
37+
"prebuild": "^6.0.0",
2838
"qemu": "^2.8.0",
29-
"suppose": "^0.6.1"
39+
"suppose": "^0.6.1",
40+
"usrbinenv": "^0.1.0"
3041
},
3142
"nodeosDependencies": [
3243
"jocker",

‎scripts/build

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ PATH=$TOOLCHAIN/bin:$PATH
3030
# Define steps paths
3131
#
3232

33+
NODE_PLATFORM=linux
34+
3335
OUT_DIR=`pwd`/out/$CPU
36+
PREBUILD=prebuilds/$NODE_PLATFORM-$NODE_ARCH.tar.gz
3437

3538

3639
#
@@ -98,6 +101,8 @@ chmod -R o+r "$OBJECTS/lib/node_modules/usrbinenv" &&
98101
chmod -R o+r "$OBJECTS/usr/bin/env" || exit 30
99102

100103
if [[ ! -f $STEP_DIR ]]; then
104+
rmStep $PREBUILD
105+
101106
mkdir -p `dirname $STEP_DIR`
102107

103108
(
@@ -110,3 +115,15 @@ ln -sf $CPU out/latest || err 41
110115

111116

112117
echo -e "${GRN}Successfully built 'initramfs'${CLR}"
118+
119+
120+
#
121+
# Pack Node.js in a node-gyp compatible way
122+
#
123+
124+
# TODO use Node.js arch instead of explicit CPUs and move to BigRedButton
125+
126+
STEP_DIR=$PREBUILD
127+
128+
mkdir -p `dirname $STEP_DIR` &&
129+
tar -cf - out/$CPU | gzip > $STEP_DIR || err 100

‎scripts/unbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ if [[ -d $OBJECTS ]]; then
66
chmod -R +w $OBJECTS
77
fi
88

9-
rm -rf build/ out/ || exit $?
9+
rm -rf build/ out/ prebuilds/ || exit $?

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /