aboutsummaryrefslogtreecommitdiff
path: root/perl/default.nix
blob: 7ce418402d8366f58664a99769a0e8ac28e0445e (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
48
49
50
51
52
53
54
55
56
57
58
59
{
  lib,
  fileset,
  stdenv,
  perl,
  perlPackages,
  pkg-config,
  nix,
  curl,
  bzip2,
  xz,
  boost,
  libsodium,
  darwin,
  meson,
  ninja,
}:

perl.pkgs.toPerlModule (
  stdenv.mkDerivation {
    name = "nix-perl-${nix.version}";

    src = fileset.toSource {
      root = ../.;
      fileset = fileset.unions ([
        ../.version
        ./lib
        ./meson.build
      ]);
    };

    nativeBuildInputs = [
      pkg-config
      meson
      ninja
    ];

    buildInputs =
      [
        nix
        curl
        bzip2
        xz
        perl
        boost
        perlPackages.DBI
        perlPackages.DBDSQLite
      ]
      ++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
      ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;

    # Nixpkgs' Meson hook likes to set this to "plain".
    mesonBuildType = "debugoptimized";

    enableParallelBuilding = true;

    postUnpack = "sourceRoot=$sourceRoot/perl";
  }
)