1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 glib,
6 readline,
7 bison,
8 flex,
9 pkg-config,
10 autoreconfHook,
11 txt2man,
12 which,
13 gettext,
14 nix-update-script,
15 versionCheckHook,
16}:
17
18stdenv.mkDerivation (finalAttrs: {
19 pname = "mdbtools";
20 version = "1.0.1";
21
22 src = fetchFromGitHub {
23 owner = "mdbtools";
24 repo = "mdbtools";
25 tag = "v${finalAttrs.version}";
26 hash = "sha256-XWkFgQZKx9/pjVNEqfp9BwgR7w3fVxQ/bkJEYUvCXPs=";
27 };
28
29 configureFlags = [ "--disable-scrollkeeper" ];
30
31 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=unused-but-set-variable";
32
33 nativeBuildInputs = [
34 pkg-config
35 bison
36 flex
37 autoreconfHook
38 txt2man
39 which
40 ];
41
42 buildInputs = [
43 glib
44 readline
45 ];
46
47 postUnpack = ''
48 cp -v ${gettext}/share/gettext/m4/lib-{link,prefix,ld}.m4 source/m4
49 '';
50
51 enableParallelBuilding = true;
52
53 doInstallCheck = true;
54 nativeInstallCheckInputs = [ versionCheckHook ];
55 versionCheckProgram = "${placeholder "out"}/bin/mdb-ver";
56 versionCheckProgramArg = "--version";
57
58 passthru.updateScript = nix-update-script { };
59
60 meta = {
61 changelog = "https://github.com/mdbtools/mdbtools/releases/tag/v${finalAttrs.version}";
62 description = ".mdb (MS Access) format tools";
63 homepage = "https://mdbtools.github.io/";
64 license = with lib.licenses; [
65 gpl2Plus
66 lgpl2
67 ];
68 platforms = lib.platforms.unix;
69 };
70})