Skip to content
Open
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
2 changes: 2 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Unreleased

* FIXED: #186 Skip download and symlink when using libzim_local

4.2.0
* NEW: Use libzim 9.7.0
* NEW: Add addAlias method to Creator
Expand Down
10 changes: 10 additions & 0 deletions bundle-libzim.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import dotenv from "dotenv";
dotenv.config();
import fs from "fs";
import { mkdirp } from "mkdirp";
import exec from "exec-then";
import os from "os";

mkdirp.sync("./build/Release");

const bindingGypText = fs.readFileSync("binding.gyp", { encoding: "utf8" });
if (bindingGypText.match(/"libzim_local"\s*:\s*"true"/)) {
console.log(
"the build is using system libzim -> not bundling libzim, skipping download and copy steps",
);
process.exit();
}

const isMacOS = os.type() === "Darwin";
const isLinux = os.type() === "Linux";

Expand All @@ -30,6 +39,7 @@ if (isLinux) {
exec(`cp download/${libDir}/libzim.so.9 build/Release/libzim.so.9`);
exec("ln -sf build/Release/libzim.so.9 build/Release/libzim.so"); // convenience only, not required
}

if (isMacOS) {
console.info("Copying libzim.9.dylib to build folder");
exec("cp download/lib/libzim.9.dylib build/Release/libzim.9.dylib");
Expand Down
Loading