mirror of
https://github.com/NoCrypt/migu.git
synced 2026-04-21 08:31:58 +00:00
feat(capacitor): nodejs mobile native dependencies
This commit is contained in:
parent
65bd321f4a
commit
18ef3153db
7 changed files with 1539 additions and 143 deletions
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "capacitor/git_modules"]
|
||||||
|
path = capacitor/git_modules
|
||||||
|
url = https://github.com/nodejs-mobile/nodejs-mobile
|
||||||
|
|
@ -3,9 +3,6 @@
|
||||||
# instructions
|
# instructions
|
||||||
# Install Android NDK
|
# Install Android NDK
|
||||||
# Set $ANDROID_NDK_PATH (example: ~/Android/Sdk/ndk/26.1.10909125)
|
# Set $ANDROID_NDK_PATH (example: ~/Android/Sdk/ndk/26.1.10909125)
|
||||||
# Download and extract android .zip for nodejs-mobile from https://github.com/nodejs-mobile/nodejs-mobile/releases/tag/v18.17.2
|
|
||||||
# Update LIBNODE_PATH
|
|
||||||
# npm install nodejs-mobile-gyp
|
|
||||||
# install other npm packages like normal
|
# install other npm packages like normal
|
||||||
# run this script
|
# run this script
|
||||||
|
|
||||||
|
|
@ -13,7 +10,7 @@ toolchain_target_arch=aarch64
|
||||||
node_target_arch=arm64
|
node_target_arch=arm64
|
||||||
android_api_level=22
|
android_api_level=22
|
||||||
toolchain_folder=$ANDROID_NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin
|
toolchain_folder=$ANDROID_NDK_PATH/toolchains/llvm/prebuilt/linux-x86_64/bin
|
||||||
export LIBNODE_PATH=~/Downloads/nodejs-mobile
|
export LIBNODE_PATH=$(pwd)/git_modules/nodejs-mobile
|
||||||
|
|
||||||
export PATH=$toolchain_folder:$PATH
|
export PATH=$toolchain_folder:$PATH
|
||||||
|
|
||||||
|
|
@ -24,7 +21,7 @@ export AR=$toolchain_folder/llvm-ar
|
||||||
|
|
||||||
export npm_config_verbose=1
|
export npm_config_verbose=1
|
||||||
export npm_config_nodedir=${LIBNODE_PATH}
|
export npm_config_nodedir=${LIBNODE_PATH}
|
||||||
export npm_config_node_gyp=$(pwd)/node_modules/nodejs-mobile-gyp/bin/node-gyp.js
|
export npm_config_node_gyp=$(pwd)/../node_modules/nodejs-mobile-gyp/bin/node-gyp.js
|
||||||
export npm_config_arch=${node_target_arch}
|
export npm_config_arch=${node_target_arch}
|
||||||
export npm_config_plaform=android
|
export npm_config_plaform=android
|
||||||
export npm_config_format=make-android
|
export npm_config_format=make-android
|
||||||
|
|
@ -32,7 +29,7 @@ export npm_gyp_defines="target_arch=$node_target_arch v8_target_arch=$node_targe
|
||||||
|
|
||||||
#mv node_modules ../node_modules.bak
|
#mv node_modules ../node_modules.bak
|
||||||
# --from-from-source is used by node-pre-gyp
|
# --from-from-source is used by node-pre-gyp
|
||||||
npm rebuild --build-from-source
|
cd resources/nodejs && npm rebuild --build-from-source
|
||||||
# Remove executable permissions from native node modules
|
# Remove executable permissions from native node modules
|
||||||
# find node_modules -iname '*.node' -exec chmod -x '{}' \;
|
# find node_modules -iname '*.node' -exec chmod -x '{}' \;
|
||||||
|
|
||||||
|
|
|
||||||
1
capacitor/git_modules
Submodule
1
capacitor/git_modules
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 1b0223dc74dfa359e61131ee24e0fa386c6d12aa
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
"name": "capacitor",
|
"name": "capacitor",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"postinstall": "cd resources/nodejs/ && npm install",
|
||||||
"build:app": "cross-env NODE_ENV=production run-s build:web build:assets build:android",
|
"build:app": "cross-env NODE_ENV=production run-s build:web build:assets build:android",
|
||||||
"build:web": "webpack build",
|
"build:web": "webpack build",
|
||||||
"build:android": "cap build android",
|
"build:android": "cap build android",
|
||||||
|
|
@ -25,6 +26,7 @@
|
||||||
"cordova-res": "^0.15.4",
|
"cordova-res": "^0.15.4",
|
||||||
"crypto-browserify": "^3.12.0",
|
"crypto-browserify": "^3.12.0",
|
||||||
"hybrid-chunk-store": "^1.2.2",
|
"hybrid-chunk-store": "^1.2.2",
|
||||||
|
"nodejs-mobile-gyp": "^0.3.1",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"path-esm": "^1.0.0",
|
"path-esm": "^1.0.0",
|
||||||
"querystring": "^0.2.1",
|
"querystring": "^0.2.1",
|
||||||
|
|
@ -32,7 +34,8 @@
|
||||||
"stream-http": "^3.2.0",
|
"stream-http": "^3.2.0",
|
||||||
"timers-browserify": "^2.0.12",
|
"timers-browserify": "^2.0.12",
|
||||||
"util": "^0.12.5",
|
"util": "^0.12.5",
|
||||||
"webpack-cli": "^5.1.4"
|
"webpack-cli": "^5.1.4",
|
||||||
|
"webpack-merge": "^5.10.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@capacitor/android": "^5.5.1",
|
"@capacitor/android": "^5.5.1",
|
||||||
|
|
@ -47,7 +50,6 @@
|
||||||
"common": "workspace:*",
|
"common": "workspace:*",
|
||||||
"cordova-plugin-navigationbar": "^1.0.31",
|
"cordova-plugin-navigationbar": "^1.0.31",
|
||||||
"cordova-plugin-screen-orientation": "^3.0.4",
|
"cordova-plugin-screen-orientation": "^3.0.4",
|
||||||
"es6-promise-plugin": "^4.2.2",
|
"es6-promise-plugin": "^4.2.2"
|
||||||
"webpack-merge": "^5.10.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
9
capacitor/resources/nodejs/package.json
Normal file
9
capacitor/resources/nodejs/package.json
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"name": "capacitor-nodejs-thread",
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"utp-native": "^2.5.3"
|
||||||
|
},
|
||||||
|
"version": "1.0.0",
|
||||||
|
"main": "./index.js"
|
||||||
|
}
|
||||||
1647
pnpm-lock.yaml
1647
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,5 @@
|
||||||
|
packages:
|
||||||
|
- 'common'
|
||||||
|
- 'capacitor/*'
|
||||||
|
- 'electron/*'
|
||||||
|
- 'web/*'
|
||||||
Loading…
Reference in a new issue