Skip to content

Commit ea1b387

Browse files
authored
Merge pull request #2466 from cdr/freebsd-abe7
ci: Add support for FreeBSD to the build process
2 parents 0f2085b + d3d4428 commit ea1b387

File tree

10 files changed

+14278
-341
lines changed

10 files changed

+14278
-341
lines changed

ci/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ You can disable minification by setting `MINIFY=`.
8181
- Will build a standalone release with node and node_modules bundled into `./release-standalone`.
8282
- [./ci/build/clean.sh](./build/clean.sh) (`yarn clean`)
8383
- Removes all build artifacts.
84-
- Will also `git reset --hard lib/vscode`.
8584
- Useful to do a clean build.
8685
- [./ci/build/code-server.sh](./build/code-server.sh)
8786
- Copied into standalone releases to run code-server with the bundled node binary.

ci/build/build-code-server.sh

+2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ main() {
2020

2121
if ! [ -f ./lib/coder-cloud-agent ]; then
2222
OS="$(uname | tr '[:upper:]' '[:lower:]')"
23+
set +e
2324
curl -fsSL "https://storage.googleapis.com/coder-cloud-releases/agent/latest/$OS/cloud-agent" -o ./lib/coder-cloud-agent
2425
chmod +x ./lib/coder-cloud-agent
26+
set -e
2527
fi
2628

2729
parcel build \

ci/build/clean.sh

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ main() {
99

1010
pushd lib/vscode
1111
git clean -xffd
12-
git reset --hard
1312
popd
1413
}
1514

ci/lib.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ arch() {
3838
aarch64)
3939
echo arm64
4040
;;
41-
x86_64)
41+
x86_64 | amd64)
4242
echo amd64
4343
;;
4444
*)

ci/steps/release-packages.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ main() {
77
NODE_VERSION=v12.18.4
88
NODE_OS="$(uname | tr '[:upper:]' '[:lower:]')"
99
NODE_ARCH="$(uname -m | sed 's/86_64/64/; s/aarch64/arm64/')"
10-
curl -L "https://nodejs.org/dist/$NODE_VERSION/node-$NODE_VERSION-$NODE_OS-$NODE_ARCH.tar.gz" | tar -xz
10+
if [ "$NODE_OS" = "freebsd" ]; then
11+
mkdir -p "$PWD/node-$NODE_VERSION-$NODE_OS-$NODE_ARCH/bin"
12+
cp "$(which node)" "$PWD/node-$NODE_VERSION-$NODE_OS-$NODE_ARCH/bin"
13+
else
14+
curl -L "https://nodejs.org/dist/$NODE_VERSION/node-$NODE_VERSION-$NODE_OS-$NODE_ARCH.tar.gz" | tar -xz
15+
fi
1116
PATH="$PWD/node-$NODE_VERSION-$NODE_OS-$NODE_ARCH/bin:$PATH"
1217

1318
# https://github.com/actions/upload-artifact/issues/38

doc/npm.md

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- [Ubuntu, Debian](#ubuntu-debian)
66
- [Fedora, CentOS, RHEL](#fedora-centos-rhel)
77
- [macOS](#macos)
8+
- [FreeBSD](#freebsd)
89

910
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1011

@@ -40,3 +41,10 @@ npm config set python python2
4041
```bash
4142
xcode-select --install
4243
```
44+
45+
## FreeBSD
46+
47+
```sh
48+
pkg install -y git python npm-node12 yarn-node12 pkgconf
49+
pkg install -y libsecret libxkbfile libx11 libinotify
50+
```

install.sh

+13
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ echo_latest_version() {
7979
echo "$version"
8080
}
8181

82+
echo_npm_postinstall() {
83+
echoh
84+
cath << EOF
85+
The npm package has been installed successfully!
86+
Please extend your path to use code-server:
87+
PATH="$NPM_BIN_DIR:\$PATH"
88+
Please run with:
89+
code-server
90+
EOF
91+
}
92+
8293
echo_standalone_postinstall() {
8394
echoh
8495
cath << EOF
@@ -392,6 +403,7 @@ install_npm() {
392403
echoh "Installing with yarn."
393404
echoh
394405
"$sh_c" yarn global add code-server --unsafe-perm
406+
NPM_BIN_DIR="$(yarn global bin)" echo_npm_postinstall
395407
return
396408
elif command_exists npm; then
397409
sh_c="sh_c"
@@ -401,6 +413,7 @@ install_npm() {
401413
echoh "Installing with npm."
402414
echoh
403415
"$sh_c" npm install -g code-server --unsafe-perm
416+
NPM_BIN_DIR="$(npm bin -g)" echo_npm_postinstall
404417
return
405418
fi
406419
echoh

lib/vscode/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@
116116
"css-loader": "^3.2.0",
117117
"debounce": "^1.0.0",
118118
"deemon": "^1.4.0",
119-
"electron": "9.3.3",
120119
"eslint": "6.8.0",
121120
"eslint-plugin-jsdoc": "^19.1.0",
122121
"eslint-plugin-mocha": "8.0.0",

0 commit comments

Comments
 (0)