I want to build the package syslock, but even though I added gtkmm4 in buildinput or nativebuildinput, it still says that the header file cannot be found.
syslock> src/window.hpp:2:10: fatal error: gtkmm/overlay.h: No such file or directory
syslock> 2 | #include <gtkmm/overlay.h>
syslock> | ^~~~~~~~~~~~~~~~~
syslock> compilation terminated.
syslock> make: *** [Makefile:78: src/main.o] Error 1
error: builder for '/nix/store/bb6si2f0zfr3jjamxvy62sz0als1w6q8-syslock-0.1.drv' failed with exit code 2;
last 10 log lines:
> to the PKG_CONFIG_PATH environment variable
> No package 'pam' found
> [2/14] Compiling src/main.o
> In file included from src/main.hpp:2,
> from src/main.cpp:1:
> src/window.hpp:2:10: fatal error: gtkmm/overlay.h: No such file or directory
> 2 | #include <gtkmm/overlay.h>
> | ^~~~~~~~~~~~~~~~~
> compilation terminated.
> make: *** [Makefile:78: src/main.o] Error 1
For full logs, run 'nix log /nix/store/bb6si2f0zfr3jjamxvy62sz0als1w6q8-syslock-0.1.drv'.
error: 1 dependencies of derivation '/nix/store/q3mp60aszg3i94l6j55hccv0kyfj2524-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/j6nkinlc9sk9q1alg7h6zjq812f59zwr-home-manager-generation.drv' failed to build
┏━ 1 Errors:
┃ error: builder for '/nix/store/bb6si2f0zfr3jjamxvy62sz0als1w6q8-syslock-0.1.drv' failed with exit code 2;
┃ last 10 log lines:
┃ > to the PKG_CONFIG_PATH environment variable
┃ > No package 'pam' found
┃ > [2/14] Compiling src/main.o
┃ > In file included from src/main.hpp:2,
┃ > from src/main.cpp:1:
┃ > src/window.hpp:2:10: fatal error: gtkmm/overlay.h: No such file or directory
┃ > 2 | #include <gtkmm/overlay.h>
┃ > | ^~~~~~~~~~~~~~~~~
┃ > compilation terminated.
┃ > make: *** [Makefile:78: src/main.o] Error 1
┃ For full logs, run 'nix log /nix/store/bb6si2f0zfr3jjamxvy62sz0als1w6q8-syslock-0.1.drv'
this derivation will be built:
/nix/store/yxgknrwcx6n22jzlldlsgwihpfmq2bpc-syslock-0.1.drv
these 2 paths will be fetched (0.05 MiB download, 0.33 MiB unpacked):
/nix/store/zjc38x3lskl1dhjbi3y31qxyfcbw21j8-gtk-session-lock-0.2.0
/nix/store/2xpchjmlj66g7085rj63in8yhx9b7153-gtk-session-lock-0.2.0-dev
copying path '/nix/store/zjc38x3lskl1dhjbi3y31qxyfcbw21j8-gtk-session-lock-0.2.0' from 'https://mirror.sjtu.edu.cn/nix-channels/store'...
copying path '/nix/store/2xpchjmlj66g7085rj63in8yhx9b7153-gtk-session-lock-0.2.0-dev' from 'https://mirror.sjtu.edu.cn/nix-channels/store'...
building '/nix/store/yxgknrwcx6n22jzlldlsgwihpfmq2bpc-syslock-0.1.drv'...
Running phase: unpackPhase
unpacking source archive /nix/store/39cljd7gq36shhbg8cjpwiwzvgnldg9j-source
source root is source
Running phase: patchPhase
Running phase: updateAutotoolsGnuConfigScriptsPhase
Running phase: configurePhase
no configure script, doing nothing
Running phase: buildPhase
build flags: SHELL=/nix/store/516kai7nl5dxr792c0nzq0jp8m4zvxpi-bash-5.2p32/bin/bash
[1/14] Creating src/git_info.hpp
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
[2/14] Compiling src/main.o
[3/14] Compiling src/config_parser.o
[4/14] Linking syslock
make: *** No rule to make target '/usr/share/wayland-protocols/staging/ext-session-lock/ext-session-lock-v1.xml', needed by 'src/ext-session-lock-v1.h'. Stop.
error: builder for '/nix/store/yxgknrwcx6n22jzlldlsgwihpfmq2bpc-syslock-0.1.drv' failed with exit code 2;
last 10 log lines:
> Running phase: buildPhase
> build flags: SHELL=/nix/store/516kai7nl5dxr792c0nzq0jp8m4zvxpi-bash-5.2p32/bin/bash
> [1/14] Creating src/git_info.hpp
> fatal: not a git repository (or any of the parent directories): .git
> fatal: not a git repository (or any of the parent directories): .git
> fatal: not a git repository (or any of the parent directories): .git
> [2/14] Compiling src/main.o
> [3/14] Compiling src/config_parser.o
> [4/14] Linking syslock
> make: *** No rule to make target '/usr/share/wayland-protocols/staging/ext-session-lock/ext-session-lock-v1.xml', needed by 'src/ext-session-lock-v1.h'. Stop.
For full logs, run 'nix log /nix/store/yxgknrwcx6n22jzlldlsgwihpfmq2bpc-syslock-0.1.drv'.
Side note: finalAttrs.pname should never be used in a url (which is effectively what you have by using it in fetchFromGitHub) because if you override pname, the fetcher will break. Just write out the string directly.
it works!
I copied the wrong thing when I borrowed from each other. Sysmenu did not help with the compilation results, so I added installPhase. Since I replaced pkg-conf like syshud, adding installPhase seems to cause a conflict or something. The directory of the configuration file was not successfully replaced.