From: Nicolas Graves via Guix-patches via <guix-patches@gnu.org>
To: 66180@debbugs.gnu.org
Cc: ngraves@ngraves.fr
Subject: [bug#66180] [PATCH 12/19] gnu: node-sqlite3: Move package in alphabetical order.
Date: Sun, 24 Sep 2023 14:50:38 +0200 [thread overview]
Message-ID: <b360aa150043ff8490f2bb43ff44a43a37caef60.1695559845.git.ngraves@ngraves.fr> (raw)
In-Reply-To: <28369246c2163cab7579f033071c85fbc6d0768b.1695559845.git.ngraves@ngraves.fr>
* gnu/packages/node-xyz.scm (node-sqlite3): Move package in alphabetical order.
---
gnu/packages/node-xyz.scm | 258 +++++++++++++++++++-------------------
1 file changed, 129 insertions(+), 129 deletions(-)
diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm
index 0ef691e0e6..cefc826c8d 100644
--- a/gnu/packages/node-xyz.scm
+++ b/gnu/packages/node-xyz.scm
@@ -838,6 +838,135 @@ (define-public node-safe-buffer
@code{Buffer.alloc(SIZE)}) in older versions.")
(license license:expat)))
+(define-public node-sqlite3
+ (package
+ (name "node-sqlite3")
+ (version "5.0.2")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mapbox/node-sqlite3")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0sbbzzli282nxyfha10zx0k5m8hdp0sf3ipl59khjb7wm449j86h"))
+ (snippet
+ (with-imported-modules '((guix build utils))
+ #~(begin
+ (use-modules (guix build utils))
+ ;; unbundle sqlite
+ (for-each delete-file-recursively
+ (find-files "deps"
+ (lambda (pth stat)
+ (gzip-file? pth)))))))))
+ (inputs
+ (list node-addon-api python sqlite))
+ (build-system node-build-system)
+ (arguments
+ `(#:modules
+ ((guix build node-build-system)
+ (srfi srfi-1)
+ (ice-9 match)
+ (guix build utils))
+ #:tests? #f ; FIXME: tests depend on node-mocha
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'patch-dependencies 'delete-dependencies
+ (lambda args
+ (delete-dependencies
+ `(;; Normally, this is "built" using @mapbox/node-pre-gyp,
+ ;; which publishes or downloads pre-built binaries or
+ ;; falls back to building from source. Here, we patch out
+ ;; all of that and just build directly. It might be
+ ;; better to patch a version of @mapbox/node-pre-gyp that
+ ;; always builds from source, as Debian does, but there
+ ;; are a number of dependencies that need to be packaged
+ ;; or removed.
+ "@mapbox/node-pre-gyp"
+ "node-pre-gyp" ;; deprecated name still used in some places
+ "aws-sdk"
+ "@mapbox/cloudfriend"
+ ;; Confusingly, this is only a dependency because of
+ ;; @mapbox/node-pre-gyp: with that removed,
+ ;; npm will use its own copy:
+ "node-gyp"
+ ;; These we'd like, we just don't have them yet:
+ "eslint"
+ "mocha"))))
+ (add-before 'configure 'npm-config-sqlite
+ ;; We need this step even if we do replace @mapbox/node-pre-gyp
+ ;; because the package expects to build its bundled sqlite
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "npm_config_sqlite" (assoc-ref inputs "sqlite"))))
+ (add-after 'install 'patch-binding-path
+ ;; We replace a file that dynamic searches for the addon using
+ ;; node-pre-gyp (which we don't have) with a version that
+ ;; simply uses the path to the addon we built directly.
+ ;; The exact path is supposed to depend on things like the
+ ;; architecture and napi_build_version, so, to avoid having
+ ;; hard-code the details accurately, we do this after the addon
+ ;; has been built so we can just find where it ended up.
+ (lambda* (#:key outputs #:allow-other-keys)
+ (with-directory-excursion
+ (search-input-directory outputs
+ "lib/node_modules/sqlite3/lib")
+ (match (find-files "binding" "\\.node$")
+ ((rel-path)
+ (with-atomic-file-replacement "sqlite3-binding.js"
+ (lambda (in out)
+ (format out "var binding = require('./~a');\n" rel-path)
+ (display "module.exports = exports = binding;\n"
+ out))))))))
+ (add-after 'patch-dependencies 'avoid-node-pre-gyp
+ (lambda args
+ ;; We need to patch .npmignore before the 'repack phase
+ ;; so that the built addon is installed with in the package.
+ ;; (Upstream assumes node-pre-gyp will download a pre-built
+ ;; version when this package is installed.)
+ (substitute* ".npmignore"
+ (("lib/binding")
+ "#lib/binding # <- patched for Guix"))
+ (with-atomic-json-file-replacement "package.json"
+ (match-lambda
+ (('@ . pkg-meta-alist)
+ (match (assoc-ref pkg-meta-alist "binary")
+ (('@ . binary-alist)
+ ;; When it builds from source, node-pre-gyp supplies
+ ;; module_name and module_path based on the entries under
+ ;; "binary" from "package.json", so this package's
+ ;; "binding.gyp" doesn't define them. Thus, we also need
+ ;; to supply them. The GYP_DEFINES environment variable
+ ;; turns out to be the easiest way to make sure they are
+ ;; propagated from npm to node-gyp to gyp.
+ (setenv "GYP_DEFINES"
+ (string-append
+ "module_name="
+ (assoc-ref binary-alist "module_name")
+ " "
+ "module_path="
+ (assoc-ref binary-alist "module_path")))))
+ ;; We need to remove the install script from "package.json",
+ ;; as it would try to use node-pre-gyp and would block the
+ ;; automatic building performed by `npm install`.
+ (cons '@ (map (match-lambda
+ (("scripts" @ . scripts-alist)
+ `("scripts" @ ,@(filter (match-lambda
+ (("install" . _)
+ #f)
+ (_
+ #t))
+ scripts-alist)))
+ (other
+ other))
+ pkg-meta-alist))))))))))
+ (home-page "https://github.com/mapbox/node-sqlite3")
+ (synopsis "Node.js bindings for SQLite3")
+ (description
+ "@code{node-sqlite3} provides a set of a Node.js bindings for interacting
+with SQLite3 databases.")
+ (license license:bsd-3)))
+
(define-public node-stack-trace
;; There have been improvements since the last release.
(let ((commit "4fd379ee78965ce7ce8820b436f1b1b590d5dbcf")
@@ -1003,135 +1132,6 @@ (define-public node-wrappy
(description "@code{wrappy} is a utility for Node.js to wrap callbacks.")
(license license:isc)))
-(define-public node-sqlite3
- (package
- (name "node-sqlite3")
- (version "5.0.2")
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/mapbox/node-sqlite3")
- (commit (string-append "v" version))))
- (file-name (git-file-name name version))
- (sha256
- (base32 "0sbbzzli282nxyfha10zx0k5m8hdp0sf3ipl59khjb7wm449j86h"))
- (snippet
- (with-imported-modules '((guix build utils))
- #~(begin
- (use-modules (guix build utils))
- ;; unbundle sqlite
- (for-each delete-file-recursively
- (find-files "deps"
- (lambda (pth stat)
- (gzip-file? pth)))))))))
- (inputs
- (list node-addon-api python sqlite))
- (build-system node-build-system)
- (arguments
- `(#:modules
- ((guix build node-build-system)
- (srfi srfi-1)
- (ice-9 match)
- (guix build utils))
- #:tests? #f ; FIXME: tests depend on node-mocha
- #:phases
- (modify-phases %standard-phases
- (add-after 'patch-dependencies 'delete-dependencies
- (lambda args
- (delete-dependencies
- `(;; Normally, this is "built" using @mapbox/node-pre-gyp,
- ;; which publishes or downloads pre-built binaries or
- ;; falls back to building from source. Here, we patch out
- ;; all of that and just build directly. It might be
- ;; better to patch a version of @mapbox/node-pre-gyp that
- ;; always builds from source, as Debian does, but there
- ;; are a number of dependencies that need to be packaged
- ;; or removed.
- "@mapbox/node-pre-gyp"
- "node-pre-gyp" ;; deprecated name still used in some places
- "aws-sdk"
- "@mapbox/cloudfriend"
- ;; Confusingly, this is only a dependency because of
- ;; @mapbox/node-pre-gyp: with that removed,
- ;; npm will use its own copy:
- "node-gyp"
- ;; These we'd like, we just don't have them yet:
- "eslint"
- "mocha"))))
- (add-before 'configure 'npm-config-sqlite
- ;; We need this step even if we do replace @mapbox/node-pre-gyp
- ;; because the package expects to build its bundled sqlite
- (lambda* (#:key inputs #:allow-other-keys)
- (setenv "npm_config_sqlite" (assoc-ref inputs "sqlite"))))
- (add-after 'install 'patch-binding-path
- ;; We replace a file that dynamic searches for the addon using
- ;; node-pre-gyp (which we don't have) with a version that
- ;; simply uses the path to the addon we built directly.
- ;; The exact path is supposed to depend on things like the
- ;; architecture and napi_build_version, so, to avoid having
- ;; hard-code the details accurately, we do this after the addon
- ;; has been built so we can just find where it ended up.
- (lambda* (#:key outputs #:allow-other-keys)
- (with-directory-excursion
- (search-input-directory outputs
- "lib/node_modules/sqlite3/lib")
- (match (find-files "binding" "\\.node$")
- ((rel-path)
- (with-atomic-file-replacement "sqlite3-binding.js"
- (lambda (in out)
- (format out "var binding = require('./~a');\n" rel-path)
- (display "module.exports = exports = binding;\n"
- out))))))))
- (add-after 'patch-dependencies 'avoid-node-pre-gyp
- (lambda args
- ;; We need to patch .npmignore before the 'repack phase
- ;; so that the built addon is installed with in the package.
- ;; (Upstream assumes node-pre-gyp will download a pre-built
- ;; version when this package is installed.)
- (substitute* ".npmignore"
- (("lib/binding")
- "#lib/binding # <- patched for Guix"))
- (with-atomic-json-file-replacement "package.json"
- (match-lambda
- (('@ . pkg-meta-alist)
- (match (assoc-ref pkg-meta-alist "binary")
- (('@ . binary-alist)
- ;; When it builds from source, node-pre-gyp supplies
- ;; module_name and module_path based on the entries under
- ;; "binary" from "package.json", so this package's
- ;; "binding.gyp" doesn't define them. Thus, we also need
- ;; to supply them. The GYP_DEFINES environment variable
- ;; turns out to be the easiest way to make sure they are
- ;; propagated from npm to node-gyp to gyp.
- (setenv "GYP_DEFINES"
- (string-append
- "module_name="
- (assoc-ref binary-alist "module_name")
- " "
- "module_path="
- (assoc-ref binary-alist "module_path")))))
- ;; We need to remove the install script from "package.json",
- ;; as it would try to use node-pre-gyp and would block the
- ;; automatic building performed by `npm install`.
- (cons '@ (map (match-lambda
- (("scripts" @ . scripts-alist)
- `("scripts" @ ,@(filter (match-lambda
- (("install" . _)
- #f)
- (_
- #t))
- scripts-alist)))
- (other
- other))
- pkg-meta-alist))))))))))
- (home-page "https://github.com/mapbox/node-sqlite3")
- (synopsis "Node.js bindings for SQLite3")
- (description
- "@code{node-sqlite3} provides a set of a Node.js bindings for interacting
-with SQLite3 databases.")
- (license license:bsd-3)))
-
(define-public node-file-uri-to-path
(package
(name "node-file-uri-to-path")
--
2.41.0
next prev parent reply other threads:[~2023-09-24 12:53 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-24 12:47 [bug#66180] [PATCH 00/19] Sort packages in node-xyz.scm Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` [bug#66180] [PATCH 01/19] gnu: node-bindings: Move package in alphabetical order Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` [bug#66180] [PATCH 02/19] gnu: node-util-deprecate: " Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` [bug#66180] [PATCH 03/19] gnu: node-once: " Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` [bug#66180] [PATCH 04/19] gnu: node-ieee754: " Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` [bug#66180] [PATCH 05/19] gnu: node-inherits: " Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` [bug#66180] [PATCH 06/19] gnu: node-safe-buffer: " Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` [bug#66180] [PATCH 07/19] gnu: node-string-decoder: " Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` [bug#66180] [PATCH 08/19] gnu: node-readable-stream: " Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` [bug#66180] [PATCH 09/19] gnu: node-irc and node-irc-colors: Move " Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` [bug#66180] [PATCH 10/19] gnu: node-nan: Move package " Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` [bug#66180] [PATCH 11/19] gnu: node-addon-api: " Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` Nicolas Graves via Guix-patches via [this message]
2023-09-24 12:50 ` [bug#66180] [PATCH 13/19] gnu: node-file-uri-to-path: " Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` [bug#66180] [PATCH 14/19] gnu: node-segfault-handler: " Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` [bug#66180] [PATCH 15/19] gnu: node-ms: " Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` [bug#66180] [PATCH 16/19] gnu: node-debug: " Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` [bug#66180] [PATCH 17/19] gnu: node-serialport packages: Move packages " Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` [bug#66180] [PATCH 18/19] gnu: node-semver: Move package " Nicolas Graves via Guix-patches via
2023-09-24 12:50 ` [bug#66180] [PATCH 19/19] gnu: packages: node-xyz: Add alphatical order header Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 01/20] gnu: node-bindings: Move package in alphabetical order Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 02/20] gnu: node-util-deprecate: " Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 03/20] gnu: node-once: " Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 04/20] gnu: node-ieee754: " Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 05/20] gnu: node-inherits: " Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 06/20] gnu: node-safe-buffer: " Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 07/20] gnu: node-string-decoder: " Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 08/20] gnu: node-readable-stream: " Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 09/20] gnu: node-irc and node-irc-colors: Move " Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 10/20] gnu: node-nan: Move package " Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 11/20] gnu: node-addon-api: " Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 12/20] gnu: node-sqlite3: " Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 13/20] gnu: node-file-uri-to-path: " Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 14/20] gnu: node-segfault-handler: " Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 15/20] gnu: node-ms: " Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 16/20] gnu: node-debug: " Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 17/20] gnu: packages: node-xyz: Add alphatical order header Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 18/20] gnu: node-semver: Move package in alphabetical order Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 19/20] gnu: node-path-key: " Nicolas Graves via Guix-patches via
2024-02-04 12:40 ` [bug#66180] [PATCH v2 20/20] gnu: node-serialport-*: Move packages " Nicolas Graves via Guix-patches via
2024-02-10 16:16 ` [bug#66180] [PATCH 00/19] Sort packages in node-xyz.scm Sharlatan Hellseher
2024-02-18 12:02 ` ngraves--- via Guix-patches via
2024-02-18 12:02 ` ngraves--- via Guix-patches via
2024-02-18 13:06 ` bug#66180: " Sharlatan Hellseher
2024-02-18 14:23 ` [bug#66180] " Nicolas Graves via Guix-patches via
2024-02-18 14:29 ` Nicolas Graves via Guix-patches via
2024-02-18 14:48 ` Sharlatan Hellseher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b360aa150043ff8490f2bb43ff44a43a37caef60.1695559845.git.ngraves@ngraves.fr \
--to=guix-patches@gnu.org \
--cc=66180@debbugs.gnu.org \
--cc=ngraves@ngraves.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).