1/* This file defines the composition for Lua packages. It has
2 been factored out of all-packages.nix because there are many of
3 them. Also, because most Nix expressions for Lua packages are
4 trivial, most are actually defined here. I.e. there's no function
5 for each package in a separate file: the call to the function would
6 be almost as must code as the function itself. */
7
8{ fetchurl, fetchzip, stdenv, lua, callPackage, unzip, zziplib, pkgconfig, libtool
9, pcre, oniguruma, gnulib, tre, glibc, sqlite, openssl, expat, cairo
10, perl, gtk2, python, glib, gobjectIntrospection, libevent, zlib, autoreconfHook
11, mysql, postgresql, cyrus_sasl
12, fetchFromGitHub, libmpack, which, fetchpatch, writeText
13}:
14
15let
16 isLua51 = lua.luaversion == "5.1";
17 isLua52 = lua.luaversion == "5.2";
18 isLuaJIT = (builtins.parseDrvName lua.name).name == "luajit";
19
20 platformString =
21 if stdenv.isDarwin then "macosx"
22 else if stdenv.isFreeBSD then "freebsd"
23 else if stdenv.isLinux then "linux"
24 else if stdenv.isSunOS then "solaris"
25 else throw "unsupported platform";
26
27 self = _self;
28 _self = with self; {
29 inherit lua;
30 inherit (stdenv.lib) maintainers;
31
32 # helper functions for dealing with LUA_PATH and LUA_CPATH
33 getPath = lib : type : "${lib}/lib/lua/${lua.luaversion}/?.${type};${lib}/share/lua/${lua.luaversion}/?.${type}";
34 getLuaPath = lib : getPath lib "lua";
35 getLuaCPath = lib : getPath lib "so";
36
37 #define build lua package function
38 buildLuaPackage = callPackage ../development/lua-modules/generic {
39 inherit lua writeText;
40 };
41
42 luarocks = callPackage ../development/tools/misc/luarocks {
43 inherit lua;
44 };
45
46 luabitop = buildLuaPackage rec {
47 version = "1.0.2";
48 name = "bitop-${version}";
49
50 src = fetchurl {
51 url = "http://bitop.luajit.org/download/LuaBitOp-${version}.tar.gz";
52 sha256 = "16fffbrgfcw40kskh2bn9q7m3gajffwd2f35rafynlnd7llwj1qj";
53 };
54
55 buildFlags = stdenv.lib.optionalString stdenv.isDarwin "macosx";
56
57 postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
58 substituteInPlace Makefile --replace 10.4 10.5
59 '';
60
61 preBuild = ''
62 makeFlagsArray=(
63 ${stdenv.lib.optionalString stdenv.cc.isClang "CC=$CC"}
64 INCLUDES="-I${lua}/include"
65 LUA="${lua}/bin/lua");
66 '';
67
68 installPhase = ''
69 mkdir -p $out/lib/lua/${lua.luaversion}
70 install -p bit.so $out/lib/lua/${lua.luaversion}
71 '';
72
73 meta = with stdenv.lib; {
74 description = "C extension module for Lua which adds bitwise operations on numbers";
75 homepage = "http://bitop.luajit.org";
76 license = licenses.mit;
77 maintainers = with maintainers; [ ];
78 };
79 };
80
81 luacheck = buildLuaPackage rec {
82 pname = "luacheck";
83 version = "0.20.0";
84 name = "${pname}-${version}";
85
86 src = fetchFromGitHub {
87 owner = "mpeterv";
88 repo = "luacheck";
89 rev = "${version}";
90 sha256 = "0ahfkmqcjhlb7r99bswy1sly6d7p4pyw5f4x4fxnxzjhbq0c5qcs";
91 };
92
93 propagatedBuildInputs = [ lua ];
94
95 # No Makefile.
96 dontBuild = true;
97
98 installPhase = ''
99 ${lua}/bin/lua install.lua $out
100 '';
101
102 meta = with stdenv.lib; {
103 description = "A tool for linting and static analysis of Lua code";
104 homepage = https://github.com/mpeterv/luacheck;
105 license = licenses.mit;
106 maintainers = with maintainers; [ vyp ];
107 platforms = platforms.unix;
108 };
109 };
110
111 luacyrussasl = buildLuaPackage rec {
112 version = "1.1.0";
113 name = "lua-cyrussasl-${version}";
114 src = fetchFromGitHub {
115 owner = "JorjBauer";
116 repo = "lua-cyrussasl";
117 rev = "v${version}";
118 sha256 = "14kzm3vk96k2i1m9f5zvpvq4pnzaf7s91h5g4h4x2bq1mynzw2s1";
119 };
120
121 preBuild = ''
122 makeFlagsArray=(
123 CFLAGS="-O2 -fPIC"
124 LDFLAGS="-O -shared -fpic -lsasl2"
125 LUAPATH="$out/share/lua/${lua.luaversion}"
126 CPATH="$out/lib/lua/${lua.luaversion}"
127 );
128 mkdir -p $out/{share,lib}/lua/${lua.luaversion}
129 '';
130
131 buildInputs = [ cyrus_sasl ];
132
133 meta = with stdenv.lib; {
134 homepage = "https://github.com/JorjBauer/lua-cyrussasl";
135 description = "Cyrus SASL library for Lua 5.1+";
136 license = licenses.bsd3;
137 };
138 };
139
140 luaevent = buildLuaPackage rec {
141 version = "0.4.3";
142 name = "luaevent-${version}";
143 disabled = isLua52;
144
145 src = fetchFromGitHub {
146 owner = "harningt";
147 repo = "luaevent";
148 rev = "v${version}";
149 sha256 = "1c1n2zqx5rwfwkqaq1jj8gvx1vswvbihj2sy445w28icz1xfhpik";
150 };
151
152 preBuild = ''
153 makeFlagsArray=(
154 INSTALL_DIR_LUA="$out/share/lua/${lua.luaversion}"
155 INSTALL_DIR_BIN="$out/lib/lua/${lua.luaversion}"
156 LUA_INC_DIR="${lua}/include"
157 );
158 '';
159
160 buildInputs = [ libevent ];
161
162 propagatedBuildInputs = [ luasocket ];
163
164 meta = with stdenv.lib; {
165 homepage = http://luaforge.net/projects/luaevent/;
166 description = "Binding of libevent to Lua";
167 license = licenses.mit;
168 maintainers = with maintainers; [ koral ];
169 };
170 };
171
172 luaexpat = buildLuaPackage rec {
173 version = "1.3.0";
174 name = "expat-${version}";
175
176 src = fetchurl {
177 url = "https://matthewwild.co.uk/projects/luaexpat/luaexpat-${version}.tar.gz";
178 sha256 = "1hvxqngn0wf5642i5p3vcyhg3pmp102k63s9ry4jqyyqc1wkjq6h";
179 };
180
181 buildInputs = [ expat ];
182
183 preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
184 substituteInPlace Makefile \
185 --replace '-shared' '-bundle -undefined dynamic_lookup -all_load'
186 '';
187
188 preBuild = ''
189 makeFlagsArray=(
190 LUA_LDIR="$out/share/lua/${lua.luaversion}"
191 LUA_INC="-I${lua}/include" LUA_CDIR="$out/lib/lua/${lua.luaversion}"
192 EXPAT_INC="-I${expat.dev}/include");
193 '';
194
195 disabled = isLuaJIT;
196
197 meta = with stdenv.lib; {
198 description = "SAX XML parser based on the Expat library";
199 homepage = "http://matthewwild.co.uk/projects/luaexpat";
200 license = licenses.mit;
201 maintainers = with maintainers; [ flosse ];
202 platforms = platforms.unix;
203 };
204 };
205
206 luadbi = buildLuaPackage rec {
207 name = "luadbi-${version}";
208 version = "0.5";
209 src = fetchurl {
210 url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/luadbi/luadbi.${version}.tar.gz";
211 sha256 = "07ikxgxgfpimnwf7zrqwcwma83ss3wm2nzjxpwv2a1c0vmc684a9";
212 };
213 sourceRoot = ".";
214
215 buildInputs = [ mysql.connector-c postgresql sqlite ];
216
217 preConfigure = ''
218 substituteInPlace Makefile --replace CC=gcc CC=cc
219 '' + stdenv.lib.optionalString stdenv.isDarwin ''
220 substituteInPlace Makefile \
221 --replace '-shared' '-bundle -undefined dynamic_lookup -all_load'
222 '';
223
224 NIX_CFLAGS_COMPILE = [
225 "-I${mysql.connector-c}/include/mysql"
226 "-L${mysql.connector-c}/lib/mysql"
227 "-I${postgresql}/include/server"
228 ];
229
230 installPhase = ''
231 mkdir -p $out/lib/lua/${lua.luaversion}
232 install -p DBI.lua *.so $out/lib/lua/${lua.luaversion}
233 '';
234
235 meta = with stdenv.lib; {
236 homepage = "https://code.google.com/archive/p/luadbi/";
237 platforms = stdenv.lib.platforms.unix;
238 };
239 };
240
241 luafilesystem = buildLuaPackage rec {
242 version = "1.6.3";
243 name = "filesystem-${version}";
244
245 src = fetchFromGitHub {
246 owner = "keplerproject";
247 repo = "luafilesystem";
248 rev = "v${stdenv.lib.replaceChars ["."] ["_"] version}";
249 sha256 = "1hxcnqj53540ysyw8fzax7f09pl98b8f55s712gsglcdxp2g2pri";
250 };
251
252 preConfigure = ''
253 substituteInPlace config --replace "CC= gcc" "";
254 ''
255 + stdenv.lib.optionalString stdenv.isDarwin ''
256 substituteInPlace config \
257 --replace 'LIB_OPTION= -shared' '###' \
258 --replace '#LIB_OPTION= -bundle' 'LIB_OPTION= -bundle'
259 substituteInPlace Makefile --replace '10.3' '10.5'
260 '';
261
262 meta = with stdenv.lib; {
263 description = "Lua library complementing filesystem-related functions";
264 homepage = "https://github.com/keplerproject/luafilesystem";
265 license = licenses.mit;
266 maintainers = with maintainers; [ flosse ];
267 platforms = platforms.unix;
268 };
269 };
270
271 luaposix = buildLuaPackage rec {
272 name = "posix-${version}";
273 version = "33.4.0";
274
275 src = fetchFromGitHub {
276 owner = "luaposix";
277 repo = "luaposix";
278 rev = "release-v${version}";
279 sha256 = "0y531p54lx2yf243bcsyp6sv8fvbqidp20yry0xvb85p8zw9dlrq";
280 };
281
282 buildInputs = [ perl ];
283
284 meta = with stdenv.lib; {
285 description = "Lua bindings for POSIX API";
286 homepage = "https://github.com/luaposix/luaposix";
287 license = licenses.mit;
288 maintainers = with maintainers; [ vyp ];
289 platforms = platforms.unix;
290 };
291 };
292
293 lpty = buildLuaPackage rec {
294 version = "1.2.1";
295 name = "lpty-${version}";
296
297 src = fetchurl {
298 url = "http://www.tset.de/downloads/lpty-${version}-1.tar.gz";
299 sha256 = "0rgvbpymcgdkzdwfag607xfscs9xyqxg0dj0qr5fv906mi183gs6";
300 };
301
302 preBuild = ''
303 makeFlagsArray=(
304 INST_LIBDIR="$out/lib/lua/${lua.luaversion}"
305 INST_LUADIR="$out/share/lua/${lua.luaversion}"
306 LUA_BINDIR="${lua}/bin"
307 LUA_INCDIR="-I${lua}/include"
308 LUA_LIBDIR="-L${lua}/lib"
309 );
310 '';
311
312 meta = with stdenv.lib; {
313 description = "PTY control for Lua";
314 homepage = "http://www.tset.de/lpty";
315 license = licenses.mit;
316 maintainers = with maintainers; [ vyp ];
317 platforms = platforms.linux;
318 };
319 };
320
321 lua-iconv = buildLuaPackage rec {
322 name = "lua-iconv-${version}";
323 version = "7";
324
325 src = fetchFromGitHub {
326 owner = "ittner";
327 repo = "lua-iconv";
328 rev = name;
329 sha256 = "0rd76966qlxfp8ypkyrbif76nxnm1acclqwfs45wz3972jsk654i";
330 };
331
332 preBuild = ''
333 makeFlagsArray=(
334 INSTALL_PATH="$out/lib/lua/${lua.luaversion}"
335 );
336 '';
337
338 meta = with stdenv.lib; {
339 description = "Lua bindings for POSIX iconv";
340 homepage = "https://ittner.github.io/lua-iconv/";
341 license = licenses.mit;
342 maintainers = with maintainers; [ richardipsum ];
343 platforms = platforms.unix;
344 };
345 };
346
347 luasec = buildLuaPackage rec {
348 name = "sec-0.6";
349
350 src = fetchFromGitHub {
351 owner = "brunoos";
352 repo = "luasec";
353 rev = "lua${name}";
354 sha256 = "0wv8l7f7na7kw5xn8mjik2wpxbizl7zvvp5s7fcwvz9kl5jdpk5b";
355 };
356
357 buildInputs = [ openssl ];
358
359 preBuild = ''
360 makeFlagsArray=(
361 ${platformString}
362 LUAPATH="$out/lib/lua/${lua.luaversion}"
363 LUACPATH="$out/lib/lua/${lua.luaversion}"
364 INC_PATH="-I${lua}/include"
365 LIB_PATH="-L$out/lib");
366 '';
367
368 meta = with stdenv.lib; {
369 description = "Lua binding for OpenSSL library to provide TLS/SSL communication";
370 homepage = "https://github.com/brunoos/luasec";
371 license = licenses.mit;
372 maintainers = with maintainers; [ flosse ];
373 platforms = platforms.unix;
374 };
375 };
376
377 luasocket = buildLuaPackage rec {
378 name = "socket-${version}";
379 version = "3.0-rc1";
380
381 src = fetchFromGitHub {
382 owner = "diegonehab";
383 repo = "luasocket";
384 rev = "v${version}";
385 sha256 = "1chs7z7a3i3lck4x7rz60ziwbf793gw169hpjdfca8y4yf1hzsxk";
386 };
387
388 patchPhase = stdenv.lib.optionalString stdenv.isDarwin ''
389 substituteInPlace src/makefile --replace gcc cc \
390 --replace 10.3 10.5
391 '';
392
393 preBuild = ''
394 makeFlagsArray=(
395 LUAV=${lua.luaversion}
396 PLAT=${platformString}
397 prefix=$out
398 );
399 '';
400
401 installTargets = [ "install" "install-unix" ];
402
403 meta = with stdenv.lib; {
404 description = "Network support for Lua";
405 homepage = "http://w3.impa.br/~diego/software/luasocket/";
406 license = licenses.mit;
407 maintainers = with maintainers; [ ];
408 platforms = with platforms; darwin ++ linux ++ freebsd ++ illumos;
409 };
410 };
411
412 luxio = buildLuaPackage rec {
413 name = "luxio-${version}";
414 version = "13";
415
416 src = fetchurl {
417 url = "https://git.gitano.org.uk/luxio.git/snapshot/luxio-luxio-13.tar.bz2";
418 sha256 = "1hvwslc25q7k82rxk461zr1a2041nxg7sn3sw3w0y5jxf0giz2pz";
419 };
420
421 nativeBuildInputs = [ which pkgconfig ];
422
423 postPatch = ''
424 patchShebangs .
425 '';
426
427 preBuild = ''
428 makeFlagsArray=(
429 INST_LIBDIR="$out/lib/lua/${lua.luaversion}"
430 INST_LUADIR="$out/share/lua/${lua.luaversion}"
431 LUA_BINDIR="$out/bin"
432 INSTALL=install
433 );
434 '';
435
436 meta = with stdenv.lib; {
437 description = "Lightweight UNIX I/O and POSIX binding for Lua";
438 homepage = "https://www.gitano.org.uk/luxio/";
439 license = licenses.mit;
440 maintainers = with maintainers; [ richardipsum ];
441 platforms = platforms.unix;
442 };
443 };
444
445 luazip = buildLuaPackage rec {
446 name = "zip-${version}";
447 version = "2007-10-30";
448
449 src = fetchFromGitHub {
450 owner = "luaforge";
451 repo = "luazip";
452 rev = "0b8f5c958e170b1b49f05bc267bc0351ad4dfc44";
453 sha256 = "0zrrwhmzny5zbpx91bjbl77gzkvvdi3qhhviliggp0aj8w3faxsr";
454 };
455
456 buildInputs = [ zziplib ];
457
458 patches = [ ../development/lua-modules/zip.patch ];
459
460 # Does not currently work under Lua 5.2 or LuaJIT.
461 disabled = isLua52 || isLuaJIT;
462
463 meta = with stdenv.lib; {
464 description = "Lua library to read files stored inside zip files";
465 homepage = "https://github.com/luaforge/luazip";
466 license = licenses.mit;
467 maintainers = with maintainers; [ vyp ];
468 platforms = platforms.linux;
469 };
470 };
471
472 luazlib = buildLuaPackage rec {
473 name = "zlib-${version}";
474 version = "1.1";
475
476 src = fetchFromGitHub {
477 owner = "brimworks";
478 repo = "lua-zlib";
479 rev = "v${version}";
480 sha256 = "1520lk4xpf094xn2zallqgqhs0zb4w61l49knv9y8pmhkdkxzzgy";
481 };
482
483 buildInputs = [ zlib ];
484
485 preConfigure = ''
486 substituteInPlace Makefile --replace gcc cc --replace "-llua" ""
487 '';
488
489 preBuild = ''
490 makeFlagsArray=(
491 ${platformString}
492 LUAPATH="$out/share/lua/${lua.luaversion}"
493 LUACPATH="$out/lib/lua/${lua.luaversion}"
494 INCDIR="-I${lua}/include"
495 LIBDIR="-L${lua}/lib");
496 '';
497
498 preInstall = "mkdir -p $out/lib/lua/${lua.luaversion}";
499
500 meta = with stdenv.lib; {
501 description = "Simple streaming interface to zlib for Lua";
502 homepage = https://github.com/brimworks/lua-zlib;
503 license = licenses.mit;
504 maintainers = with maintainers; [ koral ];
505 platforms = platforms.unix;
506 };
507 };
508
509
510 luastdlib = buildLuaPackage rec {
511 name = "stdlib-${version}";
512 version = "41.2.1";
513
514 src = fetchFromGitHub {
515 owner = "lua-stdlib";
516 repo = "lua-stdlib";
517 rev = "release-v${version}";
518 sha256 = "03wd1qvkrj50fjszb2apzdkc8d5bpfbbi9pajl0vbrlzzmmi3jlq";
519 };
520
521 nativeBuildInputs = [ autoreconfHook unzip ];
522
523 meta = with stdenv.lib; {
524 description = "General Lua libraries";
525 homepage = "https://github.com/lua-stdlib/lua-stdlib";
526 license = licenses.mit;
527 maintainers = with maintainers; [ vyp ];
528 platforms = platforms.linux;
529 };
530 };
531
532 lrexlib = buildLuaPackage rec {
533 name = "lrexlib-${version}";
534 version = "2.8.0";
535
536 src = fetchFromGitHub {
537 owner = "rrthomas";
538 repo = "lrexlib";
539 rev = "rel-2-8-0";
540 sha256 = "1c62ny41b1ih6iddw5qn81gr6dqwfffzdp7q6m8x09zzcdz78zhr";
541 };
542
543 buildInputs = [ luastdlib pcre luarocks oniguruma gnulib tre glibc ];
544
545 buildPhase = let
546 luaVariable = ''LUA_PATH="${luastdlib}/share/lua/${lua.luaversion}/?/init.lua;${luastdlib}/share/lua/${lua.luaversion}/?.lua"'';
547 pcreVariable = "PCRE_DIR=${pcre.out} PCRE_INCDIR=${pcre.dev}/include";
548 onigVariable = "ONIG_DIR=${oniguruma}";
549 gnuVariable = "GNU_INCDIR=${gnulib}/lib";
550 treVariable = "TRE_DIR=${tre}";
551 posixVariable = "POSIX_DIR=${glibc.dev}";
552 in ''
553 sed -e 's@$(LUAROCKS) $(LUAROCKS_COMMAND) $$i;@$(LUAROCKS) $(LUAROCKS_COMMAND) $$i ${pcreVariable} ${onigVariable} ${gnuVariable} ${treVariable} ${posixVariable};@' -i Makefile
554 ${luaVariable} make
555 '';
556
557 installPhase = ''
558 mkdir -pv $out;
559 cp -r luarocks/lib $out;
560 '';
561
562 meta = with stdenv.lib; {
563 description = "Lua bindings of various regex library APIs";
564 homepage = "https://github.com/rrthomas/lrexlib";
565 license = licenses.mit;
566 maintainers = with maintainers; [ vyp ];
567 platforms = platforms.linux;
568 };
569 };
570
571 luasqlite3 = buildLuaPackage rec {
572 name = "sqlite3-${version}";
573 version = "2.3.0";
574
575 src = fetchFromGitHub {
576 owner = "LuaDist";
577 repo = "luasql-sqlite3";
578 rev = version;
579 sha256 = "05k8zs8nsdmlwja3hdhckwknf7ww5cvbp3sxhk2xd1i3ij6aa10b";
580 };
581
582 buildInputs = [ sqlite ];
583
584 patches = [ ../development/lua-modules/luasql.patch ];
585
586 meta = with stdenv.lib; {
587 description = "Database connectivity for Lua";
588 homepage = "https://github.com/LuaDist/luasql-sqlite3";
589 license = licenses.mit;
590 maintainers = with maintainers; [ vyp ];
591 platforms = platforms.linux;
592 };
593 };
594
595 lpeg = buildLuaPackage rec {
596 name = "lpeg-${version}";
597 version = "0.12";
598
599 src = fetchurl {
600 url = "http://www.inf.puc-rio.br/~roberto/lpeg/${name}.tar.gz";
601 sha256 = "0xlbfw1w7l65a5qhnx5sfw327hkq1zcj8xmg4glfw6fj9ha4b9gg";
602 };
603
604 preBuild = ''
605 makeFlagsArray=(CC=$CC);
606 '';
607
608 buildFlags = platformString;
609
610 installPhase = ''
611 mkdir -p $out/lib/lua/${lua.luaversion}
612 install -p lpeg.so $out/lib/lua/${lua.luaversion}
613 install -p re.lua $out/lib/lua/${lua.luaversion}
614 '';
615
616 meta = with stdenv.lib; {
617 description = "Parsing Expression Grammars For Lua";
618 homepage = "http://www.inf.puc-rio.br/~roberto/lpeg/";
619 license = licenses.mit;
620 maintainers = with maintainers; [ vyp ];
621 platforms = platforms.all;
622 };
623 };
624
625 cjson = buildLuaPackage rec {
626 name = "cjson-${version}";
627 version = "2.1.0";
628
629 src = fetchurl {
630 url = "http://www.kyne.com.au/~mark/software/download/lua-${name}.tar.gz";
631 sha256 = "0y67yqlsivbhshg8ma535llz90r4zag9xqza5jx0q7lkap6nkg2i";
632 };
633
634 preBuild = ''
635 sed -i "s|/usr/local|$out|" Makefile
636 '';
637
638 makeFlags = [ "LUA_VERSION=${lua.luaversion}" ];
639
640 postInstall = ''
641 rm -rf $out/share/lua/${lua.luaversion}/cjson/tests
642 '';
643
644 installTargets = "install install-extra";
645
646 disabled = isLuaJIT;
647
648 meta = with stdenv.lib; {
649 description = "Lua C extension module for JSON support";
650 homepage = "https://www.kyne.com.au/~mark/software/lua-cjson.php";
651 license = licenses.mit;
652 maintainers = with maintainers; [ vyp ];
653 };
654 };
655
656 lgi = stdenv.mkDerivation rec {
657 name = "lgi-${version}";
658 version = "0.9.1";
659
660 src = fetchFromGitHub {
661 owner = "pavouk";
662 repo = "lgi";
663 rev = version;
664 sha256 = "09pbapjhyc3sn0jgx747shqr9286wqfzw02h43p4pk8fv2b766b9";
665 };
666
667 nativeBuildInputs = [ pkgconfig ];
668 buildInputs = [ glib gobjectIntrospection lua ];
669
670 makeFlags = [ "LUA_VERSION=${lua.luaversion}" ];
671
672 preBuild = ''
673 sed -i "s|/usr/local|$out|" lgi/Makefile
674 '';
675
676 patches = [
677 (fetchpatch {
678 name = "lgi-find-cairo-through-typelib.patch";
679 url = "https://github.com/psychon/lgi/commit/46a163d9925e7877faf8a4f73996a20d7cf9202a.patch";
680 sha256 = "0gfvvbri9kyzhvq3bvdbj2l6mwvlz040dk4mrd5m9gz79f7w109c";
681 })
682 ];
683
684 meta = with stdenv.lib; {
685 description = "GObject-introspection based dynamic Lua binding to GObject based libraries";
686 homepage = https://github.com/pavouk/lgi;
687 license = licenses.mit;
688 maintainers = with maintainers; [ lovek323 rasendubi ];
689 platforms = platforms.unix;
690 };
691 };
692
693 mpack = buildLuaPackage rec {
694 name = "mpack-${version}";
695 version = "1.0.7";
696
697 src = fetchFromGitHub {
698 owner = "libmpack";
699 repo = "libmpack-lua";
700 rev = version;
701 sha256 = "1nydi6xbmxwl1fmi32v5v8n74msnmzblzqaqnb102w6vkinampsb";
702 };
703
704 nativeBuildInputs = [ pkgconfig ];
705 buildInputs = [ libmpack ];
706 dontBuild = true;
707
708 postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
709 substituteInPlace Makefile \
710 --replace '-shared' '-bundle -undefined dynamic_lookup -all_load'
711 '';
712
713 installFlags = [
714 "USE_SYSTEM_LUA=yes"
715 "USE_SYSTEM_MPACK=yes"
716 "MPACK_LUA_VERSION=${lua.version}"
717 "LUA_CMOD_INSTALLDIR=$(out)/lib/lua/${lua.luaversion}"
718 ];
719
720 meta = with stdenv.lib; {
721 description = "Lua bindings for libmpack";
722 homepage = "https://github.com/libmpack/libmpack-lua";
723 license = licenses.mit;
724 maintainers = with maintainers; [ vyp ];
725 platforms = with platforms; linux ++ darwin;
726 };
727 };
728
729 vicious = stdenv.mkDerivation rec {
730 name = "vicious-${version}";
731 version = "2.3.1";
732
733 src = fetchFromGitHub {
734 owner = "Mic92";
735 repo = "vicious";
736 rev = "v${version}";
737 sha256 = "1yzhjn8rsvjjsfycdc993ms6jy2j5jh7x3r2ax6g02z5n0anvnbx";
738 };
739
740 buildInputs = [ lua ];
741
742 installPhase = ''
743 mkdir -p $out/lib/lua/${lua.luaversion}/
744 cp -r . $out/lib/lua/${lua.luaversion}/vicious/
745 printf "package.path = '$out/lib/lua/${lua.luaversion}/?/init.lua;' .. package.path\nreturn require((...) .. '.init')\n" > $out/lib/lua/${lua.luaversion}/vicious.lua
746 '';
747
748 meta = with stdenv.lib; {
749 description = "A modular widget library for the awesome window manager";
750 homepage = https://github.com/Mic92/vicious;
751 license = licenses.gpl2;
752 maintainers = with maintainers; [ makefu mic92 ];
753 platforms = platforms.linux;
754 };
755 };
756
757}; in self