mpboyer commited on
Commit
0d334ec
·
1 Parent(s): 38c0f49

add nix env for local work

Browse files
Files changed (3) hide show
  1. jericho-makefile.patch +15 -0
  2. jericho.nix +42 -0
  3. shell.nix +12 -0
jericho-makefile.patch ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/frotz/Makefile b/frotz/Makefile
2
+ index e56f6e6..7815b08 100644
3
+ --- a/frotz/Makefile
4
+ +++ b/frotz/Makefile
5
+ @@ -1,8 +1,8 @@
6
+ # Define path for ar
7
+ -AR = /usr/bin/ar
8
+ +AR ?= /usr/bin/ar
9
+
10
+ # Define path for ranlib
11
+ -RANLIB = /usr/bin/ranlib
12
+ +RANLIB ?= /usr/bin/ranlib
13
+
14
+ # Define your C compiler. I recommend gcc if you have it.
15
+ # MacOS users should use "cc" even though it's really "gcc".
jericho.nix ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ lib,
3
+ python3,
4
+ fetchFromGitHub,
5
+ }:
6
+
7
+ python3.pkgs.buildPythonApplication rec {
8
+ pname = "jericho";
9
+ version = "3.3.1";
10
+ pyproject = true;
11
+
12
+ src = fetchFromGitHub {
13
+ owner = "microsoft";
14
+ repo = "jericho";
15
+ rev = version;
16
+ hash = "sha256-KNBnKr1ve4qrYdTHaSR8CjNXp3BsRsGgIrVGGyTS3mI=";
17
+ };
18
+
19
+ build-system = [
20
+ python3.pkgs.setuptools
21
+ python3.pkgs.wheel
22
+ ];
23
+
24
+ dependencies = with python3.pkgs; [
25
+ numpy
26
+ spacy
27
+ termcolor
28
+ ];
29
+
30
+ pythonImportsCheck = [
31
+ "jericho"
32
+ ];
33
+ patches = [ ./jericho-makefile.patch ];
34
+
35
+ meta = {
36
+ description = "A learning environment for man-made Interactive Fiction games";
37
+ homepage = "https://github.com/microsoft/jericho";
38
+ license = lib.licenses.gpl2Only;
39
+ maintainers = with lib.maintainers; [ ];
40
+ mainProgram = "jericho";
41
+ };
42
+ }
shell.nix ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ pkgs ? import <nixpkgs> { },
3
+ lib ? import <lib> { },
4
+ }:
5
+
6
+ pkgs.mkShell {
7
+ packages = [
8
+ pkgs.python313Packages.fastmcp
9
+ pkgs.python313Packages.spacy
10
+ (pkgs.callPackage ./jericho.nix { })
11
+ ];
12
+ }