corazza / game-idris

A 2D platformer in Idris, a dependently-typed purely functional programming language
https://corazza.github.io/2020/01/13/a-game-in-a-pure-language-part-1-introduction-and-problems-with-idris.html
24 stars 2 forks source link

Errors when trying to build #1

Open galtys opened 3 years ago

galtys commented 3 years ago

Hello Jan, I'm trying to build your game on nixos2009 and I get the following errors:

[nix-shell:~/github.com/game-idris]$ idris --build game.ipkg 
Entering directory `./src'
Type checking ./Descriptions/ObjectDescription/RenderDescription.idr
./Descriptions/ObjectDescription/RenderDescription.idr:17:21-21:44:
   |
17 |   objectCast dict = with Checked do
   |                     ~~~~~~~~~~~~~~~ ...
When checking right hand side of GameIO.Descriptions.ObjectDescription.RenderDescription.EquipmentRender implementation of GameIO.ObjectCaster, method objectCast with expected type
        Checked EquipmentRender

Can't disambiguate since no name has a suitable type: 
        Control.ST.Loop.>>=, Control.ST.>>=

./Descriptions/ObjectDescription/RenderDescription.idr:23:1-25:
   |
23 | Serialize EquipmentRender where
   | ~~~~~~~~~~~~~~~~~~~~~~~~~
When checking type of Serializer.Descriptions.ObjectDescription.RenderDescription.EquipmentRender implementation of Serializer.Serialize, method toDict:
No such variable Prelude.List.List

./Descriptions/ObjectDescription/RenderDescription.idr:31:1-37:35:
   |
31 | public export
   | ~~~~~~~~~~~~~ ...
When checking type of Descriptions.ObjectDescription.RenderDescription.MkAnimationParameters:
No such variable Maybe

Would you know how to address them?

galtys commented 3 years ago

[nix-shell:~/github.com/game-idris]$ idris --version 1.3.3-git:PRE

galtys commented 3 years ago

Using shell.nix as follows:

{ pkgs ? import <nixpkgs> {} }:
with pkgs;

let

  idris_sdl2 = pkgs.idrisPackages.build-idris-package rec {
    name = "idris_sdl2";
    version = "v4";

    ipkgName = "sdl2";
    idrisDeps = [pkgs.idrisPackages.contrib pkgs.idrisPackages.containers];
    src = fetchFromGitHub {
      owner = "corazza";
      repo = "idris-sdl2";
      rev = "f4ce327bda93cfb0832399c9b75e3f5a71cf31c4";

      sha256 = "1s3y19z0d5w0wrwxcmbjkc2py70vih6yz7cah15kbmsh0cmh4kj7";
    };
    extraBuildInputs = [pkgs.SDL2 pkgs.SDL2_gfx pkgs.SDL2_mixer pkgs.SDL2_image pkgs.SDL2_ttf pkgs.pkgconfig];
    meta = {
      description = "sdl2";
      homepage = "https://github.com/corazza/idris-sdl2";
      license = lib.licenses.bsd2;
      maintainers = [];
    };
  };

  idris_box2d = pkgs.idrisPackages.build-idris-package rec {
    name = "idris_boz2d";
    version = "v4";

    ipkgName = "box2d";
    idrisDeps = [pkgs.idrisPackages.contrib pkgs.idrisPackages.containers pkgs.box2d];
    src = fetchFromGitHub {
      owner = "corazza";
      repo = "idris-box2d";
      rev = "5eb58b2de09d72e9f8993852832f6906cdf3e054";

      sha256 = "1blkpxl0ds1v4ql7h7bbnlqka5fqs0ay2zb40vwjvzxf5abpk0cr";
    };
  #extraBuildInputs = [pkgs.idrisPackages.contrib];
    meta = {
      description = "box2d";
      homepage = "https://github.com/corazza/idris-box2d";
      license = lib.licenses.bsd2;
      maintainers = [];
    };
  };

in 

stdenv.mkDerivation {
  name = "idris-env";
  buildInputs = [
    (idrisPackages.with-packages (with idrisPackages; [ contrib base prelude containers effects idris_sdl2 idris_box2d]))
    gmp
    pkgs.pkgconfig
    pkgs.SDL2
    pkgs.SDL2_gfx
    pkgs.SDL2_mixer
    pkgs.SDL2_ttf
    pkgs.SDL2_image
  ];
}
lsap commented 9 months ago

stefan-hoeck/idris2-pack might be the replacement of nix one day after the game-idris mirations to Idris 2 (if any).