1 { lib, stdenv, recurseIntoAttrs, fetchgit, pkg-config, autoreconfHook
2 , autoconf, automake, libiconv, libtool, texinfo, gettext, gawk, rapidjson, gd
3 , libharu, lmdb, gmp, glibcLocales, mpfr, more, postgresql, hiredis
7 buildExtension = lib.makeOverridable
8 ({ name, gawkextlib, extraBuildInputs ? [ ], doCheck ? true, patches ? [ ] }:
9 let is_extension = gawkextlib != null;
10 in stdenv.mkDerivation rec {
11 pname = "gawkextlib-${name}";
12 version = "unstable-2022-10-20";
15 url = "git://git.code.sf.net/p/gawkextlib/code";
16 rev = "f6c75b4ac1e0cd8d70c2f6c7a8d58b4d94cfde97";
17 sha256 = "sha256-0p3CrQ3TBl7UcveZytK/9rkAzn69RRM2GwY2eCeqlkg=";
36 buildInputs = [ gawk ] ++ extraBuildInputs;
37 propagatedBuildInputs = lib.optional is_extension gawkextlib;
39 setupHook = if is_extension then ./setup-hook.sh else null;
43 nativeCheckInputs = [ more ];
46 homepage = "https://sourceforge.net/projects/gawkextlib/";
47 description = "Dynamically loaded extension libraries for GNU AWK";
48 mainProgram = "xmlgawk";
50 The gawkextlib project provides several extension libraries for
51 gawk (GNU AWK), as well as libgawkextlib containing some APIs that
52 are useful for building gawk extension libraries. These libraries
53 enable gawk to process XML data, interact with a PostgreSQL
54 database, use the GD graphics library, and perform unlimited
55 precision MPFR calculations.
57 license = licenses.gpl3Plus;
58 platforms = platforms.unix;
59 maintainers = with maintainers; [ tomberek ];
62 gawkextlib = buildExtension {
67 abort = buildExtension {
71 aregex = buildExtension {
74 extraBuildInputs = [ tre ];
76 csv = buildExtension {
80 errno = buildExtension {
87 extraBuildInputs = [ gd ];
89 haru = buildExtension {
92 extraBuildInputs = [ libharu ];
94 # Renames references to two identifiers with typos that libharu fixed in 2.4.4
95 # https://github.com/libharu/libharu/commit/88271b73c68c521a49a15e3555ef00395aa40810
96 ./fix-typos-corrected-in-libharu-2.4.4.patch
99 json = buildExtension {
102 extraBuildInputs = [ rapidjson ];
104 lmdb = buildExtension {
107 extraBuildInputs = [ lmdb ];
108 # mdb_env_open(env, /dev/null)
110 # mdb_env_open(env, /dev/null)
111 #! Operation not supported by device
112 doCheck = !stdenv.hostPlatform.isDarwin;
114 mbs = buildExtension {
117 extraBuildInputs = [ glibcLocales ];
118 #! "spät": length: 5, mbs_length: 6, wcswidth: 4
119 doCheck = !stdenv.hostPlatform.isDarwin;
121 mpfr = buildExtension {
124 extraBuildInputs = [ gmp mpfr ];
126 nl_langinfo = buildExtension {
128 name = "nl_langinfo";
130 pgsql = buildExtension {
133 extraBuildInputs = [ postgresql ];
135 redis = buildExtension {
138 extraBuildInputs = [ hiredis ];
140 select = buildExtension {
144 timex = buildExtension {
148 xml = buildExtension {
151 extraBuildInputs = [ expat libiconv ];
154 in recurseIntoAttrs (libs // {
155 inherit gawkextlib buildExtension;
156 full = builtins.attrValues libs;