From patchwork Fri Apr 16 01:24:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Gerwitz X-Patchwork-Id: 28579 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6DBAB27BC77; Fri, 16 Apr 2021 02:27:44 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8309927BC76 for ; Fri, 16 Apr 2021 02:27:43 +0100 (BST) Received: from localhost ([::1]:43040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXDGo-0005uT-Lg for patchwork@mira.cbaines.net; Thu, 15 Apr 2021 21:27:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXDGM-0005tS-N9 for guix-patches@gnu.org; Thu, 15 Apr 2021 21:27:14 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56337) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lXDGC-0003Jd-9p for guix-patches@gnu.org; Thu, 15 Apr 2021 21:27:12 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lXDGC-0008S0-7Y for guix-patches@gnu.org; Thu, 15 Apr 2021 21:27:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47789] [PATCH 4/6] gnu: Add java-jline-terminal. Resent-From: Mike Gerwitz Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 16 Apr 2021 01:27:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47789 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47789@debbugs.gnu.org Received: via spool by 47789-submit@debbugs.gnu.org id=B47789.161853641632425 (code B ref 47789); Fri, 16 Apr 2021 01:27:04 +0000 Received: (at 47789) by debbugs.gnu.org; 16 Apr 2021 01:26:56 +0000 Received: from localhost ([127.0.0.1]:39644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXDG3-0008Qu-Uq for submit@debbugs.gnu.org; Thu, 15 Apr 2021 21:26:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39164) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXDG1-0008QW-Pq for 47789@debbugs.gnu.org; Thu, 15 Apr 2021 21:26:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47763) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXDFw-0003Go-Jh for 47789@debbugs.gnu.org; Thu, 15 Apr 2021 21:26:48 -0400 Received: from localhost ([::1]:39237 helo=mikegerwitz-pc) by fencepost.gnu.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lXDFs-0000i3-HK for 47789@debbugs.gnu.org; Thu, 15 Apr 2021 21:26:47 -0400 From: Mike Gerwitz In-Reply-To: Date: Thu, 15 Apr 2021 21:24:15 -0400 References: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) X-From-Line: 180b7d0e03b1f00f1904471815cf987c75e061a6 Mon Sep 17 00:00:00 2001 Message-Id: <180b7d0e03b1f00f1904471815cf987c75e061a6.1618536137.git.mtg@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This is part of JLine 3. I was able to get this working properly under Guix by providing ncurses' infocmp, as well as ensuring the *.caps files were present in the JAR, but similar methods didn't work for the tests; if you have Java knowledge, I'd appreciate the help getting those tests enabled. * gnu/packages/java.scm (java-jline-terminal): New variable. --- gnu/packages/java.scm | 58 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index b4e4cafddb..9bf26b1dc7 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -71,6 +71,7 @@ #:use-module (gnu packages maths) #:use-module (gnu packages maven) #:use-module (gnu packages maven-parent-pom) + #:use-module (gnu packages ncurses) #:use-module (gnu packages nss) #:use-module (gnu packages onc-rpc) #:use-module (gnu packages web) @@ -12465,6 +12466,63 @@ features that bring it on par with the Z shell line editor.") ("java-junit" ,java-junit) ("java-hawtjni" ,java-hawtjni))))) +(define-public java-jline-terminal + (package + (name "java-jline-terminal") + (version "3.14.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jline/jline3") + (commit (string-append "jline-parent-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0ilhk9ljp0pivl1rn0bb06syshc67p6imcjhrg6vr7kv15p3w4lr")))) + (build-system ant-build-system) + (arguments + `(#:jar-name "jline-terminal.jar" + #:jdk ,openjdk11 + #:tests? #f; TODO: tests fail on *.caps resource lookups + #:source-dir "terminal/src/main/java" + #:test-dir "terminal/src/test" + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'remove-build-file + (lambda _ + ;; Conflicts with build directory generated by ant-build-system. + (delete-file "build"))) + (add-after 'unpack 'patch-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "terminal/src/main/java/org/jline/utils/OSUtils.java" + (("= \"infocmp\"") + (string-append "= \"" (assoc-ref inputs "ncurses") + "/bin/infocmp\"")) + (("= \"(s?tty)\"" _ cmd) + (string-append "= \"" (assoc-ref inputs "coreutils") + "/bin/" cmd "\""))))) + ;; Resources are not added to the JAR by ant-build-system. + (add-after 'build 'add-resources + (lambda* (#:key jar-name source-dir #:allow-other-keys) + (let ((build (string-append (getcwd) "/build"))) + (with-directory-excursion + (string-append source-dir "/../resources") + (apply invoke "jar" "-uvf" + (string-append build "/jar/" jar-name) + (find-files "."))))))))) + (inputs + `(("ncurses" ,ncurses))); infocmp + (home-page "https://github.com/jline/jline3") + (synopsis "Java JLine Terminal API and implementations") + (description "JLine is a Java library for handling console input. It is +similar in functionality to BSD editline and GNU readline but with additional +features that bring it in par with ZSH line editor. People familiar with the +readline/editline capabilities for modern shells (such as bash and tcsh) will +find most of the command editing features of JLine to be familiar. + +This package includes the @var{Terminal} API and implementations.") + (license license:bsd-3))) + (define-public java-xmlunit (package (name "java-xmlunit")