nix: modernize cmake options

This commit is contained in:
outfoxxed 2024-09-09 03:23:27 -07:00
parent 85be3861ce
commit 8cdb41317f
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E

View file

@ -58,29 +58,28 @@
qt6.qtdeclarative qt6.qtdeclarative
cli11 cli11
] ]
++ (lib.optional withCrashReporter breakpad) ++ lib.optional withCrashReporter breakpad
++ (lib.optional withJemalloc jemalloc) ++ lib.optional withJemalloc jemalloc
++ (lib.optional withQtSvg qt6.qtsvg) ++ lib.optional withQtSvg qt6.qtsvg
++ (lib.optionals withWayland [ qt6.qtwayland wayland ]) ++ lib.optionals withWayland [ qt6.qtwayland wayland ]
++ (lib.optional withX11 xorg.libxcb) ++ lib.optional withX11 xorg.libxcb
++ (lib.optional withPam pam) ++ lib.optional withPam pam
++ (lib.optional withPipewire pipewire); ++ lib.optional withPipewire pipewire;
QTWAYLANDSCANNER = lib.optionalString withWayland "${qt6.qtwayland}/libexec/qtwaylandscanner"; QTWAYLANDSCANNER = lib.optionalString withWayland "${qt6.qtwayland}/libexec/qtwaylandscanner";
cmakeBuildType = if debug then "Debug" else "RelWithDebInfo"; cmakeBuildType = if debug then "Debug" else "RelWithDebInfo";
cmakeFlags = [ "-DGIT_REVISION=${gitRev}" ] cmakeFlags = [
++ lib.optional (!withCrashReporter) "-DCRASH_REPORTER=OFF" (lib.cmakeFeature "GIT_REVISION" gitRev)
++ lib.optional (!withJemalloc) "-DUSE_JEMALLOC=OFF" (lib.cmakeBool "CRASH_REPORTER" withCrashReporter)
++ lib.optional (!withWayland) "-DWAYLAND=OFF" (lib.cmakeBool "USE_JEMALLOC" withJemalloc)
++ lib.optional (!withPipewire) "-DSERVICE_PIPEWIRE=OFF" (lib.cmakeBool "WAYLAND" withWayland)
++ lib.optional (!withPam) "-DSERVICE_PAM=OFF" (lib.cmakeBool "SERVICE_PIPEWIRE" withPipewire)
++ lib.optional (!withHyprland) "-DHYPRLAND=OFF" (lib.cmakeBool "SERVICE_PAM" withPam)
++ lib.optional (!withQMLLib) "-DINSTALL_QML_LIB=OFF"; (lib.cmakeBool "HYPRLAND" withHyprland)
(lib.cmakeBool "INSTALL_QML_LIB" withQMLLib)
buildPhase = "ninjaBuildPhase"; ];
enableParallelBuilding = true;
# How to get debuginfo in gdb from a release build: # How to get debuginfo in gdb from a release build:
# 1. build `quickshell.debug` # 1. build `quickshell.debug`
@ -91,7 +90,7 @@
meta = with lib; { meta = with lib; {
homepage = "https://git.outfoxxed.me/outfoxxed/quickshell"; homepage = "https://git.outfoxxed.me/outfoxxed/quickshell";
description = "Simple and flexbile QtQuick based desktop shell toolkit"; description = "Flexbile QtQuick based desktop shell toolkit";
license = licenses.lgpl3Only; license = licenses.lgpl3Only;
platforms = platforms.linux; platforms = platforms.linux;
}; };