2023-07-15 17:15:38 +00:00
|
|
|
{ lib, stdenv, recurseIntoAttrs, fetchgit, pkg-config, autoreconfHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, autoconf, automake, libiconv, libtool, texinfo, gettext, gawk, rapidjson, gd
|
2023-07-15 17:15:38 +00:00
|
|
|
, libharu, lmdb, gmp, glibcLocales, mpfr, more, postgresql, hiredis
|
|
|
|
, expat, tre }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2021-01-15 22:18:51 +00:00
|
|
|
buildExtension = lib.makeOverridable
|
2024-02-07 01:22:34 +00:00
|
|
|
({ name, gawkextlib, extraBuildInputs ? [ ], doCheck ? true, patches ? [ ] }:
|
2023-03-24 00:07:29 +00:00
|
|
|
let is_extension = gawkextlib != null;
|
2020-04-24 23:36:52 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "gawkextlib-${name}";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "unstable-2022-10-20";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "git://git.code.sf.net/p/gawkextlib/code";
|
2023-10-09 19:29:22 +00:00
|
|
|
rev = "f6c75b4ac1e0cd8d70c2f6c7a8d58b4d94cfde97";
|
|
|
|
sha256 = "sha256-0p3CrQ3TBl7UcveZytK/9rkAzn69RRM2GwY2eCeqlkg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
inherit patches;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
cd ${name}
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoconf
|
|
|
|
automake
|
|
|
|
libtool
|
|
|
|
autoreconfHook
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
texinfo
|
|
|
|
gettext
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [ gawk ] ++ extraBuildInputs;
|
2021-01-15 22:18:51 +00:00
|
|
|
propagatedBuildInputs = lib.optional is_extension gawkextlib;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
setupHook = if is_extension then ./setup-hook.sh else null;
|
|
|
|
inherit gawk;
|
|
|
|
|
|
|
|
inherit doCheck;
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ more ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://sourceforge.net/projects/gawkextlib/";
|
|
|
|
description = "Dynamically loaded extension libraries for GNU AWK";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "xmlgawk";
|
2020-04-24 23:36:52 +00:00
|
|
|
longDescription = ''
|
|
|
|
The gawkextlib project provides several extension libraries for
|
|
|
|
gawk (GNU AWK), as well as libgawkextlib containing some APIs that
|
|
|
|
are useful for building gawk extension libraries. These libraries
|
|
|
|
enable gawk to process XML data, interact with a PostgreSQL
|
|
|
|
database, use the GD graphics library, and perform unlimited
|
|
|
|
precision MPFR calculations.
|
|
|
|
'';
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ tomberek ];
|
|
|
|
};
|
|
|
|
});
|
|
|
|
gawkextlib = buildExtension {
|
|
|
|
gawkextlib = null;
|
|
|
|
name = "lib";
|
|
|
|
};
|
|
|
|
libs = {
|
|
|
|
abort = buildExtension {
|
|
|
|
inherit gawkextlib;
|
|
|
|
name = "abort";
|
|
|
|
};
|
|
|
|
aregex = buildExtension {
|
|
|
|
inherit gawkextlib;
|
|
|
|
name = "aregex";
|
|
|
|
extraBuildInputs = [ tre ];
|
|
|
|
};
|
|
|
|
csv = buildExtension {
|
|
|
|
inherit gawkextlib;
|
|
|
|
name = "csv";
|
|
|
|
};
|
|
|
|
errno = buildExtension {
|
|
|
|
inherit gawkextlib;
|
|
|
|
name = "errno";
|
|
|
|
};
|
|
|
|
gd = buildExtension {
|
|
|
|
inherit gawkextlib;
|
|
|
|
name = "gd";
|
|
|
|
extraBuildInputs = [ gd ];
|
|
|
|
};
|
2024-02-07 01:22:34 +00:00
|
|
|
haru = buildExtension {
|
|
|
|
inherit gawkextlib;
|
|
|
|
name = "haru";
|
|
|
|
extraBuildInputs = [ libharu ];
|
|
|
|
patches = [
|
|
|
|
# Renames references to two identifiers with typos that libharu fixed in 2.4.4
|
|
|
|
# https://github.com/libharu/libharu/commit/88271b73c68c521a49a15e3555ef00395aa40810
|
|
|
|
./fix-typos-corrected-in-libharu-2.4.4.patch
|
|
|
|
];
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
json = buildExtension {
|
|
|
|
inherit gawkextlib;
|
|
|
|
name = "json";
|
|
|
|
extraBuildInputs = [ rapidjson ];
|
|
|
|
};
|
|
|
|
lmdb = buildExtension {
|
|
|
|
inherit gawkextlib;
|
|
|
|
name = "lmdb";
|
|
|
|
extraBuildInputs = [ lmdb ];
|
|
|
|
# mdb_env_open(env, /dev/null)
|
|
|
|
#! No such device
|
|
|
|
# mdb_env_open(env, /dev/null)
|
|
|
|
#! Operation not supported by device
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
};
|
|
|
|
mbs = buildExtension {
|
|
|
|
inherit gawkextlib;
|
|
|
|
name = "mbs";
|
|
|
|
extraBuildInputs = [ glibcLocales ];
|
|
|
|
#! "spät": length: 5, mbs_length: 6, wcswidth: 4
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
};
|
|
|
|
mpfr = buildExtension {
|
|
|
|
inherit gawkextlib;
|
|
|
|
name = "mpfr";
|
|
|
|
extraBuildInputs = [ gmp mpfr ];
|
|
|
|
};
|
|
|
|
nl_langinfo = buildExtension {
|
|
|
|
inherit gawkextlib;
|
|
|
|
name = "nl_langinfo";
|
|
|
|
};
|
|
|
|
pgsql = buildExtension {
|
|
|
|
inherit gawkextlib;
|
|
|
|
name = "pgsql";
|
|
|
|
extraBuildInputs = [ postgresql ];
|
|
|
|
};
|
|
|
|
redis = buildExtension {
|
|
|
|
inherit gawkextlib;
|
|
|
|
name = "redis";
|
|
|
|
extraBuildInputs = [ hiredis ];
|
|
|
|
};
|
|
|
|
select = buildExtension {
|
|
|
|
inherit gawkextlib;
|
|
|
|
name = "select";
|
|
|
|
};
|
|
|
|
timex = buildExtension {
|
|
|
|
inherit gawkextlib;
|
|
|
|
name = "timex";
|
|
|
|
};
|
|
|
|
xml = buildExtension {
|
|
|
|
inherit gawkextlib;
|
|
|
|
name = "xml";
|
|
|
|
extraBuildInputs = [ expat libiconv ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in recurseIntoAttrs (libs // {
|
|
|
|
inherit gawkextlib buildExtension;
|
|
|
|
full = builtins.attrValues libs;
|
|
|
|
})
|