blob: d9b603f8cba4063e6ae7e0c11b5a20bc1a592e39 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
{ stdenv
, fetchurl
, pkgs
}:
let
lua = pkgs.lua51Packages.lua;
in pkgs.lua51Packages.buildLuaPackage {
name = "luaSha2";
src = fetchurl {
url = "https://sha2.googlecode.com/archive/02bd4bfdc8062c7e1ae51c5a72906efc0a6375ee.tar.gz";
sha256 = "18v0pn10cs6133jzm80sj2aw0ycpls150k9p0gplagap6xhzp6j2";
};
buildPhase = ''
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
'';
installPhase = ''
mkdir -p $out/lib/lua/${lua.luaversion}
install sha2.so $out/lib/lua/${lua.luaversion}
'';
}
|