| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 |
|
| 20 | (define-module (gnu packages datamash)
|
| 21 | #:use-module (guix packages)
|
| 22 | #:use-module (guix licenses)
|
| 23 | #:use-module (guix download)
|
| 24 | #:use-module (guix git-download)
|
| 25 | #:use-module (guix build-system gnu)
|
| 26 | #:use-module (guix gexp)
|
| 27 | #:use-module (guix utils)
|
| 28 | #:use-module (gnu packages)
|
| 29 | #:use-module (gnu packages base)
|
| 30 | #:use-module (gnu packages gawk)
|
| 31 | #:use-module (gnu packages perl)
|
| 32 | #:use-module (gnu packages python)
|
| 33 | #:use-module (gnu packages python-xyz))
|
| 34 |
|
| 35 | (define-public datamash
|
| 36 | (package
|
| 37 | (name "datamash")
|
| 38 | (version "1.9")
|
| 39 | (source
|
| 40 | (origin
|
| 41 | (method url-fetch)
|
| 42 | (uri (string-append "mirror://gnu/datamash/datamash-"
|
| 43 | version ".tar.gz"))
|
| 44 | (sha256
|
| 45 | (base32
|
| 46 | "1ll7rfm2b8zdm1vlm3a32cr2kjbc1af8yx8z2rwxc3b50gdfp0pk"))))
|
| 47 | (native-inputs
|
| 48 | (list which |
| 49 | perl)) |
| 50 | (build-system gnu-build-system)
|
| 51 | (arguments
|
| 52 | (if (%current-target-system)
|
| 53 | |
| 54 | (list #:configure-flags
|
| 55 | #~(list "ac_cv_func_strcasecmp=yes"
|
| 56 | "gl_cv_func_strcasecmp_works=yes"))
|
| 57 | '()))
|
| 58 | (home-page "https://www.gnu.org/software/datamash/")
|
| 59 | (synopsis "Scriptable statistics and data calculation")
|
| 60 | (description
|
| 61 | "Perform basic numeric, textual and statistical operations on plain text
|
| 62 | files. Designed to work within standard pipelines without additional code.")
|
| 63 | (license gpl3+)))
|
| 64 |
|
| 65 | (define-public vnlog
|
| 66 | (package
|
| 67 | (name "vnlog")
|
| 68 | (version "1.32")
|
| 69 | (home-page "https://github.com/dkogan/vnlog")
|
| 70 | (source (origin
|
| 71 | (method git-fetch)
|
| 72 | (uri (git-reference
|
| 73 | (url home-page)
|
| 74 | (commit (string-append "v" version))))
|
| 75 | (file-name (git-file-name name version))
|
| 76 | (sha256
|
| 77 | (base32
|
| 78 | "1g4insm6gkw3c82fq8q9swkdha3cncbz1nib15yg9b2s4yl123hm"))))
|
| 79 | (build-system gnu-build-system)
|
| 80 | (native-inputs
|
| 81 | (list python-numpy)) |
| 82 | (inputs
|
| 83 | (list mawk
|
| 84 | perl
|
| 85 | perl-ipc-run
|
| 86 | perl-list-moreutils
|
| 87 | perl-string-shellquote
|
| 88 | perl-text-diff
|
| 89 | perl-text-table
|
| 90 | python-wrapper))
|
| 91 | (arguments
|
| 92 | (list #:make-flags
|
| 93 | #~(list (string-append "CC=" #$(cc-for-target))
|
| 94 | (string-append "DESTDIR=" #$output)
|
| 95 | "USRLIB=lib"
|
| 96 | "MANDIR=share/man"
|
| 97 | (string-append "PY3_MODULE_PATH=lib/python"
|
| 98 | #$(version-major+minor
|
| 99 | (package-version
|
| 100 | (this-package-input "python-wrapper")))
|
| 101 | "/site-packages")
|
| 102 | |
| 103 | "DIST_PY2_MODULES=")
|
| 104 | #:phases
|
| 105 | #~(modify-phases %standard-phases
|
| 106 | (add-after 'unpack 'adjust-Makefile
|
| 107 | (lambda _
|
| 108 | (substitute* "GNUmakefile"
|
| 109 | |
| 110 | (("/usr/share/perl5")
|
| 111 | (string-append "/lib/perl5/site_perl/"
|
| 112 | #$(package-version
|
| 113 | (this-package-input "perl"))))
|
| 114 | |
| 115 | (("\\$\\(DESTDIR\\)/usr")
|
| 116 | "$(DESTDIR)")
|
| 117 | |
| 118 | ((".*find.*chrpath.*")
|
| 119 | ""))))
|
| 120 | (add-after 'unpack 'use-absolute-mawk
|
| 121 | (lambda* (#:key inputs #:allow-other-keys)
|
| 122 | (let ((mawk (search-input-file inputs "bin/mawk")))
|
| 123 | (substitute* '("vnl-filter" "lib/Vnlog/Util.pm")
|
| 124 | (("'mawk'")
|
| 125 | (string-append "'" mawk "'"))))))
|
| 126 | (delete 'configure)
|
| 127 | (add-before 'check 'disable-python2-test
|
| 128 | (lambda _
|
| 129 | (delete-file "test/test_python2_parser.sh")
|
| 130 | (substitute* "GNUmakefile"
|
| 131 | ((".*test/test_python2_parser\\.sh\\.RUN.*")
|
| 132 | ""))))
|
| 133 | (add-after 'install 'wrap
|
| 134 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 135 | (let* ((out (assoc-ref outputs "out"))
|
| 136 | (PERL5LIB (string-append
|
| 137 | out "/lib/perl5/site_perl/"
|
| 138 | #$(package-version
|
| 139 | (this-package-input "perl"))
|
| 140 | ":" (getenv "PERL5LIB"))))
|
| 141 | (for-each (lambda (script)
|
| 142 | (wrap-program script
|
| 143 | `("PERL5LIB" ":" prefix (,PERL5LIB))))
|
| 144 | (find-files (string-append out "/bin"))))))
|
| 145 | (add-after 'wrap 'check-wrapped-executables
|
| 146 | (lambda* (#:key outputs #:allow-other-keys)
|
| 147 | (let ((out (assoc-ref outputs "out")))
|
| 148 | |
| 149 | |
| 150 | (unsetenv "PERL5LIB")
|
| 151 | (for-each (lambda (script)
|
| 152 | (invoke/quiet script "--help"))
|
| 153 | (find-files (string-append out "/bin")
|
| 154 | "^vnl-[[:lower:]]+$"))))))))
|
| 155 | (synopsis "Process labelled tabular ASCII data on the command line")
|
| 156 | (description
|
| 157 | "Vnlog (pronounced @dfn{vanillog}) is a toolkit for manipulating
|
| 158 | tabular ASCII data with labelled fields using regular command-line tools.")
|
| 159 | (license lgpl2.1+)))
|