nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 boost,
7 nix-update-script,
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "quantlib";
12 version = "1.41";
13
14 outputs = [
15 "out"
16 "dev"
17 ];
18
19 src = fetchFromGitHub {
20 owner = "lballabio";
21 repo = "QuantLib";
22 rev = "v${finalAttrs.version}";
23 hash = "sha256-dHXITHP0SBrBXf5hrVhjSD4n2EtVvEkBDfE2NbT0/sc=";
24 };
25
26 nativeBuildInputs = [ cmake ];
27 buildInputs = [ boost ];
28
29 # Required by RQuantLib, may be beneficial for others too
30 cmakeFlags = [ "-DQL_HIGH_RESOLUTION_DATE=ON" ];
31
32 # Needed for RQuantLib and possible others
33 postInstall = ''
34 cp ./quantlib-config $out/bin/
35 '';
36
37 passthru.updateScript = nix-update-script { };
38
39 meta = {
40 description = "Free/open-source library for quantitative finance";
41 homepage = "https://quantlib.org";
42 changelog = "https://github.com/lballabio/QuantLib/releases/tag/v${finalAttrs.version}";
43 platforms = lib.platforms.unix;
44 license = lib.licenses.bsd3;
45 maintainers = [ lib.maintainers.kupac ];
46 };
47})