A categorical programming language
リビジョン | 647dff389c3c5a8e7a21847cbccb934ac2289560 (tree) |
---|---|
日時 | 2024-10-01 02:24:20 |
作者 | Corbin <cds@corb...> |
コミッター | Corbin |
Use rpypkgs.
@@ -20,16 +20,16 @@ | ||
20 | 20 | }, |
21 | 21 | "nixpkgs": { |
22 | 22 | "locked": { |
23 | - "lastModified": 1682303062, | |
24 | - "narHash": "sha256-x+KAADp27lbxeoPXLUMxKcRsUUHDlg+qVjt5PjgBw9A=", | |
23 | + "lastModified": 1727540905, | |
24 | + "narHash": "sha256-40J9tW7Y794J7Uw4GwcAKlMxlX2xISBl6IBigo83ih8=", | |
25 | 25 | "owner": "NixOS", |
26 | 26 | "repo": "nixpkgs", |
27 | - "rev": "f5364316e314436f6b9c8fd50592b18920ab18f9", | |
27 | + "rev": "fbca5e745367ae7632731639de5c21f29c8744ed", | |
28 | 28 | "type": "github" |
29 | 29 | }, |
30 | 30 | "original": { |
31 | 31 | "owner": "NixOS", |
32 | - "ref": "nixos-22.11", | |
32 | + "ref": "nixos-24.05", | |
33 | 33 | "repo": "nixpkgs", |
34 | 34 | "type": "github" |
35 | 35 | } |
@@ -52,17 +52,17 @@ | ||
52 | 52 | ] |
53 | 53 | }, |
54 | 54 | "locked": { |
55 | - "lastModified": 1713582112, | |
56 | - "narHash": "sha256-/ceQxM6T0G1hH+mnvvkYEarhkKVTTfRun8xJduGvnLY=", | |
57 | - "ref": "refs/heads/master", | |
58 | - "rev": "80c99cc8a914a06c83177bc3ae6ddf2432b6175f", | |
59 | - "revCount": 30, | |
60 | - "type": "git", | |
61 | - "url": "git://git.pf.osdn.net/gitroot/c/co/corbin/rpypkgs.git" | |
55 | + "lastModified": 1723911733, | |
56 | + "narHash": "sha256-WtRxxafvuO+jIK/kKgr5gcnWOFt1QrpqGDlR/C1s97c=", | |
57 | + "owner": "rpypkgs", | |
58 | + "repo": "rpypkgs", | |
59 | + "rev": "1b4340ccbe2ddcca1feaa83ea61f5221407e7542", | |
60 | + "type": "github" | |
62 | 61 | }, |
63 | 62 | "original": { |
64 | - "type": "git", | |
65 | - "url": "git://git.pf.osdn.net/gitroot/c/co/corbin/rpypkgs.git" | |
63 | + "owner": "rpypkgs", | |
64 | + "repo": "rpypkgs", | |
65 | + "type": "github" | |
66 | 66 | } |
67 | 67 | }, |
68 | 68 | "systems": { |
@@ -1,7 +1,7 @@ | ||
1 | 1 | { |
2 | 2 | description = "Reference toolchain for Cammy"; |
3 | 3 | inputs = { |
4 | - nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11"; | |
4 | + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; | |
5 | 5 | flake-utils.url = "github:numtide/flake-utils"; |
6 | 6 | zaha = { |
7 | 7 | url = "github:mostawesomedude/zaha"; |
@@ -11,7 +11,7 @@ | ||
11 | 11 | }; |
12 | 12 | }; |
13 | 13 | rpypkgs = { |
14 | - url = "git://git.pf.osdn.net/gitroot/c/co/corbin/rpypkgs.git"; | |
14 | + url = "github:rpypkgs/rpypkgs"; | |
15 | 15 | inputs = { |
16 | 16 | nixpkgs.follows = "nixpkgs"; |
17 | 17 | flake-utils.follows = "flake-utils"; |
@@ -26,7 +26,10 @@ | ||
26 | 26 | }; |
27 | 27 | schemata = ./schemata; |
28 | 28 | jelly = import ./jelly { inherit pkgs; }; |
29 | - sampler = import ./sampler { inherit pkgs; }; | |
29 | + sampler = import ./sampler { | |
30 | + inherit pkgs; | |
31 | + inherit (rpypkgs.lib.${system}) mkRPythonDerivation; | |
32 | + }; | |
30 | 33 | bk = import ./bk { inherit pkgs schemata; }; |
31 | 34 | cammy = pkgs.stdenv.mkDerivation { |
32 | 35 | name = "cammy"; |
@@ -52,7 +55,7 @@ | ||
52 | 55 | # cp -R hive/ $lib/lib/cammy/ |
53 | 56 | ''; |
54 | 57 | }; |
55 | - py = pkgs.python39.withPackages (ps: [ | |
58 | + py = pkgs.python311.withPackages (ps: [ | |
56 | 59 | # maintaining cammy-rpy/ |
57 | 60 | ps.pyflakes |
58 | 61 | # Honey |
@@ -1,56 +1,15 @@ | ||
1 | -{ pkgs ? import <nixpkgs> {} }: | |
2 | -let | |
3 | - inherit (pkgs) | |
4 | - fetchhg stdenv | |
5 | - pkg-config libffi stb libcaca | |
6 | - python2 python2Packages; | |
7 | - # https://foss.heptapod.net/pypy/pypy/ | |
8 | - pypySrc = fetchhg { | |
9 | - url = "https://foss.heptapod.net/pypy/pypy"; | |
10 | - # tag release-pypy3.8-v7.3.11 | |
11 | - rev = "release-pypy3.8-v7.3.11"; | |
12 | - sha256 = "sha256-yHIY4cuCpfB0Nl1Odutc9w2QUPhWK+rxaSGfbBV+ZUg="; | |
13 | - }; | |
14 | -in | |
15 | - let | |
16 | - opt = if false then "jit" else "2"; | |
17 | - in stdenv.mkDerivation { | |
18 | - name = "sampler"; | |
1 | +{ pkgs, mkRPythonDerivation }: | |
2 | +mkRPythonDerivation { | |
3 | + entrypoint = "main.py"; | |
4 | + binName = "cammy-sample"; | |
5 | + optLevel = "2"; | |
6 | +} { | |
7 | + pname = "sampler"; | |
8 | + version = "2024"; | |
19 | 9 | |
20 | - # src = builtins.filterSource | |
21 | - # (path: type: baseNameOf path == ./main.py | |
22 | - # || builtins.match ".*cammylib.*" path != null) | |
23 | - # ./.; | |
24 | - srcs = builtins.filterSource | |
25 | - (path: type: type == "directory" | |
26 | - || builtins.match ".*\.py" (baseNameOf path) != null) | |
27 | - ./.; | |
10 | + src = ./.; | |
28 | 11 | |
29 | - buildInputs = [ | |
30 | - # always required | |
31 | - pkg-config stb libcaca | |
32 | - python2 python2Packages.py | |
33 | - # only required for JIT | |
34 | - python2Packages.pytest libffi | |
35 | - ]; | |
36 | - | |
37 | - prePatch = '' | |
38 | - mkdir -p ./rpython/_cache | |
39 | - cp -r ${pypySrc}/rpython . | |
40 | - chmod -R u+w rpython/ | |
41 | - ''; | |
42 | - | |
43 | - buildPhase = '' | |
44 | - source $stdenv/setup | |
45 | - # Do the actual translation. | |
46 | - ${python2}/bin/python2 -mrpython -O${opt} ./main.py | |
47 | - ''; | |
48 | - | |
49 | - installPhase = '' | |
50 | - mkdir -p $out/bin/ | |
51 | - cp ./cammy-sample $out/bin/ | |
52 | - ''; | |
53 | - | |
54 | - separateDebugInfo = true; | |
55 | - } | |
12 | + buildInputs = with pkgs; [ stb libcaca ]; | |
56 | 13 | |
14 | + separateDebugInfo = true; | |
15 | +} |