From patchwork Fri Aug 28 00:05:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joseph Novakovich X-Patchwork-Id: 23811 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 4BC7127BBE6; Fri, 28 Aug 2020 07:16:01 +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.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_DKIM_INVALID,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 ESMTP id A179627BBE5 for ; Fri, 28 Aug 2020 07:16:00 +0100 (BST) Received: from localhost ([::1]:46658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kBXg8-00031o-5H for patchwork@mira.cbaines.net; Fri, 28 Aug 2020 02:16:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBWn0-0002g0-V6 for guix-patches@gnu.org; Fri, 28 Aug 2020 01:19:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33267) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kBWn0-0001PM-MY for guix-patches@gnu.org; Fri, 28 Aug 2020 01:19:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kBWn0-0007sJ-Ge for guix-patches@gnu.org; Fri, 28 Aug 2020 01:19:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43080] [PATCH] gnu: add j version 902. Resent-From: Joseph Novakovich Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 28 Aug 2020 05:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43080 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43080@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159859189730211 (code B ref -1); Fri, 28 Aug 2020 05:19:02 +0000 Received: (at submit) by debbugs.gnu.org; 28 Aug 2020 05:18:17 +0000 Received: from localhost ([127.0.0.1]:44813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBWmG-0007rC-GY for submit@debbugs.gnu.org; Fri, 28 Aug 2020 01:18:17 -0400 Received: from lists.gnu.org ([209.51.188.17]:56548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBRtv-0006Xe-4r for submit@debbugs.gnu.org; Thu, 27 Aug 2020 20:05:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBRtu-0001ys-Vg for guix-patches@gnu.org; Thu, 27 Aug 2020 20:05:50 -0400 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]:46014) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kBRts-0000By-Jy for guix-patches@gnu.org; Thu, 27 Aug 2020 20:05:50 -0400 Received: by mail-io1-xd2d.google.com with SMTP id u126so7724271iod.12 for ; Thu, 27 Aug 2020 17:05:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=6+9iy/MiITDfHutKl9HGFgi0WE7BQSe/n+yQF4fI8g0=; b=vQNkDrD5mVRm57vPfkfuC5eBbXfQ0Cj1JtEkN2KHDz+odyJ2pC13cSN4RqEWAVZ/Bi Wz+xsN9p7D5o7zIkucc2s02hQUDKvFJzCIYJroooWdBBSkXgvPx9l4pgIKI7D7FXfArg hO27AL3nbSsYrbDX6ieftfEJtz1CoiS80vJClJG5Z7DfW9YYRGabr6Tw5mXXMWyGwf4n Y31vKH5ynnK5rtjxa6m+ChmtI88ita6Ivmd1xdIY3BHYGvVq9ySU1HcbqDPgndKSR7Oh jkT7TQbXw9g62gy0eGZGxqmRCkSlbOO6ZFaPcPEPUF0d6ZnfAdxzBkk0S2j4Uq4cE9wE NopA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=6+9iy/MiITDfHutKl9HGFgi0WE7BQSe/n+yQF4fI8g0=; b=tYVRhbzBVKTpR8xFykG9b43zb/kWOg9U0AxiYsKW+4aob29aWamS2+QoDuWalezC/Y YTT2RjPMprU1t9cYHtS/jgPNQJ3d2DueOSVm8w9nBpB+lOLZBZ1pMqXL51UkX1i7ME/1 JXpElOddQ4D2S/cKiqkpYnMCKQ/JOKQrIYVM7O8K0/DFPchC782ku1gWxZFqeLgjWyQV CR993T40UP+kst6JL2u+8aUOfe3kUPv+SBufaWQSAna3N4i+QkHQjZ++Cxf+IPPRuvJq +F/1t0Mv7DIu3rFce1+BCpxa+mtbuBF+JX4Gx7jKUvKZ+o0RQKvZrT0C/4oGF/q6Auuu lrAg== X-Gm-Message-State: AOAM531VSRbzZYyQVSPumNXdXS4Yb9/+RPAi4o64ek+o5wuHzEKciSa4 qf/cEDff9Yeuc3foUwM0rc0F/rHG4Z+j6mqucWsJiT1I X-Google-Smtp-Source: ABdhPJwVIRpyViWKMMlSFDjU7bfyWbyTJoylYR9jOO+NiiSj7pWTkBjGmk8a3kiuGqS7YxWzf1gLDCE5OGGy9atp/hY= X-Received: by 2002:a02:7406:: with SMTP id o6mr22737555jac.10.1598573146655; Thu, 27 Aug 2020 17:05:46 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5d:939a:0:0:0:0:0 with HTTP; Thu, 27 Aug 2020 17:05:45 -0700 (PDT) From: Joseph Novakovich Date: Fri, 28 Aug 2020 00:05:45 +0000 Message-ID: Received-SPF: pass client-ip=2607:f8b0:4864:20::d2d; envelope-from=josephnovakovich@gmail.com; helo=mail-io1-xd2d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 28 Aug 2020 01:18:15 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Fri, 28 Aug 2020 02:15:55 -0400 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 Hello! I added the file gnu/packages/j.scm for a package definition for the J programming language. I have also written expressions for jqt and the majority of the J addons, but I thought it made sense to start with only the base language and repl. Hopefully nothing is too horribly off about this patch! Joseph From 798d0e3c2b635cfe3a936937fd3dd3ea1b8c5812 Mon Sep 17 00:00:00 2001 From: Joseph Novakovich Date: Thu, 27 Aug 2020 19:16:16 -0400 Subject: [PATCH] gnu: add j version 902. --- gnu/packages/j.scm | 180 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 gnu/packages/j.scm diff --git a/gnu/packages/j.scm b/gnu/packages/j.scm new file mode 100644 index 0000000000..f017c14f03 --- /dev/null +++ b/gnu/packages/j.scm @@ -0,0 +1,180 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2020 Joseph Novakovich +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages j) + #:use-module (guix packages) + #:use-module (guix git-download) + #:use-module (guix build-system gnu) + #:use-module ((guix licenses) :select (gpl3)) + #:use-module (gnu packages bash) + #:use-module (gnu packages algebra) + #:use-module (gnu packages compression) + #:use-module (gnu packages libedit) + #:use-module (gnu packages pcre) + #:use-module (gnu packages readline)) + +(define-public j + (package + (name "j") + (version "902") + (source + (origin + (method git-fetch) + (uri + (git-reference + (url "https://github.com/jsoftware/jsource") + (commit "59324abbc6c9c3709d39096f5a41e0a4ef28e9f6"))) + (sha256 + (base32 "031mncgbnn89s9k34aml7jn9pr3cfmvfm06v8785br483jmdmn20")))) + (build-system gnu-build-system) + (inputs + `(("bash" ,bash) + ("readline" ,readline) + ("bc" ,bc) + ("libedit" ,libedit) + ("pcre2" ,pcre2) + ("zlib" ,zlib))) + (outputs '("out")) + (arguments + `(#:modules + ((guix build gnu-build-system) + (guix build utils)) + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((jplatform "linux") + (out (assoc-ref %outputs "out"))) + (with-output-to-file "jsrc/jversion.h" + (lambda () + (display "#define jversion ") (write ,version) (newline) + (display "#define jplatform ") (write jplatform) (newline) + (display "#define jtype ") (write "beta") (newline) + (display "#define jlicense ") (write "GPL3") (newline) + (display "#define jbuilder ") (write "guix.gnu.org") + (newline))) + (substitute* `("jlibrary/system/main/regex.ijs") + (("pcre2dll=: f") + (string-append "pcre2dll=: '" + (assoc-ref %build-inputs "pcre2") + "/lib/libpcre2-8.so.0'"))) + (substitute* `("jlibrary/system/util/tar.ijs") + (("libz=: .+$") + (string-append "zlib=: '" + (assoc-ref %build-inputs "zlib") + "/lib/libz.so'\n"))) + #t))) + (replace 'build + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((jplatform "linux") + (j64x "j64avx2")) + (chdir "make2") + (system + (format #f + "jplatform=~a j64x=~a USE_SLEEF=1 ./build_jconsole.sh" + jplatform j64x)) + (system + (format #f + "jplatform=~a j64x=~a USE_SLEEF=1 ./build_tsdll.sh" + jplatform j64x)) + (system + (format #f + "jplatform=~a j64x=~a USE_SLEEF=1 ./build_libj.sh" + jplatform + j64x)) + (chdir "..") + #t))) + (replace 'check + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((jplatform "linux") + (j64x "j64avx2") + (tsu (string-append (getcwd) "/test/tsu.ijs")) + (jbld (string-append "bin/" jplatform "/" j64x))) + ; following instructions from make2/make.txt + (copy-recursively jbld "jlibrary/bin") + (chdir "jlibrary/bin") + (system "echo \"RUN ddall\" | ./jconsole ../../test/tsu.ijs") + (chdir "../..") + #t))) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((bin-out (string-append (assoc-ref %outputs "out") "/bin")) + (share-out (string-append (assoc-ref %outputs "out") + "/share/j")) + (jconsole "jlibrary/bin/jconsole") + (libj.so "jlibrary/bin/libj.so")) + (install-file jconsole bin-out) + (install-file libj.so bin-out) + (copy-recursively "jlibrary/addons" + (string-append share-out "/addons")) + (copy-recursively "jlibrary/system" + (string-append share-out "/system")) + ; custom profile.ijs to work with guix + (with-output-to-file (string-append bin-out "/profile.ijs") + (lambda () + (display + "NB. J profile +NB. JFE sets BINPATH_z_ and ARGV_z_ + +jpathsep_z_=: '/'&(('\\' I.@:= ])}) +home=. 2!:5'HOME' +BINPATH_z_=: home,'/.guix-profile/bin/jconsole' + +bin=. BINPATH +install=. home,'/.guix-profile/share/j' +addons=. install,'/addons' +system=. install,'/system' +tools=. install,'/tools' +isroot=. 0 +userx=. '/j902-user' +user=. home,userx +break=. user,'/break' +config=. user,'/config' +snap=. user,'/snap' +temp=. user,'/temp' +ids=. ;:'addons bin break config home install snap system tools temp user' + +SystemFolders_j_=: ids,.jpathsep@\".&.>ids + +NB. used to create mutable j user directories for temp +NB. files/configuring jqt/projects and so on +md=. 3 : 0 NB. recursive makedir +a=. jpathsep y,'/' +if. -.#1!:0 }:a do. + for_n. I. a='/' do. 1!:5 :: [