summaryrefslogtreecommitdiffstats
path: root/pkgs/servers/firebird/default.nix
blob: 96523788522a74c9cf705118d5b6eeca3aa70025 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
{
  lib,
  stdenv,
  fetchFromGitHub,
  fetchDebianPatch,
  libedit,
  autoreconfHook,
  cmake,
  zlib,
  unzip,
  libtommath,
  libtomcrypt,
  icu73,
  superServer ? false,
}:

let
  base = {
    pname = "firebird";

    meta = {
      description = "SQL relational database management system";
      downloadPage = "https://github.com/FirebirdSQL/firebird/";
      homepage = "https://firebirdsql.org/";
      changelog = "https://github.com/FirebirdSQL/firebird/blob/master/CHANGELOG.md";
      license = with lib.licenses; [
        mpl11
        interbase
      ];
      platforms = lib.platforms.linux;
      maintainers = with lib.maintainers; [
        bbenno
      ];
    };

    nativeBuildInputs = [ autoreconfHook ];

    buildInputs = [
      libedit
      icu73
    ];

    env.LD_LIBRARY_PATH = lib.makeLibraryPath [ icu73 ];

    configureFlags = [
      "--with-system-editline"
    ]
    ++ (lib.optional superServer "--enable-superserver");

    enableParallelBuilding = true;

    __structuredAttrs = true;
    strictDeps = true;

    installPhase = ''
      runHook preInstall
      mkdir -p $out
      cp -r gen/Release/firebird/* $out
      rm -f $out/lib/*.a  # they were just symlinks to /build/source/...
      runHook postInstall
    '';

  };
in
rec {
  firebird_3 = stdenv.mkDerivation (
    base
    // rec {
      version = "3.0.14";

      src = fetchFromGitHub {
        owner = "FirebirdSQL";
        repo = "firebird";
        rev = "v${version}";
        hash = "sha256-X6Jv32VniAefIWjLTPwEipsQVRl7HBb4EKyi2IL1VWM=";
      };

      patches = [
        (fetchDebianPatch {
          pname = "firebird3.0";
          version = "3.0.13.ds7";
          debianRevision = "2";
          patch = "no-binary-gbaks.patch";
          hash = "sha256-LXUMM38PBYeLPdgaxLPau4HWB4ItJBBnx7oGwalL6Pg=";
        })
      ];

      buildInputs = base.buildInputs ++ [
        zlib
        libtommath
      ];

      meta = base.meta // {
        platforms = [ "x86_64-linux" ];
      };
    }
  );

  firebird_4 = stdenv.mkDerivation (
    base
    // rec {
      version = "4.0.7";

      src = fetchFromGitHub {
        owner = "FirebirdSQL";
        repo = "firebird";
        rev = "v${version}";
        hash = "sha256-4u1Vgwk5cMCkrGfGSk2xO7hVHiDda0ioitvX/r3KPQc=";
      };

      nativeBuildInputs = base.nativeBuildInputs ++ [ unzip ];
      buildInputs = base.buildInputs ++ [
        zlib
        libtommath
        libtomcrypt
      ];
    }
  );

  firebird_5 = stdenv.mkDerivation (
    base
    // rec {
      version = "5.0.4";

      src = fetchFromGitHub {
        owner = "FirebirdSQL";
        repo = "firebird";
        rev = "v${version}";
        fetchSubmodules = true;
        hash = "sha256-IJrfs8q7GtX4Y+Cmg4avT5QJmLpld38tyR3TR1CcgyE=";
      };

      # CMake is just used for libcds
      dontUseCmakeConfigure = true;

      nativeBuildInputs = base.nativeBuildInputs ++ [
        cmake
        unzip
      ];
      buildInputs = base.buildInputs ++ [
        zlib
        libtommath
        libtomcrypt
      ];
    }
  );

  firebird = firebird_5;
}