diff options
-rw-r--r-- | custom/luaSha2.nix | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/custom/luaSha2.nix b/custom/luaSha2.nix index 622635a3..2270c48a 100644 --- a/custom/luaSha2.nix +++ b/custom/luaSha2.nix | |||
@@ -1,5 +1,5 @@ | |||
1 | { stdenv | 1 | { stdenv |
2 | , fetchgit | 2 | , fetchurl |
3 | , pkgs | 3 | , pkgs |
4 | }: | 4 | }: |
5 | 5 | ||
@@ -7,11 +7,23 @@ let | |||
7 | lua = pkgs.lua51Packages.lua; | 7 | lua = pkgs.lua51Packages.lua; |
8 | in pkgs.lua51Packages.buildLuaPackage { | 8 | in pkgs.lua51Packages.buildLuaPackage { |
9 | name = "luaSha2"; | 9 | name = "luaSha2"; |
10 | src = fetchgit { | 10 | src = fetchurl { |
11 | url = "https://code.google.com/archive/p/sha2"; | 11 | url = "https://luarocks.org/manifests/luarocks/sha2-0.2.0-1.src.rock"; |
12 | rev = "02bd4bfdc8062c7e1ae51c5a72906efc0a6375ee"; | 12 | sha256 = "1h0mlkrr42acysxpdfk81rw695rdbr7b9khfjcxd5d4731irjs6j"; |
13 | sha256 = "57ca5f1fb63b00aba7bcbb6e153a7878bc855a0cc6fb539abba33933da727c6f"; | ||
14 | }; | 13 | }; |
14 | # src = fetchgit { | ||
15 | # url = "https://code.google.com/archive/p/sha2"; | ||
16 | # rev = "02bd4bfdc8062c7e1ae51c5a72906efc0a6375ee"; | ||
17 | # sha256 = "57ca5f1fb63b00aba7bcbb6e153a7878bc855a0cc6fb539abba33933da727c6f"; | ||
18 | # }; | ||
19 | buildInputs = with pkgs; [ unzip ]; | ||
20 | unpackPhase = '' | ||
21 | unzip $src | ||
22 | rm sha2-0.2.0-1.rockspec | ||
23 | unzip sha2-0.2.0.zip | ||
24 | rm sha2-0.2.0.zip | ||
25 | mv -v sha2-0.2.0/* . | ||
26 | ''; | ||
15 | buildPhase = '' | 27 | buildPhase = '' |
16 | 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 | 28 | 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 |
17 | ''; | 29 | ''; |