diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index eb52a9e4..ba0d61c2 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -66,7 +66,7 @@ jobs: path: 'fluxengine-testdata' - name: brew run: | - brew install sqlite pkg-config libusb protobuf wxwidgets fmt make coreutils dylibbundler libjpeg libmagic nlohmann-json cli11 boost glfw3 md4c ninja python freetype2 mbedtls@3 + brew install sqlite pkg-config libusb protobuf wxwidgets fmt make coreutils dylibbundler libjpeg libmagic nlohmann-json cli11 boost glfw3 md4c ninja python freetype2 mbedtls@3 lunasvg brew link mbedtls@3 brew upgrade - name: make diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e2b98969..f72dd80f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -101,7 +101,7 @@ jobs: - name: brew run: | - brew install sqlite pkg-config libusb protobuf wxwidgets fmt make coreutils dylibbundler libjpeg libmagic nlohmann-json cli11 boost glfw3 md4c ninja python freetype2 mbedtls@3 + brew install sqlite pkg-config libusb protobuf wxwidgets fmt make coreutils dylibbundler libjpeg libmagic nlohmann-json cli11 boost glfw3 md4c ninja python freetype2 mbedtls@3 lunasvg brew link mbedtls@3 brew upgrade diff --git a/Makefile b/Makefile index 09942532..8a3b756f 100644 --- a/Makefile +++ b/Makefile @@ -43,11 +43,11 @@ ifeq ($(BUILDTYPE),windows) else CC = clang CXX = clang++ - CFLAGS = \ + CFLAGS += \ $(OPTFLAGS) \ -I/opt/homebrew/include -I/usr/local/include \ -Wno-unknown-warning-option - CXXFLAGS = \ + CXXFLAGS += \ $(OPTFLAGS) \ -std=c++23 \ -fexperimental-library \ @@ -56,7 +56,7 @@ else -Wformat-security \ -Wno-deprecated-enum-float-conversion \ -Wno-deprecated-enum-enum-conversion - LDFLAGS = + LDFLAGS += AR = ar PKG_CONFIG = pkg-config ifeq ($(BUILDTYPE),osx) @@ -67,7 +67,7 @@ endif HOSTCC = gcc HOSTCXX = g++ -std=c++20 -HOSTCFLAGS = -g -O3 +HOSTCFLAGS += -g -O3 HOSTLDFLAGS = REALOBJ = .obj diff --git a/build/pkg.py b/build/pkg.py index e1adec53..b3c2d589 100644 --- a/build/pkg.py +++ b/build/pkg.py @@ -37,6 +37,7 @@ def get_property(self, name, flag): def _package(self, name, package, fallback, pkgconfig): if pkgconfig.has_package(package): + print(f"package '{package}' found") cflags = pkgconfig.get_property(package, "--cflags") ldflags = pkgconfig.get_property(package, "--libs") @@ -50,6 +51,7 @@ def _package(self, name, package, fallback, pkgconfig): return assert fallback, f"Required package '{package}' not installed" + print(f"package '{package}' not found; using fallback") if "cheader_deps" in fallback.args: self.args["cheader_deps"] = fallback.args["cheader_deps"] diff --git a/doc/building-client.md b/doc/building-client.md index 10de90eb..7298dcd0 100644 --- a/doc/building-client.md +++ b/doc/building-client.md @@ -11,15 +11,17 @@ install some support packages. **You will need to check out git with submodules - For Linux with Ubuntu/Debian: `libudev-dev` `libsqlite3-dev` `protobuf-compiler` `libfmt-dev` - `libprotobuf-dev` `libmagic-dev` `libmbedtls-dev` - `libcurl4-openssl-dev` `libmagic-dev` `nlohmann-json3-dev` - `libdbus-1-dev` `libglfw3-dev` `libmd4c-dev` `libfreetype-dev` - `libcli11-dev` `libboost-regex-dev` + `libprotobuf-dev` `libmagic-dev` `libmbedtls-dev` `libcurl4-openssl-dev` + `libmagic-dev` `libdbus-1-dev` `libglfw3-dev` `libfreetype-dev` + `libboost-regex-dev` Plus, optionally (if not present, internal versions + will be used): `nlohmann-json3-dev` `libcli11-dev` `libmd4c-dev` - For OSX with Homebrew: `sqlite` `pkg-config` `libusb` `protobuf` `fmt` `make` `coreutils` - `dylibbundler` `libjpeg` `libmagic` `nlohmann-json` `cli11` `boost` - `glfw3` `md4c` `ninja` `python` `freetype2` `mbedtls` + `dylibbundler` `libjpeg` `libmagic` `boost` `glfw3` `ninja` `python` + `freetype2` `mbedtls` Plus, optionally (if not present, internal versions + will be used): `nlohmann-json` `cli11` `md4c` `lunasvg` - For Windows with MSYS and pacboy: + `python` `diffutils` `ninja` `make` `zip` `mingw-w64-cross-clang` `protobuf:p` `pkgconf:p` `curl-winssl:p` `file:p` `glfw:p` `mbedtls:p` `sqlite:p` `freetype:p` `boost:p` `gcc:p` `binutils:p` `nsis:p` `abseil-cpp:p` diff --git a/src/gui2/build.py b/src/gui2/build.py index 2c7bd954..33446f94 100644 --- a/src/gui2/build.py +++ b/src/gui2/build.py @@ -44,19 +44,35 @@ def sources_from(path, except_for=[]): package(name="magic_lib", package="libmagic") package(name="mbedtls_lib", package="mbedtls") -cxxlibrary( +package( name="nlohmannjson_lib", - srcs=[], - hdrs=headers_from("dep/nlohmann_json/single_include"), + package="nlohmann_json", + fallback=cxxlibrary( + name="nlohmannjson_fallback_lib", + srcs=[], + hdrs=headers_from("dep/nlohmann_json/single_include"), + ), ) -clibrary( +package( name="md4c_lib", - srcs=sources_from("dep/md4c/src"), - hdrs={"md4c.h": "dep/md4c/src/md4c.h"}, + package="md4c", + fallback=clibrary( + name="md4c_fallback_lib", + srcs=sources_from("dep/md4c/src"), + hdrs={"md4c.h": "dep/md4c/src/md4c.h"}, + ), ) -cxxlibrary(name="cli11_lib", srcs=[], hdrs=headers_from("dep/cli11/include")) +package( + name="cli11_lib", + package="CLI11", + fallback=cxxlibrary( + name="cli11_fallback_lib", + srcs=[], + hdrs=headers_from("dep/cli11/include"), + ), +) if config.osx: clibrary( @@ -95,12 +111,16 @@ def sources_from(path, except_for=[]): cflags=cflags, ) -cxxlibrary( +package( name="lunasvg", - srcs=sources_from("dep/lunasvg/source"), - hdrs=headers_from("dep/lunasvg/include"), - deps=[".+plutovg", "+fmt_lib"], - cflags=cflags, + package="lunasvg", + fallback=cxxlibrary( + name="lunasvg_fallback_lib", + srcs=sources_from("dep/lunasvg/source"), + hdrs=headers_from("dep/lunasvg/include"), + deps=[".+plutovg", "+fmt_lib"], + cflags=cflags, + ), ) cxxlibrary(