2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchurl, libtool }:
|
2017-11-07 22:21:01 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "libtommath";
|
2019-11-06 09:46:15 +00:00
|
|
|
version = "1.2.0";
|
2008-08-12 19:57:35 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-11-07 22:21:01 +00:00
|
|
|
url = "https://github.com/libtom/libtommath/releases/download/v${version}/ltm-${version}.tar.xz";
|
2019-11-06 09:46:15 +00:00
|
|
|
sha256 = "1c8q1qy88cjhdjlk3g24mra94h34c1ldvkjz0n2988c0yvn5xixp";
|
2008-08-12 19:57:35 +00:00
|
|
|
};
|
|
|
|
|
2017-11-07 22:21:01 +00:00
|
|
|
nativeBuildInputs = [ libtool ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2019-06-06 02:54:38 +00:00
|
|
|
substituteInPlace makefile.shared --replace glibtool libtool
|
2017-11-07 22:21:01 +00:00
|
|
|
substituteInPlace makefile_include.mk --replace "shell arch" "shell uname -m"
|
|
|
|
'';
|
2008-08-12 19:57:35 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
2017-11-07 22:21:01 +00:00
|
|
|
makeFlagsArray=(PREFIX=$out \
|
2008-08-12 19:57:35 +00:00
|
|
|
INSTALL_GROUP=$(id -g) \
|
|
|
|
INSTALL_USER=$(id -u))
|
|
|
|
'';
|
|
|
|
|
|
|
|
makefile = "makefile.shared";
|
|
|
|
|
2017-11-07 22:21:01 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.libtom.net/LibTomMath/";
|
2008-08-12 19:57:35 +00:00
|
|
|
description = "A library for integer-based number-theoretic applications";
|
2017-11-07 22:21:01 +00:00
|
|
|
license = with licenses; [ publicDomain wtfpl ];
|
|
|
|
platforms = platforms.unix;
|
2008-08-12 19:57:35 +00:00
|
|
|
};
|
|
|
|
}
|