From patchwork Fri Apr 1 09:07:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Roman Scherer X-Patchwork-Id: 38265 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 93AF427BBEA; Fri, 1 Apr 2022 10:41:51 +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_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED 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 E4F0B27BBE9 for ; Fri, 1 Apr 2022 10:41:50 +0100 (BST) Received: from localhost ([::1]:49494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1naDmw-0008QF-1b for patchwork@mira.cbaines.net; Fri, 01 Apr 2022 05:41:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naDWh-00070r-3c for guix-patches@gnu.org; Fri, 01 Apr 2022 05:25:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46994) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1naDWg-0007ky-Py for guix-patches@gnu.org; Fri, 01 Apr 2022 05:25:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1naDWg-00025g-G9 for guix-patches@gnu.org; Fri, 01 Apr 2022 05:25:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54581] Add emacs-sqlite3-api package Resent-From: Roman Scherer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 01 Apr 2022 09:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54581 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Maxime Devos Cc: 54581@debbugs.gnu.org Received: via spool by 54581-submit@debbugs.gnu.org id=B54581.16488050757993 (code B ref 54581); Fri, 01 Apr 2022 09:25:02 +0000 Received: (at 54581) by debbugs.gnu.org; 1 Apr 2022 09:24:35 +0000 Received: from localhost ([127.0.0.1]:40891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naDWB-00024n-F2 for submit@debbugs.gnu.org; Fri, 01 Apr 2022 05:24:34 -0400 Received: from mail-wr1-f41.google.com ([209.85.221.41]:41791) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naDW9-00024a-Df for 54581@debbugs.gnu.org; Fri, 01 Apr 2022 05:24:30 -0400 Received: by mail-wr1-f41.google.com with SMTP id h23so3307218wrb.8 for <54581@debbugs.gnu.org>; Fri, 01 Apr 2022 02:24:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burningswell-com.20210112.gappssmtp.com; s=20210112; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version; bh=cEWERqTYk28P5vI44U5JeIsMS/jtS4GFD+jml7tuhlI=; b=H7R8+oytfKSdLSECbcEy0+S20uh/XxqrZVmg604W3h2OGfGVSvPXdH4Q/iOh/Zgd7O cYOtRszZgZiUbptmbm4JCCUXn4IVE99h93POBkviWGorqshXaPNdE5LvJSX5ofZOEF3S OXsGoCv5v1Ha7IiTNFrex2UM32FyhwYOa/bhLBbaR7NkMKqFZnm9zz22vK0VKpImFj4G ZAXsXXtGTu3gXE/BgCY6nizhg4cnj/qrdKBYIknPZxpeuUn1cKvhh4/5vvDcTivJZpBT 3IwtIlCDvvYXcbAJqJuRfj6qT85eExwg+6P6OZKaQp8eqWtKSoHBBkAlilPFCby1zLXO vnRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version; bh=cEWERqTYk28P5vI44U5JeIsMS/jtS4GFD+jml7tuhlI=; b=WLpReYgLmPSkSidl4vL0U4GQAKf++aFoNHEAP+WxQ1HCX5ljT7Ht+Ark4Ji7LHy5Yy wh2JjCfzJQetV12HGQU3PfQ0UjKbDZaHoDLe50QUIANd0I2fAU3eMzgYeuzjFeCuyb98 zNt8necFgmGOETyE4jKzBNUe3GSFxiDGKH5JXuLVhg5x8MXPDOeyn91J0zq6WOLRcHog H/CMpcKlNolFOADfXoC4Q9DYMmKgYWQ6sBPkGeSIw2HsNtq7mNuw6ZgZf8X5ynotvCIe i1dVL/vy/bxfGzsSuPOktcWLJt2FuD8gPyhX4Hj5KW98tkUN8CJerM4BjysCUEGbX8NI RxKA== X-Gm-Message-State: AOAM5316DHULvWx55zuov4vbisXuniYBOUHHjiTYqWA5IJDbvpAWrJRy 5FaLmVFYnW9YIJ6OhzbgHLcW/GiRS4VsJiVi X-Google-Smtp-Source: ABdhPJytukX4npAAPN2FeAfQg+eEf+xlDLjO+k4P1eNDzL1ipWzMrQ4tRa3WPlRZIn9YTQ1kO/PONA== X-Received: by 2002:adf:fc0a:0:b0:203:ee19:b4a5 with SMTP id i10-20020adffc0a000000b00203ee19b4a5mr7226960wrr.245.1648805063058; Fri, 01 Apr 2022 02:24:23 -0700 (PDT) Received: from thinkpad (tmo-117-244.customers.d1-online.com. [80.187.117.244]) by smtp.gmail.com with ESMTPSA id h8-20020a05600c350800b0038cc9096507sm10237363wmq.3.2022.04.01.02.24.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Apr 2022 02:24:22 -0700 (PDT) References: <87ils0g5uz.fsf@burningswell.com> <87zglbs1hp.fsf@burningswell.com> <6cf98cd1d3915a9808c1e074cfa6807d2f570322.camel@telenet.be> User-agent: mu4e 1.6.10; emacs 28.0.50 From: Roman Scherer Date: Fri, 01 Apr 2022 11:07:57 +0200 In-reply-to: <6cf98cd1d3915a9808c1e074cfa6807d2f570322.camel@telenet.be> Message-ID: <87k0c9kvgb.fsf@burningswell.com> MIME-Version: 1.0 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 Hi Maxime, here's a new patch as per your suggestion. I'm removing the code that downloads from the internet, and the call to date for the NOW variable. I also remove the SQLITE_STATIC and SQLITE_TRANSIENT sections in the generated constants.c file, they cause a warning and would have been remove by the original script. I changed the #:tests? keyword to (%current-target-system), but I noticed the tests of the package are now not run anymore when I build the package. Is this expected? I tried to specify a target when building the package, but this gives me the following error: ./pre-inst-env guix build emacs-sqlite3-api --target=x86_64 guix build: error: /home/roman/workspace/guix/gnu/packages/emacs-xyz.scm:5738:4: emacs-sqlite3-api@0.15-0.7cb4b66: build system `emacs' does not support cross builds Do you know how I can trigger the tests when building this package from the command line, or even better from within Emacs? Maxime Devos writes: > [[PGP Signed Part:Undecided]] > Roman Scherer schreef op zo 27-03-2022 om 19:55 [+0200]: >> I think my preference would be to go without generating the consts.c >> file, the patch works, it uses the same file the maintainer of the >> packages is using, and I believe it is less brittle. :) > > I don't expect any practical problems but technically it isn't source > code, and rather a binary (or, as GPL words it, ‘object code’), at > least according to the GPL's definition: > > The "source code" for a work means the preferred form of the work > for making modifications to it. "Object code" means any non-source > form of a work. > > , and Guix builds things from source. I don't think constants.c is in > preferred form, rather it seems to be sqlite.h > > Maybe it's not much of a problem here though, I donk't know. > > I don't see the relevancy of what files the maintainer is using. What > does maintainerhood have to do with anything? Well, I was looking at the last time the consts.c has been modified by the maintainer and it was 2 years ago. I was thinking it would be more stable to use the code that ships with the repository, rather than building something from the internet which hasn't been updated for 2 years. But if this file is considered object code, ok. > Greetings, > Maxime. > > [[End of PGP Signed Part]] From 16a89de32c9ef7458e852169e62eb08f008a6a2b Mon Sep 17 00:00:00 2001 From: r0man Date: Sat, 26 Mar 2022 14:59:01 +0100 Subject: [PATCH] Add emacs-sqlite3-api package This patch adds the emacs-sqlite3-api package to Guix. The package provides a dynamic module for Emacs that allows direct access to the SQLite C interface. It only exposes a subset of the full SQLite C interface, but should satisfy most user's needs. The original source code uses a file called constants.c, which is checked into the repository, but can be generated by running make in the tools directory of the source. However, the procedure to generate this file downloads a list of constants from the SQLite website. We are patching the scripts to generate those constants, to not download anything from the internet to have a stable build process. --- gnu/packages/emacs-xyz.scm | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 42fc13f4c2..b4eacce952 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -5731,6 +5731,67 @@ (define-public emacs-sqlite It is not intended as a user interface.") (license license:gpl3+)))) +(define-public emacs-sqlite3-api + (let ((version "0.15") + (revision "0") + (commit "7cb4b660fe30deb8a4229f3abb18bd99ca9c971c")) + (package + (name "emacs-sqlite3-api") + (version (git-version version revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/pekingduck/emacs-sqlite3-api") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1b7if1dp6i5kqwhq25gna89xbca66i4mmgx1a5yn12kncfdgs6d7")))) + (build-system emacs-build-system) + (arguments + `(#:modules ((guix build emacs-build-system) + (guix build emacs-utils) + (guix build utils)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-module-load + (lambda* (#:key outputs #:allow-other-keys) + (chmod "sqlite3.el" #o644) + (emacs-substitute-sexps "sqlite3.el" + ("(require 'sqlite3-api nil t)" + `(module-load ,(string-append (assoc-ref outputs "out") + "/lib/sqlite3-api.so")))))) + (add-before 'check 'build-emacs-module + (lambda* (#:key outputs #:allow-other-keys) + ;; Remove code that fetches constants from the SQLite website + ;; and the call to generate a timestamp. + (invoke "sed" "--in-place" "3,4d;24,28d;31d" "tools/gen-consts.sh") + ;; Remove filter logic from the script that generates the constants. + (invoke "sed" "--in-place" "7,11d;18,22d" "tools/gen-consts.py") + ;; Generate the consts.c file. + (invoke "make" "--directory=tools") + ;; Remove the SQLITE_STATIC and SQLITE_TRANSIENT + ;; constants. They cause a compilation warning and would have + ;; been removed by the original script. + (invoke "sed" "--in-place" "/ifdef SQLITE_STATIC/,+2d" "consts.c") + (invoke "sed" "--in-place" "/ifdef SQLITE_TRANSIENT/,+2d" "consts.c") + ;; Compile the shared object file. + (invoke "make" (string-append "CC=" ,(cc-for-target))) + ;; Move the shared object file into /lib. + (install-file "sqlite3-api.so" + (string-append (assoc-ref outputs "out") + "/lib"))))) + #:tests? ,(%current-target-system) + #:test-command '("make" "test" "EMACS=emacs"))) + (inputs (list sqlite)) + (native-inputs (list python sed)) + (home-page "https://github.com/pekingduck/emacs-sqlite3-api") + (synopsis "SQLite dynamic module for Emacs Lisp") + (description "This package provides a dynamic module for Emacs that allows +direct access to the SQLite C interface. It only exposes a subset of the full +SQLite C interface, but should satisfy most user's needs.") + (license license:gpl3+)))) + (define-public emacs-sr-speedbar (let ((commit "77a83fb50f763a465c021eca7343243f465b4a47") (revision "0")) -- 2.34.0