Bläddra i källkod

Сборка для linux-arm64

Book Pauk 2 år sedan
förälder
incheckning
a4715be0ed
4 ändrade filer med 7 tillägg och 3 borttagningar
  1. 2 0
      README.md
  2. 2 2
      build/prepkg.js
  3. 1 0
      build/release.js
  4. 2 1
      package.json

+ 2 - 0
README.md

@@ -287,6 +287,8 @@ sudo service nginx reload
 Сборка только в среде Linux.
 Необходима версия node.js не ниже 16.
 
+Для сборки linux-arm64 необходимо предварительно установить [QEMU](https://wiki.debian.org/QemuUserEmulation).
+
 ```sh
 git clone https://github.com/bookpauk/inpx-web
 cd inpx-web

+ 2 - 2
build/prepkg.js

@@ -12,8 +12,8 @@ const publicDir = `${tmpDir}/public`;
 const outDir = `${distDir}/${platform}`;
 
 async function build() {
-    if (platform != 'linux' && platform != 'win' && platform != 'macos')
-        throw new Error(`Unknown platform: ${platform}`);
+    if (!platform)
+        throw new Error(`Please set platform`);
 
     await fs.emptyDir(outDir);
 

+ 1 - 0
build/release.js

@@ -22,6 +22,7 @@ async function main() {
         await fs.emptyDir(outDir);
         await makeRelease('win');
         await makeRelease('linux');
+        await makeRelease('linux-arm64');
         await makeRelease('macos');
     } catch(e) {
         console.error(e);

+ 2 - 1
package.json

@@ -11,10 +11,11 @@
     "dev": "nodemon --inspect --ignore server/.inpx-web --ignore client --exec 'node --expose-gc server --lib-dir=server/.inpx-web/lib'",
     "build:client": "webpack --config build/webpack.prod.config.js",
     "build:linux": "npm run build:client && node build/prepkg.js linux && pkg -t node16-linux-x64 -C GZip --options max-old-space-size=4096,expose-gc -o dist/linux/inpx-web .",
+    "build:linux-arm64": "npm run build:client && node build/prepkg.js linux-arm64 && pkg -t node16-linuxstatic-arm64 -C GZip --options max-old-space-size=4096,expose-gc -o dist/linux-arm64/inpx-web .",
     "build:win": "npm run build:client && node build/prepkg.js win && pkg -t node16-win-x64 -C GZip --options max-old-space-size=4096,expose-gc -o dist/win/inpx-web .",
     "build:macos": "npm run build:client && node build/prepkg.js macos && pkg -t node16-macos-x64 -C GZip --options max-old-space-size=4096,expose-gc -o dist/macos/inpx-web .",
     "build:client-dev": "webpack --config build/webpack.dev.config.js",
-    "build:all": "npm run build:linux && npm run build:win && npm run build:macos",
+    "build:all": "npm run build:linux && npm run build:win && npm run build:macos && npm run build:linux-arm64",
     "release": "npm run build:all && node build/release.js",
     "postinstall": "npm run build:client-dev"
   },