diff options
| author | mtgmonkey <mtgmonkey@nixos> | 2025-12-08 13:40:11 +0100 |
|---|---|---|
| committer | mtgmonkey <mtgmonkey@nixos> | 2025-12-08 13:40:11 +0100 |
| commit | 20ecde081bf47c7790e93dd2282d5e666e01b9ce (patch) | |
| tree | e825e9091bbf3e169b9a86d4f545175cb99b3055 /package.nix | |
| parent | 852244a49159097a83fc99edcdad26f84f999098 (diff) | |
release v0.2.0
Diffstat (limited to 'package.nix')
| -rw-r--r-- | package.nix | 88 |
1 files changed, 31 insertions, 57 deletions
diff --git a/package.nix b/package.nix index f9513ce..1b6f738 100644 --- a/package.nix +++ b/package.nix @@ -2,64 +2,38 @@ haskellPackages, lib, stdenv, + ghcOptions, + haddockOptions, + ghcPackages, ... -}: let - ghcExeOptions = lib.concatStringsSep " " ghcFlags; - ghcFlags = [ - "-O" - "-Wall" - "-Widentities" - "-Wincomplete-record-updates" - "-Wincomplete-uni-patterns" - # "-Wmissing-export-lists" - "-Wmissing-home-modules" - "-Wpartial-fields" - "-Wredundant-constraints" - "-threaded" - "-rtsopts" - "-with-rtsopts=-N" - # src - "-i./src" - "-main-is Game" +}: +stdenv.mkDerivation { + pname = "hs-game"; + version = "0.1.0"; + src = ./.; + nativeBuildInputs = [ + (haskellPackages.ghcWithPackages ghcPackages) ]; - haddockOptions = lib.concatStringsSep " " haddockFlags; - haddockFlags = [ - "--html" - "--odir docs" - "--optghc=-i./src" - "src/Game/Main.hs" + buildInputs = [ ]; - ghcPackages = p: [ - p.GLFW-b - p.linear - p.OpenGL - ]; -in - stdenv.mkDerivation { - pname = "haskengl"; - version = "0.1.0"; - src = ./.; - nativeBuildInputs = [ - (haskellPackages.ghcWithPackages ghcPackages) - ]; - buildInputs = [ - ]; - configurePhase = '' - ''; - buildPhase = '' - ghc ${ghcExeOptions} ./src/Game/Main.hs -o ./Main - haddock ${haddockOptions} - ''; - installPhase = '' - mkdir -p $out/bin - cp ./Main $out/bin/hs-game - cp ./docs $out/docs -r - ''; + configurePhase = '' + ''; + buildPhase = '' + touch Main + ghc ${ghcOptions} ./src/Game.hs -o ./Main + mkdir ./docs + haddock ${haddockOptions} + ''; + installPhase = '' + mkdir -p $out/bin + cp ./Main $out/bin/hs-game + cp ./docs $out/docs -r + ''; - meta = { - homepage = "https://mtgmonkey.net"; - license = lib.licenses.wtfpl; - mainProgram = "hs-game"; - platforms = ["x86_64-linux"]; - }; - } + meta = { + homepage = "https://mtgmonkey.net"; + license = lib.licenses.bsd3; + mainProgram = "hs-game"; + platforms = ["x86_64-linux"]; + }; +} |
