Hello! I’m new to nix and trying my hand at my first derivation for a package that’s only available from source.
But when i run nix-build on the .nix file i made, I get errors like
> ./configure: line 14397: syntax error near unexpected token `GTK4,'
> ./configure: line 14397: ` PKG_CHECK_MODULES(GTK4, gtk4 >= 4.14)'
or if i disable the UI,
./configure: line 14406: syntax error near unexpected token `libusb,'
./configure: line 14406: `PKG_CHECK_MODULES(libusb, libusb, HAVE_LIBUSB=1, HAVE_LIBUSB=0)'
To me, this means the dependencies are not found? I tried placing them both as buildInputs and nativeBuildInputs it didn’t make a difference.
This is the derivation i’m working with based on some docs and guides i followed.
with import <nixpkgs> { }; # bring all of Nixpkgs into scope
stdenv.mkDerivation rec {
name = "overwitch";
# https://github.com/dagargo/overwitch
src = fetchFromGitHub {
owner = "dagargo";
repo = "overwitch";
tag = "2.2";
sha256 = "EYT5m4N9kzeYaOcm1furGGxw1k+Bw+m+FvONVZN9ohk=";
};
nativeBuildInputs = [ autoreconfHook libusb1 gtk4];
buildInputs = [ autoconf automake gettext libsndfile libtool libjack2 libsamplerate libjson];
configurePhase = "./configure";
installFlags = [ "DESTDIR=$(out)" ];
}
This is the package and it’s listed as having the following (debian) dependencies:
automake libtool libusb-1.0-0-dev libjack-jackd2-dev libsamplerate0-dev libsndfile1-dev autopoint gettext libsystemd-dev libjson-glib-dev libgtk-4-dev systemd-dev
For what it’s worth, i tried doing the same with nix-shell and got the same errors, but from what I could tell that’s expected.
NixOS version: 25.05
Thanks in advance!