1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00
joplin/BUILD.md

41 lines
1.6 KiB
Markdown
Raw Normal View History

# General information
- All the applications share the same library, which, for historical reasons, is in ReactNativeClient/lib. This library is copied to the relevant directories when builing each app.
- The translations are built by running CliClient/build-translation.sh. For this reasons, it's generally better to get the CLI app to build first so that everything is setup correctly.
2017-12-03 23:44:04 +02:00
- Note: building translations is no longer required to run the apps, so you can ignore all the below requirements about gettext.
## macOS dependencies
Add node-gyp dependency to instructions I was getting an error on `yarn dist` which I solved with the command `npm install -g node-gyp`. This was the error: ``` Error: /usr/local/Cellar/node/8.9.1/bin/node exited with code 1 Output: $ node-pre-gyp install --fallback-to-build Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT) info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Error output: node-pre-gyp info it worked if it ends with ok node-pre-gyp info using node-pre-gyp@0.6.38 node-pre-gyp info using node@8.9.1 | darwin | x64 node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/electron-v1.7-darwin-x64.tar.gz node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/electron-v1.7-darwin-x64.tar.gz node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/electron-v1.7-darwin-x64.tar.gz node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and electron@1.7.9 (electron-v1.7 ABI) (falling back to source compile with node-gyp) node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/electron-v1.7-darwin-x64.tar.gz node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp clean' (Error: spawn node-gyp ENOENT) node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/matt/joplin/ElectronClient/app/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:77:29) node-pre-gyp ERR! stack at emitOne (events.js:116:13) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:211:7) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12) node-pre-gyp ERR! stack at onErrorNT (internal/child_process.js:372:16) node-pre-gyp ERR! stack at _combinedTickCallback (internal/process/next_tick.js:138:11) node-pre-gyp ERR! stack at process._tickCallback (internal/process/next_tick.js:180:9) node-pre-gyp ERR! System Darwin 16.7.0 node-pre-gyp ERR! command "/usr/local/Cellar/node/8.9.1/bin/node" "/Users/matt/joplin/ElectronClient/app/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /Users/matt/joplin/ElectronClient/app/node_modules/sqlite3 node-pre-gyp ERR! node -v v8.9.1 node-pre-gyp ERR! node-pre-gyp -v v0.6.38 node-pre-gyp ERR! not ok error Command failed with exit code 1. at ChildProcess.childProcess.once.code (/Users/matt/joplin/ElectronClient/app/node_modules/builder-util/src/util.ts:219:14) at Object.onceWrapper (events.js:317:30) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at maybeClose (internal/child_process.js:925:16) at Socket.stream.socket.on (internal/child_process.js:346:11) at emitOne (events.js:116:13) at Socket.emit (events.js:211:7) at Pipe._handle.close [as _onclose] (net.js:554:12) From previous event: at spawn (/Users/matt/joplin/ElectronClient/app/node_modules/builder-util/src/util.ts:182:3) at default.map.concurrency (/Users/matt/joplin/ElectronClient/app/node_modules/electron-builder/src/util/yarn.ts:154:7) at runCallback (timers.js:789:20) at tryOnImmediate (timers.js:751:5) at processImmediate [as _immediateCallback] (timers.js:722:5) From previous event: at /Users/matt/joplin/ElectronClient/app/node_modules/electron-builder/src/util/yarn.ts:152:27 From previous event: at rebuild (/Users/matt/joplin/ElectronClient/app/node_modules/electron-builder/out/util/yarn.js:94:22) at /Users/matt/joplin/ElectronClient/app/node_modules/electron-builder/src/util/yarn.ts:21:11 at Generator.next (<anonymous>) at runCallback (timers.js:789:20) at tryOnImmediate (timers.js:751:5) at processImmediate [as _immediateCallback] (timers.js:722:5) From previous event: at installOrRebuild (/Users/matt/joplin/ElectronClient/app/node_modules/electron-builder/out/util/yarn.js:32:21) at /Users/matt/joplin/ElectronClient/app/node_modules/electron-builder/src/packager.ts:388:7 at Generator.next (<anonymous>) From previous event: at Packager.installAppDependencies (/Users/matt/joplin/ElectronClient/app/node_modules/electron-builder/out/packager.js:433:11) at /Users/matt/joplin/ElectronClient/app/node_modules/electron-builder/src/packager.ts:284:20 at Generator.next (<anonymous>) From previous event: at Packager.doBuild (/Users/matt/joplin/ElectronClient/app/node_modules/electron-builder/out/packager.js:369:11) at /Users/matt/joplin/ElectronClient/app/node_modules/electron-builder/src/packager.ts:236:52 at Generator.next (<anonymous>) From previous event: at Packager.build (/Users/matt/joplin/ElectronClient/app/node_modules/electron-builder/out/packager.js:298:11) at /Users/matt/joplin/ElectronClient/app/node_modules/electron-builder/src/builder.ts:277:40 at Generator.next (<anonymous>) From previous event: at build (/Users/matt/joplin/ElectronClient/app/node_modules/electron-builder/out/builder.js:63:21) at then (/Users/matt/joplin/ElectronClient/app/node_modules/electron-builder/src/cli/cli.ts:49:4) at runCallback (timers.js:789:20) at tryOnImmediate (timers.js:751:5) at processImmediate [as _immediateCallback] (timers.js:722:5) From previous event: at Object.args [as handler] (/Users/matt/joplin/ElectronClient/app/node_modules/electron-builder/src/cli/cli.ts:49:4) at Object.runCommand (/Users/matt/joplin/ElectronClient/app/node_modules/yargs/lib/command.js:228:22) at Object.parseArgs [as _parseArgs] (/Users/matt/joplin/ElectronClient/app/node_modules/yargs/yargs.js:1041:24) at Object.get [as argv] (/Users/matt/joplin/ElectronClient/app/node_modules/yargs/yargs.js:957:21) at Object.<anonymous> (/Users/matt/joplin/ElectronClient/app/node_modules/electron-builder/src/cli/cli.ts:43:15) at Module._compile (module.js:635:30) at Object.Module._extensions..js (module.js:646:10) at Module.load (module.js:554:32) at tryModuleLoad (module.js:497:12) at Function.Module._load (module.js:489:3) at Function.Module.runMain (module.js:676:10) at startup (bootstrap_node.js:187:16) at bootstrap_node.js:608:3 ```
2017-12-02 04:28:13 +02:00
brew install yarn node xgettext
npm install -g node-gyp
echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
## Linux and Windows dependencies
2017-12-01 01:02:14 +02:00
- Install yarn - https://yarnpkg.com/lang/en/docs/install/
- Install node v8.x (check with `node --version`) - https://nodejs.org/en/
# Building the Electron application
2017-12-01 01:02:14 +02:00
```
cd ElectronClient/app
rsync -a ../../ReactNativeClient/lib/ lib/
npm install
yarn dist
```
If there's an error `while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory`, run `sudo apt-get install libgconf-2-4`
That will create the executable file in the `dist` directory.
From `/ElectronClient` you can also run `run.sh` to run the app for testing.
# Building the Mobile application
2017-12-01 01:02:14 +02:00
From `/ReactNativeClient`, run `npm install`, then `react-native run-ios` or `react-native run-android`.
# Building the Terminal application
2017-12-01 01:02:14 +02:00
2017-12-03 23:43:55 +02:00
From `/CliClient`, run `npm install` then run `run.sh`. If you get an error about `xgettext`, comment out the command `node build-translation.js --silent` in build.sh