-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathflake.nix
More file actions
63 lines (57 loc) · 2.26 KB
/
Copy pathflake.nix
File metadata and controls
63 lines (57 loc) · 2.26 KB
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
60
61
62
63
{
description = "Berkeley DB (libdb) — historical archive and living fork";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
version = "5.3.31";
in {
packages = rec {
# Default: the Meson/Ninja build of the core C library.
libdb-meson = pkgs.stdenv.mkDerivation {
pname = "libdb";
inherit version;
src = ./.;
nativeBuildInputs = [ pkgs.meson pkgs.ninja pkgs.python3 pkgs.pkg-config ];
# meson.build is at the repo root; nix's meson hooks drive it.
};
# The reference Autoconf build (build_unix), full feature set.
libdb-autoconf = pkgs.stdenv.mkDerivation {
pname = "libdb-autoconf";
inherit version;
src = ./.;
enableParallelBuilding = true;
buildInputs = pkgs.lib.optionals pkgs.stdenv.isLinux [
pkgs.liburing # io_uring AIO backend
];
configurePhase = ''
runHook preConfigure
cd build_unix
../dist/configure --prefix=$out --enable-shared --disable-static
runHook postConfigure
'';
# buildPhase / installPhase use the default make in build_unix.
};
default = libdb-meson;
};
devShells.default = pkgs.mkShell {
packages = [
pkgs.meson pkgs.ninja pkgs.python3 pkgs.pkg-config
pkgs.gcc pkgs.clang pkgs.autoconf pkgs.gnumake
pkgs.tcl # for the TCL test harness (--enable-test)
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
pkgs.liburing # Linux io_uring AIO backend (HAVE_IO_URING)
];
shellHook = ''
echo "libdb dev shell — Meson: 'meson setup build && ninja -C build'"
echo " Autoconf: 'cd build_unix && ../dist/configure && make'"
'';
};
# `nix flake check` smoke: the default package builds.
checks.default = self.packages.${system}.default;
});
}