Files
haskengl/package.nix
2025-11-30 18:31:17 +01:00

59 lines
1.1 KiB
Nix

{
haskellPackages,
lib,
stdenv,
...
}: let
ghcExeOptions = lib.concatStringsSep " " ghcFlags;
ghcFlags = [
"-O"
"-Wall"
"-Widentities"
"-Widentities"
"-Wincomplete-record-updates"
"-Wincomplete-uni-patterns"
"-Wmissing-export-lists"
"-Wmossing-home-modules"
"-Wpartial-fields"
"-Wredundant-constraints"
"-threaded"
"-rtsopts"
"-with-rtsopts=-N"
# hs-glsl
"-i./lib/hs-glsl/src/Language/GLSL.hs"
# src
"-i./src"
];
ghcPackages = p: [
p.GLFW-b
p.OpenGL
p.relude
];
in
stdenv.mkDerivation {
pname = "haskengl";
version = "0.1.0";
src = ./.;
nativeBuildInputs = [
(haskellPackages.ghcWithPackages ghcPackages)
];
buildInputs = [
];
configurePhase = ''
'';
buildPhase = ''
ghc ${ghcExeOptions} ./src/Main.hs -o ./Main
'';
installPhase = ''
mkdir -p $out/bin
cp ./Main $out/bin/haskengl
'';
meta = {
homepage = "https://mtgmonkey.net";
license = lib.licenses.wtfpl;
mainProgram = "haskengl";
platforms = ["x86_64-linux"];
};
}