forked from nodesource/distributions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
snap: add initial snapcraft config creation script
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Node.js Snap for https://snapcraft.io/ | ||
|
||
> Snaps are containerised software packages that are simple to create and install. They auto-update and are safe to run. And because they bundle their dependencies, they work on all major Linux systems without modification. | ||
This is a work in progress, currently supporting Node.js Nightly versions, updated every 24 hours from the Node.js _master_ branch. | ||
|
||
1. **Install snapd on your distribution:** https://docs.snapcraft.io/core/install | ||
2. **Install Node.js Nightly**: `$ snap install node --edge` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
set -xe | ||
|
||
__dirname="$(CDPATH= cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
||
# release | ||
#NODE_VERSION="9.4.0" | ||
#NODE_DISTTYPE="release" | ||
#NODE_TAG="" | ||
|
||
# nightly | ||
NODE_VERSION="$(curl -sL https://nodejs.org/download/nightly/index.tab | awk '/^v[1-9].*\Wsrc\W/ { print substr($1, 2); exit }')" | ||
NODE_DISTTYPE="nightly" | ||
NODE_TAG="v${NODE_VERSION}" | ||
|
||
envsubst << EOF > ${__dirname}/snapcraft.yaml | ||
name: node | ||
version: 'v${NODE_VERSION:0:30}' | ||
summary: Node.js | ||
description: | | ||
A JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world. https://nodejs.org/ | ||
grade: stable | ||
confinement: classic | ||
apps: | ||
node: | ||
command: bin/node | ||
npm: | ||
command: bin/npm | ||
yarn: | ||
command: bin/yarn.js | ||
parts: | ||
node: | ||
plugin: make | ||
source-type: tar | ||
source: https://nodejs.org/download/${NODE_DISTTYPE}/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.gz | ||
build-packages: | ||
- g++ | ||
- make | ||
- python2.7 | ||
- ccache | ||
prepare: | | ||
./configure --prefix=/ --release-urlbase=https://nodejs.org/download/${NODE_DISTTYPE}/ --tag=${NODE_TAG} | ||
yarn: | ||
source-type: tar | ||
source: https://yarnpkg.com/latest.tar.gz | ||
plugin: dump | ||
EOF |