summaryrefslogtreecommitdiff
path: root/custom/luaSha2.nix
diff options
context:
space:
mode:
Diffstat (limited to 'custom/luaSha2.nix')
-rw-r--r--custom/luaSha2.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/custom/luaSha2.nix b/custom/luaSha2.nix
new file mode 100644
index 00000000..d9b603f8
--- /dev/null
+++ b/custom/luaSha2.nix
@@ -0,0 +1,21 @@
1{ stdenv
2, fetchurl
3, pkgs
4}:
5
6let
7 lua = pkgs.lua51Packages.lua;
8in pkgs.lua51Packages.buildLuaPackage {
9 name = "luaSha2";
10 src = fetchurl {
11 url = "https://sha2.googlecode.com/archive/02bd4bfdc8062c7e1ae51c5a72906efc0a6375ee.tar.gz";
12 sha256 = "18v0pn10cs6133jzm80sj2aw0ycpls150k9p0gplagap6xhzp6j2";
13 };
14 buildPhase = ''
15 gcc -L${lua}/lib -I$LUA_INC -I. sha2.c sha2lib.c -fPIC -DSHA2_USE_INTTYPES_H -DBYTE_ORDER -DLITTLE_ENDIAN -llua -shared -o sha2.so
16 '';
17 installPhase = ''
18 mkdir -p $out/lib/lua/${lua.luaversion}
19 install sha2.so $out/lib/lua/${lua.luaversion}
20 '';
21}