@@ -1,91 +1,84 @@
1−{lib, stdenv, fetchurl, libedit, automake, autoconf, libtool
1+{ lib, stdenv, fetchFromGitHub, libedit, autoreconfHook, zlib, unzip, libtommath, libtomcrypt, icu, superServer ? false }:
3− # icu = null: use icu which comes with firebird
3+let base = {
5− # icu = pkgs.icu => you may have trouble sharing database files with windows
6− # users if "Collation unicode" columns are being used
7− # windows icu version is *30.dll, however neither the icu 3.0 nor the 3.6
8− # sources look close to what ships with this package.
9− # Thus I think its best to trust firebird devs and use their version
11− # icu version missmatch may cause such error when selecting from a table:
12− # "Collation unicode for character set utf8 is not installed"
14− # icu 3.0 can still be built easily by nix (by dropping the #elif case and
20−, serviceName ? "gds_db"
24− there are 3 ways to use firebird:
26− - one process, one thread for each connection
28− - is built by default
29− - one process for each connection
30− - on linux direct io operations (?)
33− manual says that you usually don't notice the difference between a and b.
35− I'm only interested in the embedder shared libary for now.
36− So everything isn't tested yet
40−stdenv.mkDerivation rec {
41− version = "2.5.7.27050-0";
42 pname = "firebird";
4 pname = "firebird";
44− # enableParallelBuilding = false; build fails
6+ meta = with lib; {
7+ description = "SQL relational database management system";
8+ homepage = "https://firebirdsql.org/";
9+ changelog = "https://github.com/FirebirdSQL/firebird/blob/master/CHANGELOG.md";
10+ license = [ "IDPL" "Interbase-1.0" ];
11+ platforms = platforms.linux;
12+ maintainers = with maintainers; [ marcweber ];
15+ nativeBuildInputs = [ autoreconfHook ];
17+ buildInputs = [ libedit icu ];
46− # http://tracker.firebirdsql.org/browse/CORE-3246
19+ LD_LIBRARY_PATH = lib.makeLibraryPath [ icu ];
48− makeFlags="$makeFlags CPU=$NIX_BUILD_CORES"
21+ configureFlags = [
22+ "--with-system-editline"
23+ ] ++ (lib.optional superServer "--enable-superserver");
28+ cp -r gen/Release/firebird/* $out
51− configureFlags =
32+}; in {
52− [ "--with-serivec-port=${builtins.toString port}"
53− "--with-service-name=${serviceName}"
54− "--with-system-editline"
55− "--with-fblog=/var/log/firebird"
56− "--with-fbconf=/etc/firebird"
57− "--with-fbsecure-db=/var/db/firebird/system"
59− ++ (lib.optional (icu != null) "--with-system-icu")
60− ++ (lib.optional superServer "--enable-superserver");
63− url = "mirror://sourceforge/firebird/Firebird-${version}.tar.bz2";
64− sha256 = "06hp6bq5irqvm3h03s79qjgcc3jsjpq150y9aq7anklx9v4nhfqa";
67− hardeningDisable = [ "format" ];
34+ firebird_2_5 = stdenv.mkDerivation (base // rec {
69− # configurePhase = ''
37+ src = fetchFromGitHub {
70− # sed -i 's@cp /usr/share/automake-.*@@' autogen.sh
38+ owner = "FirebirdSQL";
71− # sh autogen.sh $configureFlags --prefix=$out
39+ repo = "firebird";
72− # '';
40+ rev = "R${builtins.replaceStrings [ "." ] [ "_" ] version}";
73− buildInputs = [libedit icu automake autoconf libtool];
41+ sha256 = "sha256-YyvlMeBux80OpVhsCv+6IVxKXFRsgdr+1siupMR13JM=";
75− # TODO: Probably this hase to be tidied up..
44+ configureFlags = base.configureFlags ++ [ "--with-system-icu" ];
76− # make install requires beeing. disabling the root checks
77− # dosen't work. Copying the files manually which can be found
78− # in ubuntu -dev -classic, -example packages:
79− # maybe some of those files can be removed again
80− installPhase = "cp -r gen/firebird $out";
82− meta = {
46+ installPhase = ''
83− description = "SQL relational database management system";
47+ runHook preInstall
84− homepage = "https://www.firebirdnews.org";
48+ mkdir -p $out
85− license = ["IDPL" "Interbase-1.0"];
49+ cp -r gen/firebird/* $out
86− maintainers = [lib.maintainers.marcweber];
50+ runHook postInstall
87− platforms = lib.platforms.linux;
51+ '';
53+ meta = base.meta // { platforms = [ "x86_64-linux" ]; };
56+ firebird_3 = stdenv.mkDerivation (base // rec {
59+ src = fetchFromGitHub {
60+ owner = "FirebirdSQL";
62+ rev = "R${builtins.replaceStrings [ "." ] [ "_" ] version}";
63+ sha256 = "sha256-8nGan10qjW8dFF89BL/tUWtwMGhahBiODbOqRrHSrbs=";
66+ buildInputs = base.buildInputs ++ [ zlib libtommath ];
68+ meta = base.meta // { platforms = [ "x86_64-linux" ]; };
71+ firebird_4 = stdenv.mkDerivation (base // rec {
72+ version = "4.0.0-rc1";
74+ src = fetchFromGitHub {
75+ owner = "FirebirdSQL";
78+ sha256 = "sha256-FLaRePosF5dtJ+fmrfvzkE6wawC9Z9YLhT/ZWkwWXb4=";
81+ buildInputs = base.buildInputs ++ [ zlib unzip libtommath libtomcrypt ];