ec508092e5f9a53b7d18676a9476f8ecbcf25770 — jgart a month ago e0bae02
add dateparse
1 files changed, 51 insertions(+), 0 deletions(-)

M guixrus/packages/misc.scm
M guixrus/packages/misc.scm => guixrus/packages/misc.scm +51 -0
@@ 28,6 28,7 @@
  #:use-module (guix build-system python)
  #:use-module (guix build-system perl)
  #:use-module  (guix build-system cmake)
  #:use-module  (guix build-system trivial)
  #:use-module (guix build-system perl)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix utils)

@@ 1316,3 1317,53 @@ mouse hovers a specific date.  Else, it shows the event for the current week.")
the fretboard.")
      (license license:expat))))

(define-public dateparse
  (let ((commit "069050d60bf6ee06f89414539a0a802f77e22340")
        (revision "0"))
   (name "dateparse")
   (version "0")
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/pflanze/chj-bin")
             (commit commit)))
       (file-name (git-file-name name version))
   (build-system trivial-build-system)
     `(#:modules ((guix build utils))
         (use-modules (guix build utils))
         (let* ((source (assoc-ref %build-inputs "source"))
                (out (assoc-ref %outputs "out"))
                (bin (string-append out "/bin")))
         (copy-recursively source ".")
         (mkdir-p bin)
         (substitute* "dateparse"
            (string-append (assoc-ref %build-inputs "perl") "/bin/perl")))
         (install-file "dateparse" bin)))))
      (list perl))
      (list perl-getopt-long 
   (home-page "https://github.com/pflanze/chj-bin/")
   (synopsis "Perl script that parses dates and times.")
"@command{dateparse} parses the given date string(s) (or reads all of
stdin as one datestring) and displays the result(s) as unixtime and
localtime on stdout.  If the string contains some kind of dash or 'to',
it will parse both start and end time and show them both with a minus in
between.  @code{dateparse} accepts locations in Continent/City format as
well as some abbreviated time zones without daylight savings information
(PT, ET, BT).  If the @code{TZ} env var is set, it adds the time zone
name to the output.")
   (license license:expat))))