python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / libraries / libtomcrypt / default.nix
blob936c92bf7c5de5216009c42785448816f2c4a494
1 { lib, stdenv, fetchurl, fetchpatch, libtool, libtommath }:
3 stdenv.mkDerivation rec {
4   pname = "libtomcrypt";
5   version = "1.18.2";
7   src = fetchurl {
8     url = "https://github.com/libtom/libtomcrypt/releases/download/v${version}/crypt-${version}.tar.xz";
9     sha256 = "113vfrgapyv72lalhd3nkw7jnks8az0gcb5wqn9hj19nhcxlrbcn";
10   };
12   patches = [
13     (fetchpatch {
14       name = "CVE-2019-17362.patch";
15       url = "https://github.com/libtom/libtomcrypt/pull/508/commits/25c26a3b7a9ad8192ccc923e15cf62bf0108ef94.patch";
16       sha256 = "1bwsj0pwffxw648wd713z3xcyrbxc2z646psrzp38ys564fjh5zf";
17     })
18   ];
20   nativeBuildInputs = [ libtool libtommath ];
22   postPatch = ''
23     substituteInPlace makefile.shared --replace "LT:=glibtool" "LT:=libtool"
24   '';
26   preBuild = ''
27     makeFlagsArray+=(PREFIX=$out \
28       CFLAGS="-DUSE_LTM -DLTM_DESC -DLTC_PTHREAD" \
29       EXTRALIBS=\"-ltommath\" \
30       INSTALL_GROUP=$(id -g) \
31       INSTALL_USER=$(id -u))
32   '';
34   makefile = "makefile.shared";
36   enableParallelBuilding = true;
38   meta = with lib; {
39     homepage = "https://www.libtom.net/LibTomCrypt/";
40     description = "A fairly comprehensive, modular and portable cryptographic toolkit";
41     license = with licenses; [ publicDomain wtfpl ];
42     platforms = platforms.linux;
43   };