From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRMvu-0004T7-18 for guix-patches@gnu.org; Tue, 19 Dec 2017 13:48:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRMvq-0002YJ-Rk for guix-patches@gnu.org; Tue, 19 Dec 2017 13:48:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:33952) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRMvq-0002Xz-NM for guix-patches@gnu.org; Tue, 19 Dec 2017 13:48:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eRMvq-0003ua-Fp for guix-patches@gnu.org; Tue, 19 Dec 2017 13:48:02 -0500 Subject: [bug#29359] [PATCH 07/31] gnu: Add java-jansi-native. Resent-Message-ID: References: <20171119175805.902-1-julien@lepiller.eu> <20171119175805.902-7-julien@lepiller.eu> From: Ricardo Wurmus In-reply-to: <20171119175805.902-7-julien@lepiller.eu> Date: Sun, 17 Dec 2017 23:57:02 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: <87wp1lm08x.fsf@elephly.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Julien Lepiller Cc: 29359@debbugs.gnu.org Julien Lepiller writes: > * gnu/packages/java.scm (java-jansi-native): New variable. [=E2=80=A6] > +(define-public java-jansi-native > + (package > + (name "java-jansi-native") > + (version "1.7") > + (source (origin > + (method url-fetch) > + (uri (string-append "https://github.com/fusesource/jansi-n= ative/" > + "archive/jansi-native-" version ".tar.= gz")) > + (sha256 > + (base32 > + "0j2ydlgxbzbgshqkwghbxxxnbnx1mmjgd6k5fw6xfvxw1z956yqf"))= )) > + (build-system ant-build-system) > + (arguments > + `(#:jar-name "jansi-native.jar" > + #:source-dir "src/main/java" > + #:tests? #f; no tests > + #:phases > + (modify-phases %standard-phases > + (add-before 'build 'build-native > + (lambda* (#:key inputs #:allow-other-keys) > + (substitute* "src/main/native-package/src/jansi_ttyname.c" > + (("#include \"jansi_.*") "")) Move this under the =E2=80=9Cwith-directory-excursion=E2=80=9D to shorten t= he file name. > + ;; there are more required files for windows in windows/ > + (with-directory-excursion "src/main/native-package/src" > + (system* "gcc" "-c" "jansi_ttyname.c" "-o" "jansi_ttyname= .o" > + (string-append "-I" (assoc-ref inputs "java-hawt= jni") > + "/include") > + (string-append "-I" (assoc-ref inputs "jdk") > + "/include/linux") > + "-fPIC" "-O2") > + (system* "gcc" "-o" "libjansi.so" "-shared" "jansi_ttynam= e.o")) We shouldn=E2=80=99t throw away the return value. Maybe use (and (zero? = =E2=80=A6) =E2=80=A6) here? > + ;; FIXME: detect one of linux{32,64}, freebsd{32,64}, osx, = windows{32,64} > + ;; This package will only work on x86_64 > + (mkdir-p "build/classes/META-INF/native/linux64") > + (copy-file "src/main/native-package/src/libjansi.so" > + "build/classes/META-INF/native/linux64/libjansi.= so") Is this really necessary or can we change the code to look for libjansi.so elsewhere? That might be easier. Otherwise we should just check the value of =E2=80=9Csystem=E2=80=9D and distinguish between at leas= t i686 and x86_64. > + #t)) > + (add-after 'install 'install-native > + (lambda* (#:key outputs #:allow-other-keys) > + (mkdir-p (string-append (assoc-ref outputs "out") "/include= ")) > + (copy-file "src/main/native-package/src/jansi.h" > + (string-append (assoc-ref outputs "out") > + "/include/jansi.h")) Better use =E2=80=9Cinstall-file=E2=80=9D here (without the target file nam= e). > + (description "Java-jansi-native contains the native library for > jansi.") Please write =E2=80=9C=E2=80=A6for the jansi frobnication library/framework= .=E2=80=9D -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC https://elephly.net