From patchwork Fri Aug 5 02:20:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christopher Rodriguez X-Patchwork-Id: 4348 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 D789A27BBEA; Fri, 5 Aug 2022 03:21:24 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0DF3A27BBE9 for ; Fri, 5 Aug 2022 03:21:24 +0100 (BST) Received: from localhost ([::1]:41638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJmxn-00015h-6m for patchwork@mira.cbaines.net; Thu, 04 Aug 2022 22:21:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJmxT-00015I-6N for guix-patches@gnu.org; Thu, 04 Aug 2022 22:21:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37538) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJmxS-0007lE-W4 for guix-patches@gnu.org; Thu, 04 Aug 2022 22:21:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oJmxS-0006MI-Ku for guix-patches@gnu.org; Thu, 04 Aug 2022 22:21:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56989] [PATCH v1 1/5] gnu: bqn: Add bqn.scm and dbqn package. Resent-From: Christopher Rodriguez Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 05 Aug 2022 02:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56989 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56989@debbugs.gnu.org Cc: Christopher Rodriguez X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165966603624332 (code B ref -1); Fri, 05 Aug 2022 02:21:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 Aug 2022 02:20:36 +0000 Received: from localhost ([127.0.0.1]:55508 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJmx2-0006KO-9R for submit@debbugs.gnu.org; Thu, 04 Aug 2022 22:20:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:57140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJmwz-0006KE-C2 for submit@debbugs.gnu.org; Thu, 04 Aug 2022 22:20:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJmwz-00011Q-4C for guix-patches@gnu.org; Thu, 04 Aug 2022 22:20:33 -0400 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]:39858) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJmwx-0007hQ-9Q for guix-patches@gnu.org; Thu, 04 Aug 2022 22:20:32 -0400 Received: by mail-qk1-x72c.google.com with SMTP id m7so996995qkk.6 for ; Thu, 04 Aug 2022 19:20:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=AkfLc2XC8kVdmdxF8aD/1LQbVfONG3JeJFV9zeTzfXU=; b=dFwynUIv6xlhDixqioBw3Wn1mWPqtqvXvbJ8/4hFwOWNMcEy/PAQNygbQeZEaTArkM 2r94mkMOcup/PEXnnJbVANt62+RRcwtYV0KZonHXsC68aigzmiHyOxK+X0UKE1nip1Jl 71Eli31NE5X+iidgmrp2n/LDrepIAYUNtbFYnfjt6GO/xYVXwOJePklyJ6vqi+Vml2p+ y3JVJHDH/di+L5gY+YY5PzME+5wI61Ri58QXyP+VSV/6LZekPOQhtZmBNKzEqFBIiWh9 JVeZoL2fRSVbQC2FW+bYxZzA0CoH++xIPPqx/s+Rq7WXFFUVi3uYCGDUb6eQuClBKEIl Xs9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=AkfLc2XC8kVdmdxF8aD/1LQbVfONG3JeJFV9zeTzfXU=; b=JNR77PBql/rASD8QGoCecDMeUEs6CcxaWBghdlRUem6xgMWWr4IYJoeX1YEvKjO9BV VBg95XRzRhZIit5mt/CGHJrz9BqG4l1uo3iomWRNsz8i3cXOwHiO59nJbKYlRXnr1Ai1 RnQvHhah6cMjbkDVew4VG1OyIKdOXz4O5uHwOWUEPycGNj+vU0KV0UOQSSJ0vq+VCegg Tg3WjwFi17d+W4HYw4TdFB+SGoNY3wHQ2GLWew8R5ANn0izKDVAMqIlPbKxHKOvez4DP PcygUEjkzZONEECWCHP07rheQ3JUrpcf2BrGUwhMiV8fgCCr5cBSyJ0vAeRHPPmdh5G/ Wg7g== X-Gm-Message-State: ACgBeo0du/diw3gvf5EhzU+HPP36/03ZJXuvTuACOp4nTVe+IMD3wLjt ehsKQay6e7PSSfJEcqB3G3i3LtP7zNCp4g== X-Google-Smtp-Source: AA6agR4yUSnPf8aSJnCmuRXg2xpavVerV6Rthp7WmKlvj60E/RasxkA+nso9Iz+GKKPSrP9jtX2eHA== X-Received: by 2002:a05:620a:24d4:b0:6b6:2fb2:428d with SMTP id m20-20020a05620a24d400b006b62fb2428dmr3596275qkn.206.1659666029385; Thu, 04 Aug 2022 19:20:29 -0700 (PDT) Received: from gmail.com ([2601:547:a00:7720::7bb0]) by smtp.gmail.com with ESMTPSA id bk4-20020a05620a1a0400b006b89a19a32dsm1897877qkb.69.2022.08.04.19.20.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 19:20:29 -0700 (PDT) From: Christopher Rodriguez Date: Thu, 4 Aug 2022 22:20:19 -0400 Message-Id: <20220805022023.5044-1-yewscion@gmail.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::72c; envelope-from=yewscion@gmail.com; helo=mail-qk1-x72c.google.com 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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 Hello all, This is a set of patches to add CBQN (and the packages required to build it from source) to the official Guix repository. CBQN is the recommended implementation of the BQN language, which is a new array programming language in the same vein as APL, K, Q, J, Dyalog APL, etc. Even better than most of those, it carries a FSDG compatible license (the implementation is even under single-license GPL!) and so I feel as though it should definitely be a part of GNU Guix. While there are still a few outstanding issues I hope to address with those upstream eventually (all documented in the comments), I believe I have followed the guidelines in the manual. Please let me know what I can improve, and how I might expedite this awesome language's inclusion in GNU Guix. --- gnu/packages/bqn.scm | 92 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 gnu/packages/bqn.scm base-commit: 116c0268ffd387c88b6b47135203fb330eb422f0 diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm new file mode 100644 index 0000000000..53e2f0a057 --- /dev/null +++ b/gnu/packages/bqn.scm @@ -0,0 +1,92 @@ +(define-module (gnu packages bqn) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix build-system copy) + #:use-module (guix build-system gnu) + #:use-module (guix utils) + #:use-module (guix deprecation) + #:use-module (gnu packages) + #:use-module (gnu packages libffi) + #:use-module (gnu packages base) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages llvm) + #:use-module (gnu packages java)) + +;; Currently this package is non-deterministic due to random generation in +;; some of the primitives. This is marked as a TODO in the source code, but +;; per the maintainer this package almost solely exists for the purpose of +;; building CBQN at this point, and therefore is not a high priority. Git +;; reports this here: +;; +;; src/BQN/types/callable/builtins/fns/EpsBuiltin.java:45:71: +;; … // TODO these (and in ⊐) shouldn't be random numbers +;; +;; Reported Upstream Here: https://github.com/dzaima/BQN/issues/14 +;; +;; This issue therefore means that none of the packages for bqn can be checked +;; for non-determinism at this time, as dbqn is a prerequisite for all of +;; them. +(define-public dbqn + (let* ((tag "0.2.1") + (revision "1") + (commit "0bbe096fc07d278b679a8479318f1722d096a03e") + (hash "1kxzxz2hrd1871281s4rsi569qk314aqfmng9pkqn8gv9nqhmph0") + (version (git-version tag revision commit))) + (package + (name "dbqn") + (version version) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dzaima/BQN") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + hash)))) + (outputs '("out")) + (build-system gnu-build-system) + (arguments + (list #:tests? #f ;While there is a "test" directory, there is no + ;; mechanism to run the tests other than to feed the files into the + ;; binary and check for an error. This is outside the scope of a + ;; packaging workflow, and would need to be fixed upstream + ;; instead. Issue Reported: https://github.com/dzaima/BQN/issues/12 + ;; Maintainer says many of the tests fail, and so they will remain off + ;; until this is sorted out. + #:phases #~(modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda* _ + (invoke "./build"))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (dest-bin (string-append out "/bin")) + (dest-jar (string-append out + "/share/java"))) + (mkdir-p dest-bin) + (mkdir-p dest-jar) + (copy-recursively "BQN" + (string-append dest-bin + "/dbqn")) + (chmod (string-append dest-bin "/dbqn") 493) + (install-file "BQN.jar" dest-jar)))) + (add-after 'install 'subjars + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (dest-bin (string-append out "/bin")) + (dest-jar (string-append out + "/share/java"))) + (substitute* (string-append dest-bin "/dbqn") + (("BQN.jar") + (string-append dest-jar "/BQN.jar"))))))))) + (native-inputs (list `(,openjdk17 "jdk") + coreutils)) + (synopsis "BQN implementation based on dzaima/APL") + (description "BQN implementation based on dzaima/APL.") + (home-page "https://github.com/dzaima/BQN") + (license license:expat))))