Files: 2a1f7a7a5047c3b4d0032b7acff34d1699a85270 / binary-install-1.6.0.sh
4744 bytesRaw
1 | |
2 | blobs_base=${SSB_BLOBS_BASE:-http://localhost:8989/blobs/get/} |
3 | |
4 | system=$(uname -sm) || exit 1 |
5 | case "$system" in |
6 | Linux\ x86_64) set -- \ |
7 | '&hZbFmTg0iAA2A8oFsa9h0xnUaQcwha3Uc3L3UqXGRLQ=.sha256' \ |
8 | '&ZZ5WetGZ8XE+EDV1WpnFTnvC+bwwna7GJAh71moEZdo=.sha256' \ |
9 | '&9yI3nXRAnvHL8CHRjBekuNAX49Mr62x3ED5pJCeox8E=.sha256' \ |
10 | '&mvroGi396ddexK8P8rG7LB7Aa7tSy41HWOUKkcj/f70=.sha256';; |
11 | |
12 | Linux\ armv7l) set -- \ |
13 | '&6wUnJemNZL4shqMtY9WuAVvawLDd2FTJ41rRK8UHmnk=.sha256' \ |
14 | '&zCLxOnVldm15btsYdE+I4oBx8qBS1vik1Li2vBOq6+w=.sha256' \ |
15 | '&u7VGC7ZGAPmWVdOK4TrPUy8aZJdEEIdEhZCKiZr+sww=.sha256';; |
16 | |
17 | Linux\ aarch64) set -- \ |
18 | '&YipJtv476bRmvbTinajIqj9s61h7/ltqwYpANup3Kb0=.sha256' \ |
19 | '&2Sy49KEmcNoLSOTUoqE6ZAA1qABRvEzpJlQijt5f3Mk=.sha256' \ |
20 | '&q4Fv+iiL+px4GIr0Zpwk1MFf1/DlT/5smU2ErpxQMp0=.sha256';; |
21 | |
22 | Linux\ i686) set -- \ |
23 | '&irNubuQ8WiKiRqurQa/jg1bs31Y28WOn1qfX7Ht2D34=.sha256' \ |
24 | '&9H8hgabAi6HDmbiNBGPuly7WxDzpR+3S8/jNcbFWPJE=.sha256' \ |
25 | '&fbFIoiLnYOmrj6nbgtdbPOUtllfc9i9VOMaLZiWMgrQ=.sha256' \ |
26 | '&E/lR2RF3arDd6YU41lcjSalNFCf/ZuB/kQDz0zOtrwk=.sha256';; |
27 | |
28 | Darwin*\ x86_64) set -- \ |
29 | '&ZAhFFGRgf14kUiRlUx0wMOoL7yGluiLUME2XxmiLNt0=.sha256' \ |
30 | '&vjbdlUdW0MtVO7iRseEWpMYZlk4fefVsO5+ljYL7ckE=.sha256' \ |
31 | '&Ork3//T8ogpZ3lOQRg0Z5Uw+MdJLNpWTo6OWysqIrkE=.sha256';; |
32 | |
33 | *) |
34 | printf 'System not recognized: %s\n' "$system" >&2 |
35 | exit 1 |
36 | ;; |
37 | esac |
38 | |
39 | install_js_blob='&Tf/6MqAfPUhyEpL6nLzyLoosc/h9qIvG0YM2FxTTYkU=.sha256' |
40 | exec 3<<EOF |
41 | { |
42 | "preludeBlobs": [ |
43 | { |
44 | "link": "&2AMoW67mf2KJjmi5Krjkh9klw2vlQtXKbAYwPFKM75M=.sha256", |
45 | "size": 58477 |
46 | } |
47 | ], |
48 | "payloadBlobs": [ |
49 | { |
50 | "link": "&l2ZcJ6A5MqgbX0JXkVRBBU2dgBdDnM47tJImpF+bOk8=.sha256", |
51 | "size": 2052334 |
52 | } |
53 | ], |
54 | "vfsBlobs": [ |
55 | { |
56 | "link": "&CDhy5HTLjEpbzxzM5GbYLwRvBBs5sUhOjitYcADoIwo=.sha256", |
57 | "size": 172228 |
58 | } |
59 | ], |
60 | "binName": "patchfoo", |
61 | "entrypoint": "/snapshot/patchfoo/server.js", |
62 | "otherEntrypoints": {}, |
63 | "bakes": [], |
64 | "fileBlobs": { |
65 | "linux-x64": { |
66 | "/snapshot/patchfoo/node_modules/sodium-native/prebuilds/linux-x64/libsodium.so.23": [ |
67 | { |
68 | "link": "&NZls/6/XCnKGgR8G7VYp/HREnqcdzRo1UKzUjA5EUPc=.sha256", |
69 | "size": 359032 |
70 | } |
71 | ], |
72 | "/snapshot/patchfoo/node_modules/sodium-native/prebuilds/linux-x64/node.napi.node": [ |
73 | { |
74 | "link": "&o5lfdscfDSox8T4tGovJ4LRtuoB/OZQUf/tmp6pxbq0=.sha256", |
75 | "size": 237040 |
76 | } |
77 | ] |
78 | }, |
79 | "linux-arm": { |
80 | "/snapshot/patchfoo/node_modules/sodium-native/prebuilds/linux-arm/libsodium.so.23": [ |
81 | { |
82 | "link": "&WDmqytxRg6+8feJmaYQmj557uyL0pdH9a7fS7tMK81I=.sha256", |
83 | "size": 271860 |
84 | } |
85 | ], |
86 | "/snapshot/patchfoo/node_modules/sodium-native/prebuilds/linux-arm/node.napi.node": [ |
87 | { |
88 | "link": "&5zQDiOhdAvDhpJ3kqW61EjF5ahAszqOksA/sslmDq/0=.sha256", |
89 | "size": 236068 |
90 | } |
91 | ] |
92 | }, |
93 | "linux-arm64": { |
94 | "/snapshot/patchfoo/node_modules/sodium-native/prebuilds/linux-arm64/libsodium.so.23": [ |
95 | { |
96 | "link": "&n3I5o8LPUEXuymEkEEhVlMAr6gUDL2geyXadZ2FyTH0=.sha256", |
97 | "size": 202904 |
98 | } |
99 | ], |
100 | "/snapshot/patchfoo/node_modules/sodium-native/prebuilds/linux-arm64/node.napi.node": [ |
101 | { |
102 | "link": "&k2m6kezfzS63pB95QsnebTVMM7zhebPC+sNlryq2iPc=.sha256", |
103 | "size": 216320 |
104 | } |
105 | ] |
106 | }, |
107 | "linux-ia32": { |
108 | "/snapshot/patchfoo/node_modules/sodium-native/prebuilds/linux-ia32/libsodium.so.23": [ |
109 | { |
110 | "link": "&lWEU2O5wovfATth0ubNU6q9avv02ohJGhXyhcBmaDls=.sha256", |
111 | "size": 435696 |
112 | } |
113 | ], |
114 | "/snapshot/patchfoo/node_modules/sodium-native/prebuilds/linux-ia32/node.napi.node": [ |
115 | { |
116 | "link": "&YT33d/f0xwvHDouy58Y+PoIzrMjUSeuEuB24vYwTaJ8=.sha256", |
117 | "size": 210972 |
118 | } |
119 | ] |
120 | }, |
121 | "darwin-x64": { |
122 | "/snapshot/patchfoo/node_modules/sodium-native/prebuilds/darwin-x64/libsodium.dylib": [ |
123 | { |
124 | "link": "&C9yYrmAyE5sRSn/clYUk8oQWPd2H8duE99xGwiNv+ac=.sha256", |
125 | "size": 413328 |
126 | } |
127 | ], |
128 | "/snapshot/patchfoo/node_modules/sodium-native/prebuilds/darwin-x64/node.napi.node": [ |
129 | { |
130 | "link": "&ypNp9SnCsVyCsp0pccKf3Oc2hGgt1xCxylKF8ki3Jmw=.sha256", |
131 | "size": 200692 |
132 | } |
133 | ] |
134 | } |
135 | } |
136 | } |
137 | EOF |
138 | |
139 | tmp_dir=$(mktemp -d "${TMPDIR:-/tmp}/ssb-pkg.XXXXXXXXX") || exit 1 |
140 | node_bin="$tmp_dir/ssb-pkg-node-$$" |
141 | install_js="$tmp_dir/ssb-pkg-install-$$" |
142 | |
143 | while ! for id; do |
144 | echo "$id" >&2 |
145 | curl -sS "$blobs_base$id" |
146 | done | gunzip > "$node_bin"; do sleep 2; done |
147 | chmod +x "$node_bin" |
148 | |
149 | while ! curl -sS "$blobs_base$install_js_blob" -o "$install_js" |
150 | do sleep 1; done |
151 | "$node_bin" "$install_js" |
152 | rc=$? |
153 | rm -rf "$tmp_dir" |
154 | exit $rc |
155 |
Built with git-ssb-web