1{ stdenv, fetchurl, libtool }:
2
3stdenv.mkDerivation rec {
4 name = "libtomcrypt-${version}";
5 version = "1.18.1";
6
7 src = fetchurl {
8 url = "https://github.com/libtom/libtomcrypt/releases/download/v${version}/crypt-${version}.tar.xz";
9 sha256 = "053z0jzyvf6c9929phlh2p0ybx289s34g7nii5hnjigxzcs3mhap";
10 };
11
12 nativeBuildInputs = [ libtool ];
13
14 postPatch = ''
15 substituteInPlace makefile.shared --replace "LT:=glibtool" "LT:=libtool"
16 '';
17
18 preBuild = ''
19 makeFlagsArray=(PREFIX=$out \
20 INSTALL_GROUP=$(id -g) \
21 INSTALL_USER=$(id -u))
22 '';
23
24 makefile = "makefile.shared";
25
26 enableParallelBuilding = true;
27
28 meta = with stdenv.lib; {
29 homepage = http://www.libtom.net/LibTomCrypt/;
30 description = "A fairly comprehensive, modular and portable cryptographic toolkit";
31 license = with licenses; [ publicDomain wtfpl ];
32 platforms = platforms.linux;
33 };
34}