I have been attempting to package this project github.com/jeremija/wl-gammarelay and I’ve been having a lot of trouble. It uses CGO and has a Makefile that builds the wayland protocols and then runs “go build”
Im trying to wrap my head around this but every single source has radically different information on how this is to be done, and none of them have been particularly helpful. This was my first attempt, I also tried to use stdenv.mkDerivation alongside build phases but I cannot even get my feet off the ground here. I’m getting extremely generic errors like “cannot evaluate a function that does not have a value”
Any advice would be greatly appreciated, Im gearing up to learn Nix and make the switch over and this was a major package that I use that is not available in Nixpkgs. Of course there are alternatives but they do not also configure brightness and I hate that they are timer based, whereas wl-gammarelay is a simple daemon that responds to keybindings.
{
lib,
stdenv,
fetchFromGitHub,
wayland,
# wlr-protocols,
# pkg-config,
# make,
buildGoModule
}:
buildGoModule rec {
pname = "wl-gammarelay";
version = "0.1.1";
src = fetchFromGitHub {
owner = "jeremija";
repo = pname;
# rev = "b384bee6e2610f7ef9efd9f92778d52d4507dfb2";
rev = "${version}";
sha256 = "sha256-zk1U6bJpQrQXujbcqKjqSc0E+TxKY+p9w6sH8XYPm1c=";
};
# vendorHash = lib.fakeHash;
# modHash = lib.fakeHash;
nativeBuildInputs = [ wayland stdenv go glibc.static ];
CGO_ENABLED = 1;
ldflags = [
"-X main.Version=${version}"
];
# subPackages = [ "." ];
meta = with stdenv.lib; {
description = "A client and daemon for changing color temperature and brightness under Wayland via keybindings.";
homepage = "https://github.com/jeremija/wl-gammarelay";
license = licenses.gplv3;
maintainers = with maintainers; [ sweetbbak ];
};
};
}