Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

binary release fixes + install info #918

Merged
merged 4 commits into from
Jan 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ test/fixtures/dat.json
test/**.db
test/.datrc-test
package-lock.json
dist
dist
builds
26 changes: 26 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Dat CLI installation instructions

Method 1: Self contained binary

- This method does not require installing Node.js or npm
- Download the latest release zip for your platform (self contained binary) from https://github.com/datproject/dat/releases
- Extract the zip
- On a command line run: ./path-to-extracted-zip/dat
- Make sure to leave all files in the extracted zip in their original location

Linux/Mac: Add to your PATH so you can just run 'dat' instead of './path-to-extracted-zip/dat':

- On a command line run: cd ./path-to-extracted-zip
- Run: pwd
- Use the path printed out above to add this line to your `.bash_profile', e.g.:

PATH=/Users/maxogden/Downloads/dat-13.9.2-macos-x64/:$PATH

- Reload your terminal and you should just be able to run 'dat' from any folder now.

Method 2 (recommended for easy updates): npm

- Install http://nodejs.org/
- On a command line run: npm install dat --global
- You should now have dat installed, try running: dat

11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"deps": "dependency-check . && dependency-check . --extra --no-dev",
"test": "standard && npm run deps && tape 'test/*.js'",
"test-only": "tape 'test/*.js'",
"package": "pkg package.json -o dist/dat"
"package": "rm -rf builds && npm run pkg && ./package.sh",
"pkg": "pkg package.json -o builds/dat"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -58,11 +59,12 @@
"xtend": "^4.0.1"
},
"devDependencies": {
"cross-zip-cli": "^1.0.0",
"dependency-check": "^2.8.0",
"hypercore": "^6.5.0",
"hyperdiscovery": "^7.0.0",
"mkdirp": "^0.5.1",
"pkg": "^4.2.2",
"pkg": "^4.2.6",
"random-access-memory": "^2.4.0",
"recursive-readdir-sync": "^1.0.6",
"request": "^2.81.0",
Expand All @@ -73,8 +75,9 @@
},
"pkg": {
"assets": [
"node_modules/utp-native/prebuilds/**",
"node_modules/sodium-native/prebuilds/**"
"./node_modules/utp-native/prebuilds/**",
"./node_modules/blake2b-wasm/blake2b.wasm",
"./node_modules/siphash24/siphash24.wasm"
],
"targets": [
"node8-linux-x64",
Expand Down
38 changes: 38 additions & 0 deletions package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env sh
# couldnt figure out undocumented 'output template' mode for pkg so wrote this
# also need to include .node files until pkg supports including them in binary

NODE_ABI="node-57"
VERSION=$(node -pe "require('./package.json').version")

rm -rf dist

mkdir dist
mkdir builds/dat-$VERSION-linux-x64
mkdir builds/dat-$VERSION-macos-x64
mkdir builds/dat-$VERSION-win-x64

mv builds/dat-linux builds/dat-$VERSION-linux-x64/dat
mv builds/dat-macos builds/dat-$VERSION-macos-x64/dat
mv builds/dat-win.exe builds/dat-$VERSION-win-x64/dat.exe

cp node_modules/utp-native/prebuilds/linux-x64/$NODE_ABI.node builds/dat-$VERSION-linux-x64/
cp node_modules/utp-native/prebuilds/darwin-x64/$NODE_ABI.node builds/dat-$VERSION-macos-x64/
cp node_modules/utp-native/prebuilds/win32-x64/$NODE_ABI.node builds/dat-$VERSION-win-x64/

cp LICENSE builds/dat-$VERSION-linux-x64/
cp LICENSE builds/dat-$VERSION-macos-x64/
cp LICENSE builds/dat-$VERSION-win-x64/

cp INSTALL builds/dat-$VERSION-linux-x64/README
cp INSTALL builds/dat-$VERSION-macos-x64/README
cp INSTALL builds/dat-$VERSION-win-x64/README

cd builds
../node_modules/.bin/cross-zip dat-$VERSION-linux-x64 ../dist/dat-$VERSION-linux-x64.zip
../node_modules/.bin/cross-zip dat-$VERSION-macos-x64 ../dist/dat-$VERSION-macos-x64.zip
../node_modules/.bin/cross-zip dat-$VERSION-win-x64 ../dist/dat-$VERSION-win-x64.zip

rm -rf builds

# now travis will upload the 3 zips in dist to the release