summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/qu/quantlib/package.nix
blob: 4655b4bc9574126141825573da0ba24568a74ff6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
  lib,
  stdenv,
  fetchFromGitHub,
  cmake,
  boost,
  nix-update-script,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "quantlib";
  version = "1.43";

  outputs = [
    "out"
    "dev"
  ];

  src = fetchFromGitHub {
    owner = "lballabio";
    repo = "QuantLib";
    rev = "v${finalAttrs.version}";
    hash = "sha256-Bl+Q5BKUg9WCzktaeCr9Zdw38arg3K4/wqBC8tS8ghM=";
  };

  nativeBuildInputs = [ cmake ];
  buildInputs = [ boost ];

  # Required by RQuantLib, may be beneficial for others too
  cmakeFlags = [ "-DQL_HIGH_RESOLUTION_DATE=ON" ];

  # Needed for RQuantLib and possible others
  postInstall = ''
    cp ./quantlib-config $out/bin/
  '';

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Free/open-source library for quantitative finance";
    homepage = "https://quantlib.org";
    changelog = "https://github.com/lballabio/QuantLib/releases/tag/v${finalAttrs.version}";
    platforms = lib.platforms.unix;
    license = lib.licenses.bsd3;
    maintainers = [ lib.maintainers.kupac ];
  };
})