mini-calc: 3.3.3 -> 3.3.5 (#372274)
[NixPkgs.git] / pkgs / by-name / li / libtomcrypt / package.nix
blobf2a74bba838bd7a81b61851834d883ce4c317d60
2   lib,
3   stdenv,
4   fetchurl,
5   fetchpatch,
6   libtool,
7   libtommath,
8 }:
10 stdenv.mkDerivation rec {
11   pname = "libtomcrypt";
12   version = "1.18.2";
14   src = fetchurl {
15     url = "https://github.com/libtom/libtomcrypt/releases/download/v${version}/crypt-${version}.tar.xz";
16     sha256 = "113vfrgapyv72lalhd3nkw7jnks8az0gcb5wqn9hj19nhcxlrbcn";
17   };
19   patches = [
20     (fetchpatch {
21       name = "CVE-2019-17362.patch";
22       url = "https://github.com/libtom/libtomcrypt/pull/508/commits/25c26a3b7a9ad8192ccc923e15cf62bf0108ef94.patch";
23       sha256 = "1bwsj0pwffxw648wd713z3xcyrbxc2z646psrzp38ys564fjh5zf";
24     })
25   ];
27   nativeBuildInputs = [
28     libtool
29     libtommath
30   ];
32   postPatch = ''
33     substituteInPlace makefile.shared --replace "LIBTOOL:=glibtool" "LIBTOOL:=libtool"
34   '';
36   preBuild = ''
37     makeFlagsArray+=(PREFIX=$out \
38       CFLAGS="-DUSE_LTM -DLTM_DESC -DLTC_PTHREAD" \
39       EXTRALIBS=\"-ltommath\" \
40       INSTALL_GROUP=$(id -g) \
41       INSTALL_USER=$(id -u))
42   '';
44   makefile = "makefile.shared";
46   enableParallelBuilding = true;
48   meta = with lib; {
49     description = "Fairly comprehensive, modular and portable cryptographic toolkit";
50     homepage = "https://www.libtom.net/LibTomCrypt/";
51     changelog = "https://github.com/libtom/libtomcrypt/raw/v${version}/changes";
52     license = with licenses; [
53       publicDomain
54       wtfpl
55     ];
56     maintainers = [ ];
57     platforms = platforms.all;
58   };