Skip to content

Commit bd8cc01

Browse files
committed
Make some dependencies in src/gui2 optional, and properly document them.
1 parent 45e55f0 commit bd8cc01

File tree

5 files changed

+43
-20
lines changed

5 files changed

+43
-20
lines changed

.github/workflows/ccpp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
path: 'fluxengine-testdata'
6767
- name: brew
6868
run: |
69-
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
69+
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
7070
brew link mbedtls@3
7171
brew upgrade
7272
- name: make

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101

102102
- name: brew
103103
run: |
104-
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
104+
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
105105
brew link mbedtls@3
106106
brew upgrade
107107

build/pkg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def get_property(self, name, flag):
3737

3838
def _package(self, name, package, fallback, pkgconfig):
3939
if pkgconfig.has_package(package):
40+
print(f"package '{package}' found")
4041
cflags = pkgconfig.get_property(package, "--cflags")
4142
ldflags = pkgconfig.get_property(package, "--libs")
4243

@@ -50,6 +51,7 @@ def _package(self, name, package, fallback, pkgconfig):
5051
return
5152

5253
assert fallback, f"Required package '{package}' not installed"
54+
print(f"package '{package}' not found; using fallback")
5355

5456
if "cheader_deps" in fallback.args:
5557
self.args["cheader_deps"] = fallback.args["cheader_deps"]

doc/building-client.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ install some support packages. **You will need to check out git with submodules
1111

1212
- For Linux with Ubuntu/Debian:
1313
`libudev-dev` `libsqlite3-dev` `protobuf-compiler` `libfmt-dev`
14-
`libprotobuf-dev` `libmagic-dev` `libmbedtls-dev`
15-
`libcurl4-openssl-dev` `libmagic-dev` `nlohmann-json3-dev`
16-
`libdbus-1-dev` `libglfw3-dev` `libmd4c-dev` `libfreetype-dev`
17-
`libcli11-dev` `libboost-regex-dev`
14+
`libprotobuf-dev` `libmagic-dev` `libmbedtls-dev` `libcurl4-openssl-dev`
15+
`libmagic-dev` `libdbus-1-dev` `libglfw3-dev` `libfreetype-dev`
16+
`libboost-regex-dev` Plus, optionally (if not present, internal versions
17+
will be used): `nlohmann-json3-dev` `libcli11-dev` `libmd4c-dev`
1818
- For OSX with Homebrew:
1919
`sqlite` `pkg-config` `libusb` `protobuf` `fmt` `make` `coreutils`
20-
`dylibbundler` `libjpeg` `libmagic` `nlohmann-json` `cli11` `boost`
21-
`glfw3` `md4c` `ninja` `python` `freetype2` `mbedtls`
20+
`dylibbundler` `libjpeg` `libmagic` `boost` `glfw3` `ninja` `python`
21+
`freetype2` `mbedtls` Plus, optionally (if not present, internal versions
22+
will be used): `nlohmann-json` `cli11` `md4c` `lunasvg`
2223
- For Windows with MSYS and pacboy:
2324
`protobuf:p` `pkgconf:p` `curl-winssl:p` `file:p` `glfw:p` `mbedtls:p`
2425
`sqlite:p` `freetype:p` `boost:p` `gcc:p` `binutils:p` `nsis:p`

src/gui2/build.py

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,35 @@ def sources_from(path, except_for=[]):
4444
package(name="magic_lib", package="libmagic")
4545
package(name="mbedtls_lib", package="mbedtls")
4646

47-
cxxlibrary(
47+
package(
4848
name="nlohmannjson_lib",
49-
srcs=[],
50-
hdrs=headers_from("dep/nlohmann_json/single_include"),
49+
package="nlohmann_json",
50+
fallback=cxxlibrary(
51+
name="nlohmannjson_fallback_lib",
52+
srcs=[],
53+
hdrs=headers_from("dep/nlohmann_json/single_include"),
54+
),
5155
)
5256

53-
clibrary(
57+
package(
5458
name="md4c_lib",
55-
srcs=sources_from("dep/md4c/src"),
56-
hdrs={"md4c.h": "dep/md4c/src/md4c.h"},
59+
package="md4c",
60+
fallback=clibrary(
61+
name="md4c_fallback_lib",
62+
srcs=sources_from("dep/md4c/src"),
63+
hdrs={"md4c.h": "dep/md4c/src/md4c.h"},
64+
),
5765
)
5866

59-
cxxlibrary(name="cli11_lib", srcs=[], hdrs=headers_from("dep/cli11/include"))
67+
package(
68+
name="cli11_lib",
69+
package="CLI11",
70+
fallback=cxxlibrary(
71+
name="cli11_fallback_lib",
72+
srcs=[],
73+
hdrs=headers_from("dep/cli11/include"),
74+
),
75+
)
6076

6177
if config.osx:
6278
clibrary(
@@ -95,12 +111,16 @@ def sources_from(path, except_for=[]):
95111
cflags=cflags,
96112
)
97113

98-
cxxlibrary(
114+
package(
99115
name="lunasvg",
100-
srcs=sources_from("dep/lunasvg/source"),
101-
hdrs=headers_from("dep/lunasvg/include"),
102-
deps=[".+plutovg", "+fmt_lib"],
103-
cflags=cflags,
116+
package="lunasvg",
117+
fallback=cxxlibrary(
118+
name="lunasvg_fallback_lib",
119+
srcs=sources_from("dep/lunasvg/source"),
120+
hdrs=headers_from("dep/lunasvg/include"),
121+
deps=[".+plutovg", "+fmt_lib"],
122+
cflags=cflags,
123+
),
104124
)
105125

106126
cxxlibrary(

0 commit comments

Comments
 (0)