Skip to content

Commit dae7aa7

Browse files
committed
TODO complete overrides
1 parent e9a7363 commit dae7aa7

2 files changed

Lines changed: 59 additions & 12 deletions

File tree

contrib/luarocks-packages.csv

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
name,src,ref,server,version,luaversion,maintainers
22
ansicolors,,,,,,
33
bcrypt,,,,,,
4+
cloud_storage,,,,,,
45
date,,,,,,
56
etlua,,,,,,
67
lapis,,,,,,
78
lapis-console,,,,,5.1,
89
lapis-exceptions,,,,,5.1,
9-
pgmoon,,,,,,
10-
tableshape,,,,,,
10+
lzlib,,,,,5.1,
1111
mailgun,,,,,,
12-
cloud_storage,,,,,,
1312
mimetypes,,,,,,
13+
struct,,,,,5.1,
14+
pgmoon,,,,,,
15+
tableshape,,,,,,

flake.nix

Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,48 @@
1717
overlays = [ self.overlays.default ];
1818
};
1919

20+
# TODO fix in the overlay directly
21+
mylzlib = pkgs.lua5_1.pkgs.lzlib.overrideAttrs(oa: {
22+
# buildInputs = oa.buildInputs ++ [
23+
# pkgs.zlib.dev
24+
# pkgs.zlib.out
25+
# ];
26+
externalDeps = [
27+
{ name = "ZLIB"; dep = pkgs.zlib; }
28+
];
29+
# extraVariables = rec {
30+
# ZLIB_INCDIR = "${readline.dev}/include";
31+
# # { name = "ZLIB"; dep = pkgs.zlib; }
32+
# };
33+
34+
});
35+
36+
# myStruct =
37+
# # else we get 'unpacker appears to have produced no directories'
38+
# sourceRoot = ".";
39+
2040
# openresty uses luajit so we need lua5.1
21-
luaEnv = pkgs.lua5_1.withPackages (lp: [
22-
lp.luaexpat
23-
lp.busted
41+
luaEnv = pkgs.lua5_1.withPackages (lp: let
42+
43+
in [
2444
lp.bcrypt
25-
lp.luarocks
26-
lp.moonscript # provides moonc compiler
45+
lp.busted
46+
lp.cloud_storage
2747
lp.lapis
2848
lp.lapis-console
2949
lp.lapis-exceptions
30-
lp.tableshape
50+
lp.luaexpat
51+
lp.luarocks
3152
lp.mailgun
32-
lp.cloud_storage
53+
lp.moonscript # provides moonc compiler
54+
lp.tableshape
55+
lp.struct
56+
mylzlib
3357
# cloudstorage / zipwriter
3458

3559
]);
3660

61+
lua = pkgs.lua5_1;
3762
in
3863
{
3964

@@ -74,7 +99,7 @@
7499
# we should be able to do better
75100
shellHook =
76101
let
77-
luarocksContent = pkgs.lua.pkgs.luaLib.generateLuarocksConfig {
102+
luarocksContent = lua.pkgs.luaLib.generateLuarocksConfig {
78103

79104
externalDeps = [
80105
{ name = "EXPAT"; dep = pkgs.expat; }
@@ -107,6 +132,11 @@
107132
# if your pgsql server is configured via TCP
108133
export PGHOST=localhost
109134
135+
# Probably a fault in our lua infra
136+
export LUA_PATH="share/lua/${lua.luaversion}/?.lua;;"
137+
export LUA_CPATH="share/lua/${lua.luaversion}/?.lua;;"
138+
echo ${mylzlib.configFile}
139+
110140
'';
111141

112142
};
@@ -117,10 +147,25 @@
117147
let
118148
lua =
119149
let
120-
packageOverrides = prev.callPackage ./contrib/generated-packages.nix {
150+
# TODO
151+
152+
generatedOverrides = prev.callPackage ./contrib/generated-packages.nix {
121153
# as done in nixpkgs
122154
inherit (lua.pkgs) callPackage;
123155
};
156+
157+
packageOverrides = final: prev:
158+
let
159+
result = (generatedOverrides final prev) ;
160+
in (result // {
161+
# else we get 'unpacker appears to have produced no directories'
162+
# sourceRoot = ".";
163+
struct = result.struct.overrideAttrs(oa: {
164+
sourceRoot = ".";
165+
});
166+
167+
168+
});
124169
in
125170
(prev.lua5_1.override { inherit packageOverrides; self = lua; });
126171
in

0 commit comments

Comments
 (0)