lol

gawkextlib: init at unstable-2019-11-21 (#51721)

Co-Authored-By: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>

authored by

tomberek
Dmitry Kalinkin
and committed by
Dmitry Kalinkin
774ad67c 9dc8e77e

+172
+12
pkgs/tools/text/gawk/gawk-with-extensions.nix
··· 1 + { runCommand, gawk, extensions, makeWrapper }: 2 + 3 + runCommand "gawk-with-extensions" { 4 + buildInputs = [ makeWrapper gawk ] ++ extensions; 5 + } '' 6 + mkdir -p $out/bin 7 + for i in ${gawk}/bin/*; do 8 + name="$(basename "$i")" 9 + makeWrapper $i $out/bin/$name \ 10 + --prefix AWKLIBPATH : "${gawk}/lib/gawk:''${AWKLIBPATH:-}" 11 + done 12 + ''
+149
pkgs/tools/text/gawk/gawkextlib.nix
··· 1 + { stdenv, recurseIntoAttrs, fetchgit, writeText, pkgconfig, autoreconfHook 2 + , autoconf, automake, libiconv, libtool, texinfo, gettext, gawk, rapidjson, gd 3 + , shapelib, libharu, lmdb, gmp, glibcLocales, mpfr, more, postgresql, hiredis 4 + , expat, tre, makeWrapper }: 5 + 6 + let 7 + buildExtension = stdenv.lib.makeOverridable 8 + ({ name, gawkextlib, extraBuildInputs ? [ ], doCheck ? true }: 9 + let is_extension = !isNull gawkextlib; 10 + in stdenv.mkDerivation rec { 11 + pname = "gawkextlib-${name}"; 12 + version = "unstable-2019-11-21"; 13 + 14 + src = fetchgit { 15 + url = "git://git.code.sf.net/p/gawkextlib/code"; 16 + rev = "f70f10da2804e4fd0a0bac57736e9c1cf21e345d"; 17 + sha256 = "0r8fz89n3l4dfszs1980yqj0ah95430lj0y1lb7blfkwxa6c2xik"; 18 + }; 19 + 20 + postPatch = '' 21 + cd ${name} 22 + ''; 23 + 24 + nativeBuildInputs = [ 25 + autoconf 26 + automake 27 + libtool 28 + autoreconfHook 29 + pkgconfig 30 + texinfo 31 + gettext 32 + ]; 33 + 34 + buildInputs = [ gawk ] ++ extraBuildInputs; 35 + propagatedBuildInputs = stdenv.lib.optional is_extension gawkextlib; 36 + 37 + setupHook = if is_extension then ./setup-hook.sh else null; 38 + inherit gawk; 39 + 40 + inherit doCheck; 41 + checkInputs = [ more ]; 42 + 43 + meta = with stdenv.lib; { 44 + homepage = "https://sourceforge.net/projects/gawkextlib/"; 45 + description = "Dynamically loaded extension libraries for GNU AWK"; 46 + longDescription = '' 47 + The gawkextlib project provides several extension libraries for 48 + gawk (GNU AWK), as well as libgawkextlib containing some APIs that 49 + are useful for building gawk extension libraries. These libraries 50 + enable gawk to process XML data, interact with a PostgreSQL 51 + database, use the GD graphics library, and perform unlimited 52 + precision MPFR calculations. 53 + ''; 54 + license = licenses.gpl3Plus; 55 + platforms = platforms.unix; 56 + maintainers = with maintainers; [ tomberek ]; 57 + }; 58 + }); 59 + gawkextlib = buildExtension { 60 + gawkextlib = null; 61 + name = "lib"; 62 + }; 63 + libs = { 64 + abort = buildExtension { 65 + inherit gawkextlib; 66 + name = "abort"; 67 + }; 68 + aregex = buildExtension { 69 + inherit gawkextlib; 70 + name = "aregex"; 71 + extraBuildInputs = [ tre ]; 72 + }; 73 + csv = buildExtension { 74 + inherit gawkextlib; 75 + name = "csv"; 76 + }; 77 + errno = buildExtension { 78 + inherit gawkextlib; 79 + name = "errno"; 80 + }; 81 + gd = buildExtension { 82 + inherit gawkextlib; 83 + name = "gd"; 84 + extraBuildInputs = [ gd ]; 85 + }; 86 + haru = buildExtension { 87 + inherit gawkextlib; 88 + name = "haru"; 89 + extraBuildInputs = [ libharu ]; 90 + }; 91 + json = buildExtension { 92 + inherit gawkextlib; 93 + name = "json"; 94 + extraBuildInputs = [ rapidjson ]; 95 + }; 96 + lmdb = buildExtension { 97 + inherit gawkextlib; 98 + name = "lmdb"; 99 + extraBuildInputs = [ lmdb ]; 100 + # mdb_env_open(env, /dev/null) 101 + #! No such device 102 + # mdb_env_open(env, /dev/null) 103 + #! Operation not supported by device 104 + doCheck = !stdenv.isDarwin; 105 + }; 106 + mbs = buildExtension { 107 + inherit gawkextlib; 108 + name = "mbs"; 109 + extraBuildInputs = [ glibcLocales ]; 110 + #! "spät": length: 5, mbs_length: 6, wcswidth: 4 111 + doCheck = !stdenv.isDarwin; 112 + }; 113 + mpfr = buildExtension { 114 + inherit gawkextlib; 115 + name = "mpfr"; 116 + extraBuildInputs = [ gmp mpfr ]; 117 + }; 118 + nl_langinfo = buildExtension { 119 + inherit gawkextlib; 120 + name = "nl_langinfo"; 121 + }; 122 + pgsql = buildExtension { 123 + inherit gawkextlib; 124 + name = "pgsql"; 125 + extraBuildInputs = [ postgresql ]; 126 + }; 127 + redis = buildExtension { 128 + inherit gawkextlib; 129 + name = "redis"; 130 + extraBuildInputs = [ hiredis ]; 131 + }; 132 + select = buildExtension { 133 + inherit gawkextlib; 134 + name = "select"; 135 + }; 136 + timex = buildExtension { 137 + inherit gawkextlib; 138 + name = "timex"; 139 + }; 140 + xml = buildExtension { 141 + inherit gawkextlib; 142 + name = "xml"; 143 + extraBuildInputs = [ expat libiconv ]; 144 + }; 145 + }; 146 + in recurseIntoAttrs (libs // { 147 + inherit gawkextlib buildExtension; 148 + full = builtins.attrValues libs; 149 + })
+6
pkgs/tools/text/gawk/setup-hook.sh
··· 1 + local oldOpts="-u" 2 + shopt -qo nounset || oldOpts="+u" 3 + set +u 4 + . @gawk@/etc/profile.d/gawk.sh 5 + gawklibpath_append @out@/lib/gawk 6 + set "$oldOpts"
+5
pkgs/top-level/all-packages.nix
··· 3399 3399 inherit (darwin) locale; 3400 3400 }; 3401 3401 3402 + gawk-with-extensions = callPackage ../tools/text/gawk/gawk-with-extensions.nix { 3403 + extensions = gawkextlib.full; 3404 + }; 3405 + gawkextlib = callPackage ../tools/text/gawk/gawkextlib.nix {}; 3406 + 3402 3407 gawkInteractive = appendToName "interactive" 3403 3408 (gawk.override { interactive = true; }); 3404 3409