I wanna develop a graphical application with Haskell using GLFW-b and it depends on GL and X libraries.
Currently I have this flake:
{
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system: {
packages.default =
nixpkgs.legacyPackages.${system}.haskellPackages.callPackage
./package.nix { };
});
}
and this package:
{ mkDerivation, base, GLFW-b, lib }:
mkDerivation {
pname = package-name;
version = "0.1.0.0";
src = ./.;
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [ base GLFW-b containers ];
doHaddock = false;
license = lib.licenses.mit;
}
But of course, this isn’t enough, because GLFW-b also depends on some native libraries.
So when I nix develop
and then cabal build
, I get this error:
* Missing (or bad) C libraries: GL, X11, Xi, Xrandr, Xxf86vm, Xcursor,
Xinerama
How can I include the native libraries in the mkDerivation call? I tried looking up the definition of mkDerivation
but it’s unhelpful.