summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt14
-rw-r--r--assets/cpp/CMakeLists.txt1
-rw-r--r--nix/default.nix40
-rw-r--r--plugin/CMakeLists.txt1
4 files changed, 38 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a814315..14f498b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,15 +39,17 @@ set(INSTALL_QSCONFDIR "etc/xdg/quickshell/caelestia" CACHE STRING "Quickshell co
add_compile_options(-Wall -Wextra)
-if(NOT DONT_BUILD_ASSETS)
+if(NOT DONT_BUILD_ASSETS AND NOT PLUGIN_ONLY AND NOT SHELL_ONLY)
add_subdirectory(assets/cpp)
endif()
-if(NOT DONT_BUILD_PLUGIN)
+if(NOT DONT_BUILD_PLUGIN AND NOT ASSETS_ONLY AND NOT SHELL_ONLY)
add_subdirectory(plugin)
endif()
-foreach(dir assets components config modules services utils)
- install(DIRECTORY ${dir} DESTINATION "${INSTALL_QSCONFDIR}")
-endforeach()
-install(FILES shell.qml LICENSE DESTINATION "${INSTALL_QSCONFDIR}")
+if(NOT DONT_BUILD_SHELL AND NOT ASSETS_ONLY AND NOT PLUGIN_ONLY)
+ foreach(dir assets components config modules services utils)
+ install(DIRECTORY ${dir} DESTINATION "${INSTALL_QSCONFDIR}")
+ endforeach()
+ install(FILES shell.qml LICENSE DESTINATION "${INSTALL_QSCONFDIR}")
+endif()
diff --git a/assets/cpp/CMakeLists.txt b/assets/cpp/CMakeLists.txt
index 18beabf..8e4532f 100644
--- a/assets/cpp/CMakeLists.txt
+++ b/assets/cpp/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 3.19)
find_package(PkgConfig REQUIRED)
pkg_check_modules(PIPEWIRE REQUIRED libpipewire-0.3)
pkg_check_modules(AUBIO REQUIRED aubio)
diff --git a/nix/default.nix b/nix/default.nix
index 3fd5325..c32aa87 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -68,28 +68,44 @@
cmakeVersionFlags = [
(lib.cmakeFeature "VERSION" version)
(lib.cmakeFeature "GIT_REVISION" rev)
- (lib.cmakeFeature "DISTRIBUTOR" "Nix Flake")
+ (lib.cmakeFeature "DISTRIBUTOR" "nix-flake")
];
assets = stdenv.mkDerivation {
name = "caelestia-assets";
- src = ./../assets/cpp;
+ src = lib.fileset.toSource {
+ root = ./..;
+ fileset = lib.fileset.union ./../CMakeLists.txt ./../assets/cpp;
+ };
nativeBuildInputs = [cmake ninja pkg-config];
buildInputs = [aubio pipewire];
- cmakeFlags = [(lib.cmakeFeature "INSTALL_LIBDIR" "${placeholder "out"}/lib")] ++ cmakeVersionFlags;
+ cmakeFlags =
+ [
+ (lib.cmakeBool "ASSETS_ONLY" true)
+ (lib.cmakeFeature "INSTALL_LIBDIR" "${placeholder "out"}/lib")
+ ]
+ ++ cmakeVersionFlags;
};
plugin = stdenv.mkDerivation {
name = "caelestia-qml-plugin";
- src = ./../plugin;
+ src = lib.fileset.toSource {
+ root = ./..;
+ fileset = lib.fileset.union ./../CMakeLists.txt ./../plugin;
+ };
nativeBuildInputs = [cmake ninja];
buildInputs = [qt6.qtbase qt6.qtdeclarative];
dontWrapQtApps = true;
- cmakeFlags = [(lib.cmakeFeature "INSTALL_QMLDIR" qt6.qtbase.qtQmlPrefix)] ++ cmakeVersionFlags;
+ cmakeFlags =
+ [
+ (lib.cmakeBool "PLUGIN_ONLY" true)
+ (lib.cmakeFeature "INSTALL_QMLDIR" qt6.qtbase.qtQmlPrefix)
+ ]
+ ++ cmakeVersionFlags;
};
in
stdenv.mkDerivation {
@@ -102,11 +118,12 @@ in
propagatedBuildInputs = runtimeDeps;
cmakeBuildType = "Release";
- cmakeFlags = [
- (lib.cmakeBool "DONT_BUILD_PLUGIN" true)
- (lib.cmakeBool "DONT_BUILD_ASSETS" true)
- (lib.cmakeFeature "INSTALL_QSCONFDIR" "${placeholder "out"}/share/caelestia-shell")
- ] ++ cmakeVersionFlags;
+ cmakeFlags =
+ [
+ (lib.cmakeBool "SHELL_ONLY" true)
+ (lib.cmakeFeature "INSTALL_QSCONFDIR" "${placeholder "out"}/share/caelestia-shell")
+ ]
+ ++ cmakeVersionFlags;
prePatch = ''
substituteInPlace assets/pam.d/fprint \
@@ -120,6 +137,9 @@ in
--set CAELESTIA_LIB_DIR ${assets}/lib \
--set CAELESTIA_XKB_RULES_PATH ${xkeyboard-config}/share/xkeyboard-config-2/rules/base.lst \
--add-flags "-p $out/share/caelestia-shell"
+
+ mkdir -p $out/lib
+ ln -s ${assets}/lib/* $out/lib/
'';
passthru = {
diff --git a/plugin/CMakeLists.txt b/plugin/CMakeLists.txt
index a7b176b..a493c32 100644
--- a/plugin/CMakeLists.txt
+++ b/plugin/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 3.19)
find_package(Qt6 REQUIRED COMPONENTS Core Qml)
if(QT_KNOWN_POLICY_QTP0001)