mirror of
https://forge.fsky.io/oneflux/omegafox.git
synced 2026-02-10 03:32:06 -08:00
Merge pull request #216 from pauliusbaulius/improvements
Build fixes and performance improvements
This commit is contained in:
commit
48ff474745
3 changed files with 18 additions and 10 deletions
|
|
@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y \
|
|||
# Python
|
||||
python3 python3-dev python3-pip \
|
||||
# Camoufox build system tools
|
||||
git p7zip-full golang-go aria2 curl \
|
||||
git p7zip-full golang-go aria2 curl rsync \
|
||||
# CA certificates
|
||||
ca-certificates \
|
||||
&& update-ca-certificates
|
||||
|
|
@ -23,10 +23,10 @@ ENV PATH="/root/.cargo/bin:${PATH}"
|
|||
# Fetch Firefox & apply initial patches
|
||||
RUN make setup-minimal && \
|
||||
make mozbootstrap && \
|
||||
mkdir /app/dist
|
||||
mkdir -p /app/dist
|
||||
|
||||
# Mount .mozbuild directory and dist folder
|
||||
VOLUME /root/.mozbuild
|
||||
VOLUME /app/dist
|
||||
|
||||
ENTRYPOINT ["python3", "./multibuild.py"]
|
||||
ENTRYPOINT ["python3", "./multibuild.py"]
|
||||
|
|
@ -44,7 +44,10 @@ inline std::optional<std::string> get_env_utf8(const std::string& name) {
|
|||
}
|
||||
|
||||
inline const nlohmann::json& GetJson() {
|
||||
static const nlohmann::json jsonConfig = []() {
|
||||
static std::once_flag initFlag;
|
||||
static nlohmann::json jsonConfig;
|
||||
|
||||
std::call_once(initFlag, []() {
|
||||
std::string jsonString;
|
||||
int index = 1;
|
||||
|
||||
|
|
@ -63,17 +66,21 @@ inline const nlohmann::json& GetJson() {
|
|||
if (originalConfig) jsonString = *originalConfig;
|
||||
}
|
||||
|
||||
if (jsonString.empty()) return nlohmann::json{};
|
||||
if (jsonString.empty()) {
|
||||
jsonConfig = nlohmann::json{};
|
||||
return;
|
||||
}
|
||||
|
||||
// Validate
|
||||
if (!nlohmann::json::accept(jsonString)) {
|
||||
printf_stderr("ERROR: Invalid JSON passed to CAMOU_CONFIG!\n");
|
||||
return nlohmann::json{};
|
||||
jsonConfig = nlohmann::json{};
|
||||
return;
|
||||
}
|
||||
|
||||
nlohmann::json result = nlohmann::json::parse(jsonString);
|
||||
return result;
|
||||
}();
|
||||
jsonConfig = nlohmann::json::parse(jsonString);
|
||||
});
|
||||
|
||||
return jsonConfig;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import os
|
|||
import sys
|
||||
from dataclasses import dataclass
|
||||
from typing import List
|
||||
import shutil
|
||||
|
||||
# Constants
|
||||
AVAILABLE_TARGETS = ["linux", "windows", "macos"]
|
||||
|
|
@ -86,7 +87,7 @@ def run_build(target, arch):
|
|||
# Move assets to dist
|
||||
print('Assets:', ', '.join(builder.assets))
|
||||
for asset in builder.assets:
|
||||
os.rename(asset, f'dist/{asset}')
|
||||
shutil.move(asset, f'dist/{asset}')
|
||||
|
||||
|
||||
def main():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue