From 9a3033340529881ae5e564d1aedf6884f53e3ea1 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sun, 15 Jun 2025 23:00:56 -0700 Subject: [PATCH] build: clarify shared libraries --- BUILD.md | 24 ++++++++++++++++-------- default.nix | 15 +++++++-------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/BUILD.md b/BUILD.md index afcb2e44..aa7c98ae 100644 --- a/BUILD.md +++ b/BUILD.md @@ -41,10 +41,15 @@ Quickshell has a set of base dependencies you will always need, names vary by di - `cmake` - `qt6base` - `qt6declarative` -- `qtshadertools` (build-time only) -- `spirv-tools` (build-time only) -- `pkg-config` (build-time only) -- `cli11` (build-time only) +- `qtshadertools` (build-time) +- `spirv-tools` (build-time) +- `pkg-config` (build-time) +- `cli11` (static library) + +Build time dependencies and static libraries don't have to exist at runtime, +however build time dependencies must be compiled for the architecture of +the builder, while static libraries must be compiled for the architecture +of the target. On some distros, private Qt headers are in separate packages which you may have to install. We currently require private headers for the following libraries: @@ -66,7 +71,7 @@ enable us to fix bugs far more easily. To disable: `-DCRASH_REPORTER=OFF` -Dependencies: `google-breakpad` +Dependencies: `google-breakpad` (static library) ### Jemalloc We recommend leaving Jemalloc enabled as it will mask memory fragmentation caused @@ -101,8 +106,11 @@ To disable: `-DWAYLAND=OFF` Dependencies: - `qt6wayland` - `wayland` (libwayland-client) - - `wayland-scanner` (may be part of your distro's wayland package) - - `wayland-protocols` + - `wayland-scanner` (build time) + - `wayland-protocols` (static library) + +Note that one or both of `wayland-scanner` and `wayland-protocols` may be bundled +with you distro's wayland package. #### Wlroots Layershell Enables wlroots layershell integration through the [zwlr-layer-shell-v1] protocol, @@ -220,7 +228,7 @@ To disable: `-DI3_IPC=OFF` ## Building *For developers and prospective contributors: See [CONTRIBUTING.md](CONTRIBUTING.md).* -We highly recommend using `ninja` to run the build, but you can use makefiles if you must. +Only `ninja` builds are tested, but makefiles may work. #### Configuring the build ```sh diff --git a/default.nix b/default.nix index 53c238ef..73cd8d16 100644 --- a/default.nix +++ b/default.nix @@ -46,29 +46,28 @@ }: buildStdenv.mkDerivation { pname = "quickshell${lib.optionalString debug "-debug"}"; version = "0.1.0"; - src = nix-gitignore.gitignoreSource "/docs\n/examples\n" ./.; + src = nix-gitignore.gitignoreSource [] ./.; nativeBuildInputs = [ cmake ninja qt6.qtshadertools spirv-tools - cli11 qt6.wrapQtAppsHook pkg-config - ] ++ (lib.optionals withWayland [ - wayland-protocols - wayland-scanner - ]); + ] + ++ lib.optional withWayland wayland-scanner; buildInputs = [ qt6.qtbase qt6.qtdeclarative + cli11 ] + ++ lib.optional withQtSvg qt6.qtsvg ++ lib.optional withCrashReporter breakpad ++ lib.optional withJemalloc jemalloc - ++ lib.optional withQtSvg qt6.qtsvg - ++ lib.optionals withWayland ([ qt6.qtwayland wayland ] ++ (if libgbm != null then [ libdrm libgbm ] else [])) + ++ lib.optionals withWayland [ qt6.qtwayland wayland wayland-protocols ] + ++ lib.optionals (withWayland && libgbm != null) [ libdrm libgbm ] ++ lib.optional withX11 xorg.libxcb ++ lib.optional withPam pam ++ lib.optional withPipewire pipewire;