fix: 支持 Linux 本机构建环境
This commit is contained in:
@@ -60,8 +60,8 @@ function normalizeAreaConfig(raw, options = {}) {
|
||||
id,
|
||||
input,
|
||||
outputRoot,
|
||||
qgisApp: raw.qgisApp || "/Applications/QGIS.app",
|
||||
blenderApp: raw.blenderApp || "/Applications/Blender.app",
|
||||
qgisApp: raw.qgisApp || (process.platform === "darwin" ? "/Applications/QGIS.app" : "/usr"),
|
||||
blenderApp: raw.blenderApp || (process.platform === "darwin" ? "/Applications/Blender.app" : "/usr/bin/blender"),
|
||||
stages: {
|
||||
intermediates: raw.stages?.intermediates ?? raw.stages?.qgis ?? true,
|
||||
blender: raw.stages?.blender ?? true,
|
||||
|
||||
58
scripts/lib/tool-paths.js
Normal file
58
scripts/lib/tool-paths.js
Normal file
@@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
function qgisPaths(qgisApp) {
|
||||
if (process.platform === "darwin") {
|
||||
const macosDir = path.join(qgisApp, "Contents", "MacOS");
|
||||
const resourcesDir = path.join(qgisApp, "Contents", "Resources");
|
||||
return {
|
||||
python: path.join(macosDir, "python3.12"),
|
||||
ogr2ogr: path.join(macosDir, "ogr2ogr"),
|
||||
ogrinfo: path.join(macosDir, "ogrinfo"),
|
||||
prefix: macosDir,
|
||||
env: {
|
||||
PROJ_LIB: path.join(resourcesDir, "qgis", "proj"),
|
||||
GDAL_DATA: path.join(resourcesDir, "qgis", "gdal"),
|
||||
},
|
||||
pythonEnv: {
|
||||
PYTHONHOME: path.join(qgisApp, "Contents", "Frameworks"),
|
||||
PYTHONPATH: [
|
||||
path.join(resourcesDir, "python"),
|
||||
path.join(resourcesDir, "python3.11", "site-packages"),
|
||||
].join(path.delimiter),
|
||||
DYLD_LIBRARY_PATH: [macosDir, path.join(qgisApp, "Contents", "Frameworks")].join(path.delimiter),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const binDir = path.join(qgisApp, "bin");
|
||||
const shareDir = path.join(qgisApp, "share");
|
||||
return {
|
||||
python: path.join(binDir, "python3"),
|
||||
ogr2ogr: path.join(binDir, "ogr2ogr"),
|
||||
ogrinfo: path.join(binDir, "ogrinfo"),
|
||||
prefix: qgisApp,
|
||||
env: {
|
||||
PROJ_LIB: path.join(shareDir, "proj"),
|
||||
GDAL_DATA: path.join(shareDir, "gdal"),
|
||||
},
|
||||
pythonEnv: {
|
||||
PYTHONPATH: [
|
||||
path.join(shareDir, "qgis", "python"),
|
||||
path.join(shareDir, "qgis", "python", "plugins"),
|
||||
].join(path.delimiter),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function blenderExecutable(blenderApp) {
|
||||
return process.platform === "darwin"
|
||||
? path.join(blenderApp, "Contents", "MacOS", "Blender")
|
||||
: blenderApp;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
blenderExecutable,
|
||||
qgisPaths,
|
||||
};
|
||||
Reference in New Issue
Block a user