From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WJVJKMI35GEtcwAAgWs5BA (envelope-from ) for ; Sun, 16 Jan 2022 16:20:34 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id YILaJMI35GGPNwAAauVa8A (envelope-from ) for ; Sun, 16 Jan 2022 16:20:34 +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 DCB6F1092B for ; Sun, 16 Jan 2022 16:20:33 +0100 (CET) Received: from localhost ([::1]:58918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n97Kb-0007Vg-3S for larch@yhetil.org; Sun, 16 Jan 2022 10:20:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n97K7-0007Sy-7R for guix-patches@gnu.org; Sun, 16 Jan 2022 10:20:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51161) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n97K6-0000lr-Tq for guix-patches@gnu.org; Sun, 16 Jan 2022 10:20:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n97K6-0008Mg-Na for guix-patches@gnu.org; Sun, 16 Jan 2022 10:20:02 -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 15:20:02 +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.164234638732128 (code B ref 48463); Sun, 16 Jan 2022 15:20:02 +0000 Received: (at 48463) by debbugs.gnu.org; 16 Jan 2022 15:19:47 +0000 Received: from localhost ([127.0.0.1]:44064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n97Ji-0008Lx-9W for submit@debbugs.gnu.org; Sun, 16 Jan 2022 10:19:46 -0500 Received: from m42-5.mailgun.net ([69.72.42.5]:51750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n97Je-0008Li-KA for 48463@debbugs.gnu.org; Sun, 16 Jan 2022 10:19:36 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.wilsonb.com; q=dns/txt; s=krs; t=1642346374; h=Content-Type: MIME-Version: Message-Id: In-Reply-To: References: From: Subject: Cc: To: Date: Sender; bh=kBy6pnncoTjqeLyx3HbB1ZXMU3pbm/35Miv4GXFyDu8=; b=wNxhyTYg3l1/pfJNAtMDBmqEDtLGrHL1v3fOi+FZHJm15bNGFWUdvQ+83RN/+dIoLYCz9i2K aODDtE2d+NNRvQK0hUcn5p/prUTFJLCitTzcfSYeIAQYVYkREajyFzUbzptCb3v6MS/2Gf4z OiHHKXbIhR+k5ny7De6nIHf1qN70VmrDactVakIhbvO1FhG6s93Dyh2POzDboBXR9yRqgSXb NlKBiE6Xz9xHJDmCAr55SA4KgSpAkjEqwkwamG6x5e4zqt3RR4F3u1Mx+PCuoGTxVW6CjtZP WrBvlHaTJpToeEWOGqlDxlqYjSKcL4g/wir7PFOIVyY7Y0F1kOzYRA== 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-n04.prod.us-east-1.postgun.com with SMTP id 61e4378162864ab101d02082 (version=TLS1.3, cipher=TLS_AES_128_GCM_SHA256); Sun, 16 Jan 2022 15:19:29 GMT Received: from localhost (q045100.dynamic.ppp.asahi-net.or.jp [203.181.45.100]) by wilsonb.com (Postfix) with ESMTPSA id 6D308A2E55; Sun, 16 Jan 2022 15:19:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wilsonb.com; s=201703; t=1642346364; bh=kBy6pnncoTjqeLyx3HbB1ZXMU3pbm/35Miv4GXFyDu8=; h=Date:To:Cc:Subject:From:References:In-Reply-To:From; b=XWQgKH/1x2w3nKLOWDHYafnDPNzI+KXEaV/FRK6AXcEbKkHyXq88Yyfr4n4voJ7St gT+NuPdeEhdZJAyALqXW0AyvgI3g7CJSCn9lxGYyr8S/hHiYFEt/qO6zlxDLtRTiDM ehFTgSu8HP5nJii3RLDL8/eB3uHW7GiL9Z7ObZyNFtp7OzV4+WAeHedaRkPMJZVvab Pinu6QWaItBsUWD2yiZZDfb3k2HAi6aHmfp99dvurqTe4IqIlDcPaJfNiErbr+0Of3 uJ8T+2w0aS+UeNxC5CK+VpCnCYeIU3SN41MEcMG5C79JyyS9goK704hn+u3HiZDvKP WdcyGAxD33dZQIk3Ep1G9bfHowhRvj+f3n4gu4mUiUntqGxWd3Qfaa+NFfqo7HUP7/ gMlIbYnUPm5HoxrbZFqsTVEHMfybx79dO4ocO0LtyLy1QYu+vSUqck0M+eqRGvxabf 2aD+mHLx8Ri2ljTO/dhahozvG7CSAtqEGy2oR6vHyQnvDv7yiuvqITRGnwBXykPyqG IoEvCjOe0ylChp1LsFGmo6CDZOLd5zi4IMSoc7cJx7gp/n2MCdXZiSQSgpTsSCYEwI JRJ7uyZF+u9fbhKcJ90KpGoYxPWBIOXzUPaSJUgZEcFsSwzIV6v5lFPFZ2TChcZfNU IpjF/QabEET0ZRP/XqmU8QCE= Date: Mon, 17 Jan 2022 00:19:18 +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> <25Z6NGGGNJYD1.3S7A1QLFX7I9Y@wilsonb.com> In-Reply-To: Message-Id: <24FU0VP6N4ZZ7.3PE5LG30BSNUQ@wilsonb.com> User-Agent: mblaze/1.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_33aee0f95b15bd0b163d3f05_=_" 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=1642346434; 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=kBy6pnncoTjqeLyx3HbB1ZXMU3pbm/35Miv4GXFyDu8=; b=ozBrUALsSSdyNCVFjXuuCrwExXRy93HSM+ojFzul1kzPnnW+QSgf6rG2kbpAsEpgyRXZpV ZTSLLJIjp0C6Y1gAfy8ZKMzSMoXAGTsTyGSPy8vv3LfIZt52nl7wxMVxXtjmTVP2w4ttp3 qnAquUfaRJPUopXH99jqXh0osbiGEcAxAJ0a7crjFrPyzwjhImTx+yIsHp+WYy+RgYvpm7 BXgJpO1IW73dkO2ng4eKtSabo6vdprQgB7OOODLEqbG/bIETfZ8kb+txoE6MXI0zyLUsJg 6Eta65WoZn2N1gJKkb2ZEs9BAsmxp2Xz/afYsVC/s/8FaoH+IwMw+At8sz+6tg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642346434; a=rsa-sha256; cv=none; b=Tkqn3hRKQnoMu3xh+sWpIQiUVvQxwL+Yfd4bIpB5YBGTijCHtTbkvdk1YGkyyVd/og3HrE 4CVU91t0paJLw2bakbEwjo9NKi4aVd8dzqaLPvgQQeZi7NzfzJ5LJmQG8b96gSzMAbmx6/ q45twYo/ey0Goex+YCyf3z0V1rjS2mf2HTgKr9PbQzGH5/Yo9ANBORYPOq8MfEGqJdQZmK fRZAZk7fS0PIur7iXkKFsScKCfJaAZXcAQ5bVzCeUfVG7wOIxWLgxP6mNNrn9qwyWMhxnG hFDtTv195G9nNM+nocmzaXW//kfc5sqczeKxfnaACPXPEGd/mulO5d6Aek8qtg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mg.wilsonb.com header.s=krs header.b=wNxhyTYg; dkim=fail ("headers rsa verify failed") header.d=wilsonb.com header.s=201703 header.b="XWQgKH/1"; 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=wNxhyTYg; dkim=fail ("headers rsa verify failed") header.d=wilsonb.com header.s=201703 header.b="XWQgKH/1"; 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: DCB6F1092B X-Spam-Score: -3.62 X-Migadu-Scanner: scn1.migadu.com X-TUID: jNVssg43U9MH This is a multipart message in MIME format. ------_=_33aee0f95b15bd0b163d3f05_=_ Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > > Interesting idea. How about just always forcing a MINOR part, setting > > to "0" if upstream doesn't have one? > That'd declare regular releases as MAJOR.0 in the version field, which > I'm not sure if we want that. In the case of random commits I'm less > reserved, as they don't correspond to releases anyway. I see your point. In fact, upstream releases start with MINOR part "a" and "count up" through the letters over the course of a year. It's a pretty sim= ple scheme. For example, J 901 started at "j901-release-a" and ended at "j901-release-f". When I originally wrote this package, I noticed that the release tag for th= e first J 902 was "j902-release", and so treaded MINOR as potentially optiona= l. However, after checking upstream's forums, this looks to just be a git tag mishap. How about we just go ahead and treat MINOR as mandatory as well? > > If you have a better idea, I am all ears. > You could define that file-union right after ijconsole. If you want to > golf even more, you could define ijconsole inside that file-union, i.e. > (define jsoftware-aux-files > (file-union "jsoftware-aux-files" > `(("profile.ijs" ,(search-aux-file ...) > ("ijconsole" ,(program-file ...)))) >=20 > I'm not quite sure if you want to use jsoftware-aux-files directly as > input or whether it's wiser to stuff it into another union like=20 > (file-union "jsoftware-aux-input" `(("aux" ,jsoftware-aux-files))). > search-input-file will probably do the right thing regardless. > The new style should also still work with assoc-ref, it'd just be > weirder to look at. Lastly, you could code up a (search-file-input) > just in case; I'm not sure if we have one already. The file-union seems like a cludgy workaround to me. What we really want is= an easy, direct way to get handles on the input files. Heck, program-file obje= cts already have a name property; why can't we use that? Attached patches are a= proof-of-concept. That said, if this is going to turn into a big rabbit hole, can we just mun= ge the J package inputs into whatever you think is best? ------_=_33aee0f95b15bd0b163d3f05_=_ Content-Disposition: attachment; filename*0*=UTF-8''0001-packages-Expand-range-of-objects-add-input-label; filename*1*=-can.patch Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable =46rom 3b8e7fa8fbd58e7e164e3730c708419f612b8549 Mon Sep 17 00:00:00 2001 =46rom: "B. Wilson" =44ate: Sun, 16 Jan 2022 23:54:51 +0900 =53ubject: [PATCH 1/2] packages: Expand range of objects 'add-input-label' = =63an =20label =54o: guix-patches@gnu.org =0A* guix/packages.scm (%auxiliary-files-subpath-dir): New variable. =28add-input-label): Support labels from the name property of =6Fbjects that have one. Also, name auxiliary files from their =73ubpath. =2D-- =20guix/packages.scm | 24 +++++++++++++++++++++++- =201 file changed, 23 insertions(+), 1 deletion(-) =0Adiff --git a/guix/packages.scm b/guix/packages.scm =69ndex 9d5b23eb8a..4feea8ad5f 100644 =2D-- a/guix/packages.scm =2B++ b/guix/packages.scm =40@ -7,6 +7,7 @@ =20;;; Copyright =C2=A9 2019 Marius Bakke =20;;; Copyright =C2=A9 2020, 2021 Maxim Cournoyer =20;;; Copyright =C2=A9 2021 Chris Marusich =2B;;; Copyright =C2=A9 2022 B. Wilson =20;;; =20;;; This file is part of GNU Guix. =20;;; =40@ -569,6 +570,10 @@ (define-record-type* =20 (default (current-definition-location)) =20 (innate))) =20= =2B;; Note: This morally imports from gnu/packages.scm, but since they impo= =72t us, =2B;; we define here instead. =2B(define %auxiliary-files-subdir-path "/gnu/packages/aux-files") =2B =20(define (add-input-label input) =20 "Add an input label to INPUT." =20 (match input =40@ -576,7 +581,24 @@ (define (add-input-label input) =20 (list (package-name package) package)) =20 (((? package? package) output) ;XXX: ugly? =20 (list (package-name package) package output)) =2D ((? gexp-input?) ;XXX: misplaced because 'native?' field is ig= =6Eored? =2B ((? local-file? local-file) =2B (list (local-file-name local-file) local-file)) =2B ((? plain-file? plain-file) =2B (list (plain-file-name plain-file) plain-file)) =2B ((? computed-file? computed-file) =2B (list (computed-file-name computed-file) computed-file)) =2B ((? program-file? program-file) =2B (list (program-file-name program-file) program-file)) =2B ((? scheme-file? scheme-file) =2B (list (scheme-file-name scheme-file) scheme-file)) =2B ((? string? path) =2B (let* ((regex (string-append %auxiliary-files-subdir-path "/(.*)"))= =0A+ (match (string-match regex input))) =2B `(,(if match =2B (match:substring match 1) =2B "_") =2B ,input))) =2B ((? gexp-input?) ;XXX: misplaced because 'native?' field is ign= =6Fred? =20 (let ((obj (gexp-input-thing input)) =20 (output (gexp-input-output input))) =20 `(,(if (package? obj) =2D-=20 =32.34.0 =0A= ------_=_33aee0f95b15bd0b163d3f05_=_ Content-Disposition: attachment; filename=0002-gnu-Add-j.patch Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable =46rom d32fd0cb243f6b51a9b2c178279a19015b621df2 Mon Sep 17 00:00:00 2001 =46rom: "B. Wilson" =44ate: Wed, 12 Jan 2022 18:44:36 +0900 =53ubject: [PATCH 2/2] 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 | 424 ++++++++++++++++++ =20.../patches/jsoftware-j901-f-fixes.patch | 80 ++++ =204 files changed, 519 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..e907f03d24 =2D-- /dev/null =2B++ b/gnu/packages/jsoftware.scm =40@ -0,0 +1,424 @@ =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 minor #:optional 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 (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 libomp 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 (search-auxiliary-file "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 "jsoftware/profilex.ijs") =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) =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