From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WPHuA8at42GtsQAAgWs5BA (envelope-from ) for ; Sun, 16 Jan 2022 06:31:50 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id CKxuAMat42EqJQEAauVa8A (envelope-from ) for ; Sun, 16 Jan 2022 06:31:50 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 318EB425AB for ; Sun, 16 Jan 2022 06:31:49 +0100 (CET) Received: from localhost ([::1]:43912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8y8p-0004qW-Ls for larch@yhetil.org; Sun, 16 Jan 2022 00:31:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8y87-0004mK-MV for guix-patches@gnu.org; Sun, 16 Jan 2022 00:31:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8y85-0001rS-VK for guix-patches@gnu.org; Sun, 16 Jan 2022 00:31:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n8y85-0002q8-Re for guix-patches@gnu.org; Sun, 16 Jan 2022 00:31:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#48463] gnu: Add j. Resent-From: elaexuotee@wilsonb.com Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 16 Jan 2022 05:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48463 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Liliana Marie Prikler Cc: Maxime Devos , 48463@debbugs.gnu.org Received: via spool by 48463-submit@debbugs.gnu.org id=B48463.164231102810871 (code B ref 48463); Sun, 16 Jan 2022 05:31:01 +0000 Received: (at 48463) by debbugs.gnu.org; 16 Jan 2022 05:30:28 +0000 Received: from localhost ([127.0.0.1]:42314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n8y7Q-0002p8-Ln for submit@debbugs.gnu.org; Sun, 16 Jan 2022 00:30:28 -0500 Received: from m42-5.mailgun.net ([69.72.42.5]:48803) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n8y7M-0002om-CY for 48463@debbugs.gnu.org; Sun, 16 Jan 2022 00:30:20 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.wilsonb.com; q=dns/txt; s=krs; t=1642311016; h=Content-Type: MIME-Version: Message-Id: In-Reply-To: References: From: Subject: Cc: To: Date: Sender; bh=VSec8Vgc6lZVVq2icT8XtxWTf//CnXvJjxHsafS5FFg=; b=EYmNoEISF/O0TtLZuCF70oEkSn29f+u9+mknDafXVFTlXBN6/hAzsVspoRZknpincb2AEg4X 0KmQ856URqgSSm8flLHCOKAHzCCOEIJaS42GVCzqsEoiPTcJyTHz/nS4VmdFCM/CICgN9oWU LgD/uwo0h7CYTkieByhYc7r+gpbKoAFus81r1wVEEiSIbeRnW0XSg935SJUzBBp6gVvT6s7k tytx0yJguLTeMxxPOkzApQ5vV1licLIcbz7tTW2v46BrUJJjmThgoaI7B/7TIwUSenFFCnj+ TVhmGpMiBw8mY0JLgdpb+x6EBYeNrjoQ8KCiQJk1lZvrxNIrdHnxAQ== X-Mailgun-Sending-Ip: 69.72.42.5 X-Mailgun-Sid: WyJjZGI4NCIsICI0ODQ2M0BkZWJidWdzLmdudS5vcmciLCAiMDg1NDdhIl0= Received: from wilsonb.com (wilsonb.com [104.199.203.42]) by smtp-out-n07.prod.us-west-2.postgun.com with SMTP id 61e3ad6213aac22fbe3da903 (version=TLS1.3, cipher=TLS_AES_128_GCM_SHA256); Sun, 16 Jan 2022 05:30:10 GMT Received: from localhost (q045100.dynamic.ppp.asahi-net.or.jp [203.181.45.100]) by wilsonb.com (Postfix) with ESMTPSA id 68AFFA04C7; Sun, 16 Jan 2022 05:30:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wilsonb.com; s=201703; t=1642311005; bh=VSec8Vgc6lZVVq2icT8XtxWTf//CnXvJjxHsafS5FFg=; h=Date:To:Cc:Subject:From:References:In-Reply-To:From; b=T2illMgd13ySjVdXsVE3n7HqHiDbiskdJyrevXD1KbwB1zH7xjbGOuT6Zw1AO0bBn VZv/HdUCLs+DIfgWxx8h1kSEF0io9+zx9359J/pKTYByyC0XY/7OLLXI+8aR40FXkf BXv8U49J2vc+T53HvMnbB9weGpFjD1LEnMs5eoI1UWLXkW4aQ0cp6gK17P4teSUA5W LPO1KLIXBqRQ9NicDD6VmXSvFdk1vTUKPAoW8DQdnocRzwlIHwobcLGUfXkh27xDE+ CsbzZ6j7W5AJeoGFtPBGKCu3ldqYQFJzOgZsSMBSffWq9HuOVa5A6Wlb+3UGyNV2BI d+jG6N9R8BphP4awY7fQw6TE/u3vpMyo9f+vd+fCcGofr/MwIpkwXbPJ51Upy+7s+T yZZFeRqLxLLwqhHIYHQSCh5qO1B/jClgFrHU85AWczzkEYdMhIUqe9hYoqOGPIEsDT JD4S4kLMZEo7wQfwcamTJNBy+I/WedJKo6DrRLieoLMaHobdiHE3pgR3yKUxYDJada Zp00hJWIp4wSsuoVPg4glKbZu2YW7AyYmAhzI7+D3h9AY0lIR7xoCMn7oq3VUdfSso +FiNpzKnQRIBioya+DERxrdNlUvhPr2K2Y1g+KM+cgPZhYQ7bMgWbsQujli7GAXMdt ALqOYN0CCGQaAeBmErlWMzPs= Date: Sun, 16 Jan 2022 14:29:58 +0900 References: <3LOAUDT0FLL4U.2SOD925YP915T@wilsonb.com> <8b853d0585505ce29c9afc638b644fa34805e6c0.camel@student.tugraz.at> <293L8YPQS4CLB.3VK1B1A36XNAY@wilsonb.com> <5d30160bd2a4592459cd407f99cbd3edadb1db1b.camel@student.tugraz.at> <27DCD25Y68ZWJ.2HRC4G65PWIA7@wilsonb.com> <94f4625dcb0479d873cf60449631527e841fd457.camel@gmail.com> <2JQJMV0O718S1.31FZE8GKCTLPF@wilsonb.com> <90704c2259f576a14fb1268219e8c0dc2b3bf289.camel@telenet.be> <2P322C327XW0Q.21O5A4IFGMNDI@wilsonb.com> <72aff035c93f9f91afa54ef5b51c7381b0b02ccb.camel@gmail.com> <3MMTDZQJQ8IR6.334ZWY8AD0487@wilsonb.com> <62d37956f16c08bc4ce26e44da16dce704ddd0f8.camel@gmail.com> <24ZUUMG4QYSHN.2OS7YAMCKREUA@wilsonb.com> <83aba994536bec60f79900d551d4801c967742bd.camel@gmail.com> In-Reply-To: <83aba994536bec60f79900d551d4801c967742bd.camel@gmail.com> Message-Id: <25Z6NGGGNJYD1.3S7A1QLFX7I9Y@wilsonb.com> User-Agent: mblaze/1.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_21b9c7414791ef730b72da0d_=_" 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: elaexuotee@wilsonb.com X-ACL-Warn: , elaexuotee--- via Guix-patches From: elaexuotee--- via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642311109; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=VSec8Vgc6lZVVq2icT8XtxWTf//CnXvJjxHsafS5FFg=; b=TrQuafYUgIoCt/Yf9CZ37w7jaYyv3fNJfoO1XltTu+0tmXLfUvD6bCgnLFbtjHVo6mUjNl XXPrmGeU3LKXDZCSHvONwK/FJdDs7bdvglneZ3nz8t1oxrFrT4T/15D73EAUD4EhxKAWo2 qv9BiCq3jYjsCAlmxvfoJpUBkxs/uPRcvz+sQUY4tS16vsymuye5u0EDlBBRI09AKdkkrE c1yRJ1l9vpIPi3PQjWtMMSCHYGrcxKi4SHBjaSuicRtg4Cmqvyniku6FyAN1fSYYJ9rzMU mjqgw9bZX1DoIIBZ8Mc22ivsLqrWyeWhvervRrYcvzQ0+vvV6SLzd15HfxiqEQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642311109; a=rsa-sha256; cv=none; b=sVGnnoTSj3JkYAnvnVnAhxAiXjXXpXhfCthvUNoDtYaD0wQhcYE79LQFje29n/YMGbvt3R /lsc/8kz4uncwh3q6DyA0G3mmOi0jIxuqnkC3aM8ZSN+mJX/fq6IBjcxlqfai/H+w2cPrJ EX+3WX6hycvkKrO6Fzzw/0ML3zYt8wL8kkuVel3K+5JFMEHuMfSqIDoHiJ6rCFgb4IxDi3 oE179Ilyk6RxpDrj34FZneXeERTixTcQk6vnFty36e7fbDaoD/YV5ME1MNPxMLrUXAKtFd nMuny1JG1F4c0mT+JF8VMaoX1kRs+c2m4sEggiBjfZ/XgLDjcmjJ3R5T1qR6cA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mg.wilsonb.com header.s=krs header.b=EYmNoEIS; dkim=fail ("headers rsa verify failed") header.d=wilsonb.com header.s=201703 header.b=T2illMgd; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.62 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mg.wilsonb.com header.s=krs header.b=EYmNoEIS; dkim=fail ("headers rsa verify failed") header.d=wilsonb.com header.s=201703 header.b=T2illMgd; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 318EB425AB X-Spam-Score: -3.62 X-Migadu-Scanner: scn1.migadu.com X-TUID: FVmguInZiMiL This is a multipart message in MIME format. ------_=_21b9c7414791ef730b72da0d_=_ Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Good day. > > I just changed the logic to always keep a dot after MAJOR, and then > > use hyphens after that. > I'm not quite sure if I agree with that decision, but you're right that > @MAJOR ought to be supported. How about enforcing that MINOR exists if > REVISION and COMMIT are used and setting it to "0" if there hasn't been > an "a" beta or release yet? Interesting idea. How about just always forcing a MINOR part, setting to "0= " if upstream doesn't have one? > > + (native-inputs `(("clang-toolchain" ,clang-toolchain))) > > + (inputs (cons* `("libedit" ,libedit) > > + `("libomp" ,libomp) > > + `("ijconsole" ,(ijconsole)) > > + extra-inputs)) > My variant already had these translated to the new style. If you're > not using old style on purpose =E2=80=93 and I don't think you do =E2=80=93= you might > want to make your life easier by dropping these labels and going with > plain (list)s. Yeah, I had trouble getting that to work nicely with the ijconsole input. S= ee below for more details. > You might want to use an aux-file for that. Name it > jsoftware/profile.ijs if it's just a plain file (which I assume). I > recently pushed a commit towards renpy which replaces a large format > block by fetching an auxiliary file and substitute*, which you can take > as reference if you're unsure. Note that renpy still uses old-style > inputs, so the assoc-ref makes sense in that case; however, you should > be able to also express this pattern in terms of search-input-file > somehow (or otherwise express it as gexp). Oooh. Neat. That makes adding and testing changes their much nicer. Note, I wasn't able to find a nice way to get this working together with th= e new inputs syntax, since `search-input-files' only searches under input pat= hs which are directories. The ijconsole and profilex input are regular files, so it raises a search-e= rror. One workaronud is to put ijconsole and profilex together under a file-union= input, but I found that almost worse than just using old-style syntax. If you have a better idea, I am all ears. Cheers! ------_=_21b9c7414791ef730b72da0d_=_ Content-Disposition: attachment; filename=0001-gnu-Add-j.patch Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable =46rom 49d44631c736bb45fe5f32ee446e7af506f5145c Mon Sep 17 00:00:00 2001 =46rom: "B. Wilson" =44ate: Wed, 12 Jan 2022 18:44:36 +0900 =53ubject: [PATCH] gnu: Add j. =54o: guix-patches@gnu.org =0A* gnu/packages/jsoftware.scm: New file. =2A gnu/packages/aux-files/jsoftware/profilex.ijs: New file. =2A gnu/packages/patches/jsoftware-j901-f-fixes.patch: New file. =2A gnu/local.mk: Register it. =2D-- =20gnu/local.mk | 1 + =20gnu/packages/aux-files/jsoftware/profilex.ijs | 14 + =20gnu/packages/jsoftware.scm | 428 ++++++++++++++++++ =20.../patches/jsoftware-j901-f-fixes.patch | 80 ++++ =204 files changed, 523 insertions(+) =20create mode 100644 gnu/packages/aux-files/jsoftware/profilex.ijs =20create mode 100644 gnu/packages/jsoftware.scm =20create mode 100644 gnu/packages/patches/jsoftware-j901-f-fixes.patch =0Adiff --git a/gnu/local.mk b/gnu/local.mk =69ndex 3335d368df..fdbcb364c7 100644 =2D-- a/gnu/local.mk =2B++ b/gnu/local.mk =40@ -1293,6 +1293,7 @@ dist_patch_DATA =3D \ =20 %D%/packages/patches/irrlicht-use-system-libs.patch \ =20 %D%/packages/patches/isc-dhcp-gcc-compat.patch \ =20 %D%/packages/patches/isl-0.11.1-aarch64-support.patch \ =2B %D%/packages/patches/jsoftware-j901-f-fixes.patch \ =20 %D%/packages/patches/json-c-0.13-CVE-2020-12762.patch \ =20 %D%/packages/patches/json-c-0.12-CVE-2020-12762.patch \ =20 %D%/packages/patches/jsoncpp-pkg-config-version.patch \ =64iff --git a/gnu/packages/aux-files/jsoftware/profilex.ijs b/gnu/packages= =2Faux-files/jsoftware/profilex.ijs =6Eew file mode 100644 =69ndex 0000000000..30e0d229e2 =2D-- /dev/null =2B++ b/gnu/packages/aux-files/jsoftware/profilex.ijs =40@ -0,0 +1,14 @@ =2B'jtype jversion'=3D. (3&{,{.) <;._2 ,&'/' 9!:14'' =2Bbasedir=3D. ({.~ _2 { I.@:=3D&'/') BINPATH =2B =2Bshare=3D. basedir,'/share/j' =2Bsystem=3D. share,'/system' =2Btools=3D. share,'/tools' =2B =2Buser=3D. home,'/.config/j/',jversion =2Baddons=3D. user,'/addons' =2Bbreak=3D. user,'/break' =2Bconfig=3D. user,'/config' =2Binstall=3D. user,'/install' =2Bsnap=3D. user,'/snap' =2Btemp=3D. user,'/temp' =64iff --git a/gnu/packages/jsoftware.scm b/gnu/packages/jsoftware.scm =6Eew file mode 100644 =69ndex 0000000000..a28e786123 =2D-- /dev/null =2B++ b/gnu/packages/jsoftware.scm =40@ -0,0 +1,428 @@ =2B;;; GNU Guix --- Functional package management for GNU =2B;;; Copyright =C2=A9 2022 B. Wilson =2B;;; =2B;;; This file is part of GNU Guix. =2B;;; =2B;;; GNU Guix is free software; you can redistribute it and/or modify it =2B;;; under the terms of the GNU General Public License as published by =2B;;; the Free Software Foundation; either version 3 of the License, or (a= =74 =2B;;; your option) any later version. =2B;;; =2B;;; GNU Guix is distributed in the hope that it will be useful, but =2B;;; WITHOUT ANY WARRANTY; without even the implied warranty of =2B;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the =2B;;; GNU General Public License for more details. =2B;;; =2B;;; You should have received a copy of the GNU General Public License =2B;;; along with GNU Guix. If not, see . =2B =2B(define-module (gnu packages jsoftware) =2B #:use-module (guix build utils) =2B #:use-module (guix build-system gnu) =2B #:use-module (guix build-system trivial) =2B #:use-module (guix git-download) =2B #:use-module ((guix licenses) #:prefix license:) =2B #:use-module (guix packages) =2B #:use-module (guix utils) =2B #:use-module (gnu packages) =2B #:use-module (gnu packages libedit) =2B #:use-module (gnu packages llvm) =2B #:use-module (gnu packages maths) =2B #:use-module (guix gexp) =2B #:use-module (ice-9 ftw) =2B #:use-module (ice-9 match) =2B #:use-module (ice-9 regex) =2B #:use-module (ice-9 rdelim) =2B #:use-module (srfi srfi-1) =2B #:use-module (srfi srfi-26) =2B #:use-module (srfi srfi-71)) =2B =2B =2B;;; TODO: Make importer and packages for J addons: =2B;;; http://www.jsoftware.com/jal/ =2B =2B;;; TODO: Package up j80x series =2B =2B =2B(define (jname prefix release-type) =2B "Return a package name for J, including RELEASE-TYPE only if not 'rele= =61se." =2B (match release-type =2B ('release prefix) =2B (_ (string-append prefix "-" (symbol->string release-type))))= =29 =2B =2B;; We want a version string where packages specifications like pkg@MAJOR= =20work. =2B;; This requires that the first version part separator be dot. Subseque= =6Et =2B;; separators are hyphen, mirror `git-version' etc. =2B(define* (jversion->string major #:optional minor revision commit) =2B "Return a version string formatted like MAJOR.MINOR-REVISION-COMMIT. = =4Fnly =2B MAJOR is required, and MINOR defaults to ``0'' if not supplied." =2B (let* ((commit (and commit (string-take commit 7))) =2B (minor (or minor "0")) =2B (sub-parts (filter (cut (compose not eq?) #f <>) =2B (list minor revision commit)))) =2B (string-append major "." (string-join sub-parts "-")))) =2B =2B(define* (jrelease-string release-type #:optional version-minor) =2B "Construct J release identifier string." =2B (let ((release-type (symbol->string release-type))) =2B (if version-minor =2B (string-append release-type "-" version-minor) =2B release-type))) =2B =2B(define* (jinfo->git-tag version-major release-type #:optional version-m= =69nor) =2B "Given version parameters, construct a git tag for upstream releases."= =0A+ (string-append "j" version-major (jrelease-string release-type versio= =6E-minor))) =2B =2B;; G-exp script that detects AVX/AVX2 support at runtime and executes jc= =6Fnsole =2B;; with the appropriate libj.so and profile.ijs." =2B(define ijconsole =2B (with-imported-modules '((guix cpu) =2B (guix memoization) =2B (guix profiling) =2B (guix sets) =2B (srfi srfi-26)) =2B (program-file "ijconsole" =2B #~(begin =2B (use-modules ((guix cpu) #:select (cpu-flags current-cpu))= =0A+ ((guix sets) #:select (set-contains?)) =2B ((srfi srfi-26) #:select (cute))) =2B =2B ;; Assume that this script will be installed under bin/. =2B (define %basedir (dirname (dirname (current-filename)))) =2B =2B (let* ((jconsole (string-append %basedir "/libexec/j/jconsole"= =29) =2B (cpu-has-flag? =2B (cute set-contains? (cpu-flags (current-cpu)) <>)) =2B (libj (format #f "~a/lib/j/libj~a.so" %basedir =2B (cond ((cpu-has-flag? "avx2") "-avx2") =2B ((cpu-has-flag? "avx") "-avx") =2B (else "")))) =2B (jprofile (string-append %basedir "/etc/j/profile.ijs")= =29) =2B (apply execl jconsole "ijconsole" "-lib" libj "-jprofile" jp= =72ofile =2B (cdr (command-line)))))))) =2B =2B(define* (make-j #:key =2B version =2B revision =2B hash =2B tag =2B commit =2B (release-type 'release) =2B (patches '()) =2B (extra-inputs '()) =2B (extra-envars '()) =2B (builder "guix.gnu.org")) =2B (let* ((version-major version-minor (if (pair? version) =2B (car+cdr version) =2B (values version #f)))) =2B (package =2B (name (jname "jsoftware-j" release-type)) =2B (version (jversion->string version-major version-minor revision commi= =74)) =2B (source =2B (origin =2B (method git-fetch) =2B (uri (git-reference =2B (url "https://github.com/jsoftware/jsource") =2B (commit (or commit tag =2B (jinfo->git-tag version-major =2B release-type =2B version-minor))))) =2B (sha256 (base32 hash)) =2B (file-name (git-file-name name version)) =2B (patches patches))) =2B (build-system gnu-build-system) =2B (native-inputs (list clang-toolchain)) =2B (inputs (cons* `("libedit" ,libedit) =2B `("libomp" ,libomp) =2B `("ijconsole" ,ijconsole) =2B ;; profilex.ijs overrides ~install and ~addons =2B ;; directories to reside under the user-writable ~use= =72. =2B ;; This allows local-install of addons via pacman. T= =4FDO: =2B ;; Guix-ify J addons as well. =2B `("profilex" ,(search-auxiliary-file =2B "jsoftware/profilex.ijs")) =2B extra-inputs)) =2B (arguments =2B `(#:modules (((ice-9 ftw) #:select (scandir)) =2B ((ice-9 popen) #:select (open-pipe* close-pipe)) =2B ((ice-9 regex) #:select (match:substring string-match))= =0A+ ((ice-9 threads) #:select (parallel par-for-each)) =2B ((srfi srfi-26) #:select (cut)) =2B ((srfi srfi-1) #:select (fold)) =2B ,@%gnu-build-system-modules) =2B #:phases =2B ;; Upstream's build system consists of ad-hoc scripts that build b= =75ild up =2B ;; (very complicated) environment variables to pass to make. The = =62asic =2B ;; build process looks like this: =2B ;; =2B ;; 1) Copy jsrc/jversion-x.h to jsrc/jversion.h and edit values;= =0A+ ;; 2) Set jplatform and j64x environment variables; =2B ;; 3) Run make2/build_jconsole.sh and make2/build_libj.sh; =2B ;; =2B ;; However, upstream expects users to run J directly from the sour= =63e =2B ;; directory; they do not supply a make `install' target. Thus it= =20takes =2B ;; some massaging to install files in FHS-style directories. =2B (modify-phases %standard-phases =2B ;; In particular, we have to set up =2B ;; =2B ;; 1) jsrc/jversion.h as in a typical build; =2B ;; 2) jlibrary/bin/profilex.ijs to point to writable directori= =65s; =2B ;; 3) make2/build_*.sh to respect standard build conventions; =2B ;; 4) jsrc/jconsole.c to fix libedit dlopen; and =2B ;; 5) Hard coded references to addons directory. =2B (replace 'configure =2B (lambda* (#:key target inputs outputs #:allow-other-keys) =2B (let* ((clang-toolchain (assoc-ref inputs "clang-toolchain")= =29 =2B (clang (string-append clang-toolchain "/bin/clang")) =2B (libedit (assoc-ref inputs "libedit")) =2B (out (assoc-ref outputs "out"))) =2B ;; Set up build constants =2B (copy-file "jsrc/jversion-x.h" "jsrc/jversion.h") =2B (substitute* "jsrc/jversion.h" =2B (("^#define jversion.*$") =2B (format #f "#define jversion ~s\n" ,version-major)) =2B (("^#define jtype.*$") =2B (format #f "#define jtype ~s\n" =2B ,(jrelease-string release-type version-minor)))= =0A+ (("^#define jbuilder.*$") =2B (format #f "#define jbuilder ~s\n" ,builder))) =2B ;; Munge the build scripts into reason: =2B ;; 1. Short-circuit the fragile compiler detection; =2B ;; 2. Make sure to include our CFLAGS and LFLAGS; and =2B ;; 3. Propagate script errors to top level. =2B (for-each =2B (lambda (file) =2B (with-directory-excursion "make2" =2B (substitute* file =2B ;; The `compiler' variable doesn't point to the act= =75al =2B ;; compiler. It is just a switch to tell the build= =0A+ ;; scripts whether to use gcc- or clang-specific f= =6Cags. =2B (("^compiler=3D.*$") "compiler=3Dclang\n") =2B (("^LDFLAGS=3D\"" def) (string-append def "$LDFLAGS= =20")) =2B (("^(common=3D\")(\\$USETHREAD.*)$" _ def rest) =2B (string-append def "$CFLAGS " rest)) =2B (("^#!.*" shebang) =2B (string-append shebang "set -o errexit\n"))))) =2B '("build_jconsole.sh" "build_libj.sh")) =2B ;; The jconsole manually loads libedit with dlopen. The p= =61th =2B ;; must be absolute to correctly point to our input. =2B (substitute* "jsrc/jconsole.c" =2B (("libedit\\.so\\.[0-9]" so-file) =2B (format #f "~a/lib/~a" libedit so-file))) =2B ;; The ~addons/dev directory supplies tentative J-script =2B ;; definitions of new J engine functionality. Since we po= =69nt =2B ;; ~addons under the ~user directory, we move it under ~sy= =73tem =2B ;; instead, which sits as-is in the output. =2B (with-directory-excursion "jsrc" =2B (for-each =2B (lambda (file) =2B (substitute* file (("~addons/dev") "~system/dev"))) =2B (scandir "." =2B (lambda (f) (eq? (stat:type (stat f)) 'regular))))) =2B ;; Implementation of 9!:14 records build time which breaks= =20build =2B ;; reproducibility. Note that upstream code depends on th= =65 exact =2B ;; format of these strings, so we need to mimic the standa= =72d. =2B (substitute* "jsrc/j.c" =2B (("__DATE__") "\"Jan 01 1970\"") =2B (("__TIME__") "\"00:00:00\"")) =2B ;; Upstream recommends using clang, with GCC support being= =0A+ ;; second-class, often resulting in build failures. =2B (setenv "CC" clang)))) =2B =2B ;; The build output depends primarily on the values of the `jpla= =74form' =2B ;; and `j64x' environment variables. If the target is ARM, then= =0A+ ;; `jplatform' is "raspberry", otherwise it is `linux'. In add= =69tion to =2B ;; 32- and 64- bit versions, `j64x' controlls whether AVX or AVX= =32 =2B ;; variants of libj are built. =2B ;; =2B ;; However, build targets are not fine-grained enough to disting= =75ish =2B ;; between CPU features. Thus we build and install all variants= =20of =2B ;; libj, expecting jconsole to be called with a wrapper script t= =68at =2B ;; detects AVX features and loads the appropriate libj at runtim= =65. =2B (replace 'build =2B (lambda _ =2B (setenv "USE_OPENMP" "1") =2B (setenv "USE_THREAD" "1") =2B (for-each (lambda (var-val) (apply setenv var-val)) =2B (quote ,extra-envars)) =2B ;; The build scripts assume that PWD is make2. =2B (with-directory-excursion "make2" =2B (let* ((platform ,(if (target-arm?) "raspberry" "linux")) =2B (target-bit ,(if (target-64bit?) "64" "32")) =2B (run (lambda* (script #:key (avx "")) =2B (invoke "env" =2B (string-append "jplatform=3D" platfo= =72m) =2B (string-append "j64x=3Dj" target-bit= =20avx) =2B script)))) =2B (parallel =2B ;; Since jconsole doesn't depend on AVX features, we j= =75st =2B ;; build it once. =2B (run "./build_jconsole.sh") =2B (run "./build_libj.sh") =2B (if ,(target-64bit?) =2B (parallel =2B (run "./build_libj.sh" #:avx "avx") =2B (run "./build_libj.sh" #:avx "avx2")))))))) =2B ;; The test suite is expected to be run as follows for each vari= =61nt of =2B ;; libj that we build: =2B ;; =2B ;; $ echo 'RUN ddall' | jconsole test/tsu.ijs =2B ;; =2B ;; This requires a working jconsole with accessible jlibrary fil= =65s. We =2B ;; simply place these all under test/bin. =2B (replace 'check =2B (lambda* (#:key tests? #:allow-other-keys) =2B (when tests? =2B (let ((platform ,(if (target-arm?) "raspberry" "linux"))) =2B (mkdir-p "test/bin") =2B (for-each =2B (lambda (dir) =2B (let ((source (string-append "jlibrary/" dir)) =2B (dest (string-append "test/bin/" dir))) =2B (begin =2B (mkdir-p dest) =2B (copy-recursively source dest)))) =2B '("system" "tools" "addons")) =2B ;; The jlibrary/dev directory only sometimes exists, but= =20needs =2B ;; to be copied into the ~system directory when it does.= =0A+ (for-each =2B (lambda (dev-dir) =2B (if (file-exists? dev-dir) =2B (copy-recursively dev-dir "test/bin/system/dev")))= =0A+ '("jlibrary/dev" "jlibrary/addons/dev")) =2B (par-for-each =2B (lambda (dir) =2B (let* ((bin (string-append "bin/" platform)) =2B (jbit ,(if (target-64bit?) "j64" "j32")) =2B (jconsole (string-append bin "/" jbit =2B "/jconsole")) =2B (source (string-append bin "/" dir)) =2B (dest (string-append "test/bin/" dir))) =2B (begin =2B (mkdir-p dest) =2B (copy-recursively source dest) =2B (install-file "jlibrary/bin/profile.ijs" dest) =2B (install-file jconsole dest) =2B (let* ((jconsole (string-append dest "/jconsole"= =29) =2B (tests "test/tsu.ijs") =2B (port (open-pipe* OPEN_WRITE jconsole tes= =74s))) =2B (display "RUN ddall\n" port) =2B (when (not (zero? (status:exit-val =2B (close-pipe port)))) =2B (error "Some J build tests failed.")))))) =2B (scandir (string-append "bin/" platform) =2B (negate (cut member <> '("." ".."))))) =2B #t)))) =2B ;; Now that everything is built, installation is fairly =2B ;; straightforward, following FHS conventions. The only quirk i= =73 that =2B ;; we install jconsole under /libexec to make room for the wrapp= =65r =2B ;; replacement under /bin. =2B (replace 'install =2B (lambda* (#:key outputs inputs #:allow-other-keys) =2B (let* ((platform ,(if (target-arm?) "raspberry" "linux")) =2B (jbit ,(if (target-64bit?) "j64" "j32")) =2B (out (assoc-ref outputs "out")) =2B (bin (string-append out "/bin")) =2B (etc (string-append out "/etc/j")) =2B (lib (string-append out "/lib/j")) =2B (libexec (string-append out "/libexec/j")) =2B (share (string-append out "/share/j")) =2B (system (string-append share "/system")) =2B (dev (string-append system "/dev"))) =2B (mkdir-p bin) =2B (copy-file (assoc-ref inputs "ijconsole") =2B (string-append bin "/ijconsole-" ,version-major= =29) =2B (mkdir-p lib) =2B (for-each =2B (lambda (jarch) =2B (let* ((jbin (string-join `("bin" ,platform ,jarch) "/= =22)) =2B (javx-match (string-match "avx.*" jarch)) =2B (javx (if (not javx-match) "" =2B (match:substring javx-match))) =2B (sep (if javx-match "-" "")) =2B (source (string-append jbin "/libj.so")) =2B (dest (format #f "~a/libj~a~a.so" lib sep javx)= =29) =2B (copy-file source dest))) =2B (scandir (string-append "bin/" platform) =2B (negate (cut member <> '("." ".."))))) =2B (install-file (string-append "bin/" platform "/" jbit "/jc= =6Fnsole") =2B libexec) =2B (copy-recursively "jlibrary/system" system) =2B (for-each =2B (lambda (source-dev) =2B (if (access? source-dev R_OK) =2B (copy-recursively source-dev dev))) =2B '("jlibrary/dev" "jlibrary/addons/dev")) =2B (install-file "jlibrary/bin/profile.ijs" etc) =2B (copy-file (assoc-ref inputs "profilex") =2B (string-append etc "/profilex.ijs")))))))) =2B (home-page "https://www.jsoftware.com/") =2B (synopsis "Ascii-only, array programming language in the APL family")= =0A+ (description =2B "J is a high-level, general-purpose programming language that is =2Bparticularly suited to the mathematical, statistical, and logical analys= =69s of =2Bdata. It is a powerful tool for developing algorithms and exploring pro= =62lems =2Bthat are not already well understood.") =2B (license license:gpl3+)))) =2B =2B =2B(define-public jsoftware-j-901 =2B (make-j =2B #:version '("901" . "f") =2B #:hash "1776021m0j1aanzwg60by83n53pw7i6afd5wplfzczwk8bywax4p" =2B #:patches (search-patches "jsoftware-j901-f-fixes.patch"))) =2B =2B =2B(define j-build-configuration-with-sleef =2B `(#:extra-inputs (("sleef" ,sleef)) =2B #:extra-envars (("USE_SLEEF_SRC" "0") =2B ("LDFLAGS" "-lsleef")))) =2B =2B(define-public jsoftware-j-902 =2B (apply make-j =2B (append j-build-configuration-with-sleef =2B `(#:version ,'("902" . "b") =2B #:hash "0j67vgikqflwjqacsdicasvyv1k54s2c8vjgwmf0ix7l41p4xqz0")))= =29 =2B =2B =2B(define-public jsoftware-j-903 =2B (apply make-j =2B (append j-build-configuration-with-sleef =2B `(#:version ,'("903" . "a") =2B #:tag "903-release-a" =2B #:hash "1fcfl7q7c2vj4fmnqqc8c6hwgsjm20ff93v8xxfniasss1b2fmc4")))= =29 =2B =2B =2B(define-public (jsoftware-ijconsole-symlink jpkg) =2B "Provide bin/ijconsole symlink that points to pkg's bin/ijconsole-" =2B (package =2B (name "jsoftware-ijconsole") =2B (version (package-version jpkg)) =2B (source #f) =2B (build-system trivial-build-system) =2B (propagated-inputs `(("jpkg" ,jpkg))) =2B (arguments =2B `(#:modules ((guix build utils) =2B (srfi srfi-26)) =2B #:builder =2B (begin =2B (use-modules ((guix build utils) #:select (mkdir-p)) =2B ((ice-9 regex) #:select (string-match)) =2B ((ice-9 ftw) #:select (scandir)) =2B ((srfi srfi-26) #:select (cut))) =2B (let* ((out (assoc-ref %outputs "out")) =2B (jpkg (assoc-ref %build-inputs "jpkg")) =2B (ijconsole (car (scandir (string-append jpkg "/bin") =2B (cut string-match "ijconsole-.*" = =3C>)))) =2B (source (string-append jpkg "/bin/" ijconsole)) =2B (dest (string-append out "/bin/ijconsole"))) =2B (mkdir-p (dirname dest)) =2B (symlink source dest))))) =2B (home-page (package-home-page jpkg)) =2B (synopsis "Provide `ijconsole' symlink to default interpreter version"= =29 =2B (description =2B "The interpreter provided by the J package has a filename like =2Bijconsole-, which provides support for having multiple, concurr= =65nt =2Bversions installed. This package provides a version-agnostic `ijconsole= =27 =2Bsymlink to interpreter version indicated and build time.") =2B (license license:gpl3+))) =64iff --git a/gnu/packages/patches/jsoftware-j901-f-fixes.patch b/gnu/pack= =61ges/patches/jsoftware-j901-f-fixes.patch =6Eew file mode 100644 =69ndex 0000000000..0ac7e94de4 =2D-- /dev/null =2B++ b/gnu/packages/patches/jsoftware-j901-f-fixes.patch =40@ -0,0 +1,80 @@ =2BThis patch fixes two separate issues with ustream sources: =2B =2B* Normalize import paths in jsrc/cip.c =2B =2BUpstream claims to have some build requirements that force them to use s= =74range =2Bimport paths. However, these paths do not exist inside our build chroot.= =0A+ =2B* Fix unititialized variable warning =2B =2BClang 9 issues some warnings which cause the build to fail since upstrea= =6D =2Bcompiles with -Werror. =2B =2B =2Bdiff --git a/jsrc/cip.c b/jsrc/cip.c =2Bindex 61da4088..fb3c03b6 100644 =2B--- a/jsrc/cip.c =2B+++ b/jsrc/cip.c =2B@@ -3,9 +3,9 @@ =2B /* = =20 */ =2B /* Conjunctions: Inner Product = =20 */ =2B=20 =2B-#include "../../jsource/jsrc/j.h" =2B-#include "../../jsource/jsrc/vasm.h" =2B-#include "../../jsource/jsrc/gemm.h" =2B+#include "j.h" =2B+#include "vasm.h" =2B+#include "gemm.h" =2B=20 =2B #define MAXAROWS 384 // max rows of a that we can process to stay in L= =32 cache a strip is m*CACHEHEIGHT, z strip is m*CACHEWIDTH this is wir= =65d to 128*3 - check if you chage =2B=20 =2B@@ -1057,15 +1057,15 @@ static A jtipbx(J jt,A a,A w,C c,C d){A g=3D0,x0= =2Cx1,z;B*av,*av0,b,*v0,*v1,*zv;C c0 =2B switch(c){ =2B case CPLUSDOT: =2B #define F |=3D =2B-#include "../../jsource/jsrc/cip_t.h" =2B+#include "cip_t.h" =2B break; =2B case CSTARDOT: =2B #define F &=3D =2B-#include "../../jsource/jsrc/cip_t.h" =2B+#include "cip_t.h" =2B break; =2B case CNE: =2B #define F ^=3D =2B-#include "../../jsource/jsrc/cip_t.h" =2B+#include "cip_t.h" =2B break; =2B } =2B R z; =2Bdiff --git a/jsrc/gemm.c b/jsrc/gemm.c =2Bindex 51fe306e..b105dfc1 100644 =2B--- a/jsrc/gemm.c =2B+++ b/jsrc/gemm.c =2B@@ -318,7 +318,7 @@ dgemm_nn (I m, =2B _B); =2B=20 =2B // loop 3 =2B- I i; =2B+ I i=3D0; =2B #pragma omp parallel for default(none),private(i),shared(j,l,A,C,mb,nc,= =6Bc,alpha,_beta,_mc,_B,rs_a,cs_a,rs_c,cs_c) =2B for (i=3D0; i