{ 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} ''; }