I’m trying to package wallock, a wallpaper daemon for wlroots compositors, but I’m getting an error during the build process. I’m using the build instructions from the wallock GitHub repository.
# wallock.nix
{
stdenv,
fetchFromGitHub,
cmake,
cpm-cmake,
wayland,
wayland-protocols,
egl-wayland,
libxkbcommon,
mesa,
mpv,
cairo,
fontconfig,
wget,
unzip,
}:
stdenv.mkDerivation rec {
name = "wallock";
version = "git";
src = fetchFromGitHub {
owner = "dpayne";
repo = "wallock";
rev = "main";
sha256 = "sha256-9EcdFGuH2hvtGYGNBbXbERAiALkP3jm7G5KYiAlD/Fk=";
};
buildInputs = [
cmake
cpm-cmake
wayland
wayland-protocols
egl-wayland
libxkbcommon
mesa
mpv
cairo
fontconfig
wget
unzip
];
postInstall = ''
mkdir -p $out/share/fonts
cp -r $src/fonts/* $out/share/fonts
fc-cache -fv
'';
buildPhase = ''
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -B build
cmake --build build
'';
installPhase = ''
cmake --install build
'';
}
# packages.nix
environment.systemPackages = let
wallock = pkgs.callPackage ../../pkgs/wallock.nix {};
in
with pkgs; [
wallock
];
This is the error I’m getting:
error: builder for '/nix/store/10blf5phnww4y1c3na8lm5kj68yd6aya-wallock.drv' failed with exit code 1;
last 10 log lines:
> CMakeLists.txt:31 (include)
>
>
> CMake Error at cmake/ProjectLibraries.cmake:1 (CPMAddPackage):
> Unknown CMake command "CPMAddPackage".
> Call Stack (most recent call first):
> CMakeLists.txt:32 (include)
>
>
> -- Configuring incomplete, errors occurred!
For full logs, run 'nix log /nix/store/10blf5phnww4y1c3na8lm5kj68yd6aya-wallock.drv'.
error: 1 dependencies of derivation '/nix/store/15difp825c010642lcq12fpg6klm27h3-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/6502fngasjqyb8hdml5xyllrkl23wsll-nixos-system-<MY CONFIG NAME HERE OMITTED FOR PRIVACY REASONS>-24.05.20240509.f1010e0.drv' failed to build
Any help will be greatly appreciated.