unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Tom Fitzhenry <tom@tom-fitzhenry.me.uk>
To: 55997@debbugs.gnu.org
Cc: Tom Fitzhenry <tom@tom-fitzhenry.me.uk>
Subject: [bug#55997] [PATCH staging v2 1/5] gnu: Add ruby-hydra-minimal.
Date: Fri, 24 Jun 2022 21:08:34 +1000	[thread overview]
Message-ID: <20220624110838.21580-2-tom@tom-fitzhenry.me.uk> (raw)
In-Reply-To: <20220624110838.21580-1-tom@tom-fitzhenry.me.uk>

* gnu/local.mk (dist_patch_DATA): Add ruby-hydra-minimal-no-byebug.patch.
* gnu/packages/patches/ruby-hydra-minimal-no-byebug.patch: New file.
* gnu/packages/ruby.scm (ruby-hydra): Refactor to inherit from ruby-hydra-minimal.
(ruby-hydra-minimal): New variable.
---
 gnu/local.mk                                  |  1 +
 .../ruby-hydra-minimal-no-byebug.patch        | 11 ++++++
 gnu/packages/ruby.scm                         | 36 +++++++++++++------
 3 files changed, 37 insertions(+), 11 deletions(-)
 create mode 100644 gnu/packages/patches/ruby-hydra-minimal-no-byebug.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index f8ccbd34ec..6653ff0240 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1767,6 +1767,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/rocm-comgr-3.1.0-dependencies.patch \
   %D%/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch \
   %D%/packages/patches/rocm-opencl-runtime-4.3-noopencl.patch \
+  %D%/packages/patches/ruby-hydra-minimal-no-byebug.patch		\
   %D%/packages/patches/ruby-mustache-1.1.1-fix-race-condition-tests.patch \
   %D%/packages/patches/ruby-sanitize-system-libxml.patch	\
   %D%/packages/patches/rustc-1.39.0-src.patch			\
diff --git a/gnu/packages/patches/ruby-hydra-minimal-no-byebug.patch b/gnu/packages/patches/ruby-hydra-minimal-no-byebug.patch
new file mode 100644
index 0000000000..7b338ca03e
--- /dev/null
+++ b/gnu/packages/patches/ruby-hydra-minimal-no-byebug.patch
@@ -0,0 +1,11 @@
+Description: Avoid dependency on byebug to reduce package closure
+  significantly, see https://issues.guix.gnu.org/55997
+diff --git a/lib/hydra.rb b/lib/hydra.rb
+index 29fbad2..6b5058a 100644
+--- a/lib/hydra.rb
++++ b/lib/hydra.rb
+@@ -1,4 +1,3 @@
+-require 'byebug' unless ENV['RACK_ENV'] == "production"
+ require 'pp'
+ 
+ module CoreExt
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 800ab194fe..4c66e14a68 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -3124,24 +3124,40 @@ (define-public ruby-hashdiff
     (home-page "https://github.com/liufengyun/hashdiff")
     (license license:expat)))
 
-(define-public ruby-hydra
+(define-public ruby-hydra-minimal
   ;; No releases yet.
   (let ((commit "5abfa378743756ae4d9306cc134bcc482f5c9525")
         (revision "0"))
     (package
-      (name "ruby-hydra")
+      (name "ruby-hydra-minimal")
       (version (git-version "0.0" revision commit))
       (home-page "https://github.com/hyphenation/hydra")
       (source (origin
                 (method git-fetch)
                 (uri (git-reference (url home-page) (commit commit)))
                 (file-name (git-file-name name version))
+                ;; byebug is a non-essential debugging utility that brings in
+                ;; many dependencies.
+                (patches (search-patches "ruby-hydra-minimal-no-byebug.patch"))
                 (sha256
                  (base32
                   "1cik398l2765y3d9sdhjzki3303hkry58ac6jlkiy7iy62nm529f"))))
       (build-system ruby-build-system)
       (arguments
-       '(#:phases (modify-phases %standard-phases
+       ;; Avoid rspec dependency.
+       '(#:tests? #f))
+      (synopsis "Ruby hyphenation patterns")
+      (description
+       "ruby-hydra-minimal is a Ruby library for working with hyphenation patterns.
+It is a low-dependency variant of ruby-hydra.")
+      (license license:expat))))
+
+(define-public ruby-hydra
+  (package
+    (inherit ruby-hydra-minimal)
+    (name "ruby-hydra")
+    (arguments
+        '(#:phases (modify-phases %standard-phases
                     (add-after 'unpack 'make-files-writable
                       (lambda _
                         (for-each make-file-writable (find-files "."))
@@ -3149,14 +3165,12 @@ (define-public ruby-hydra
                     (replace 'check
                       (lambda _
                         (invoke "rspec"))))))
-      (native-inputs
-       (list ruby-rspec))
-      (propagated-inputs
-       (list ruby-byebug))
-      (synopsis "Ruby hyphenation patterns")
-      (description
-       "ruby-hydra is a Ruby library for working with hyphenation patterns.")
-      (license license:expat))))
+    (native-inputs
+     (list ruby-rspec))
+    (propagated-inputs
+     (list ruby-byebug))
+    (description
+     "ruby-hydra is a Ruby library for working with hyphenation patterns.")))
 
 (define-public ruby-shindo
   (package
-- 
2.36.1





  reply	other threads:[~2022-06-24 11:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 14:58 [bug#55997] [PATCH staging 0/4] Remove texlive's dependence on mariadb Tom Fitzhenry
2022-06-15 15:04 ` [bug#55997] [PATCH staging 1/4] gnu: Add ruby-hydra-minimal Tom Fitzhenry
2022-06-15 15:04   ` [bug#55997] [PATCH staging 2/4] gnu: Remove texlive's dependence on ruby-rspec and ruby-byebug Tom Fitzhenry
2022-06-15 21:06     ` Maxime Devos
2022-06-19 14:01       ` Tom Fitzhenry
2022-06-19 14:47         ` Maxime Devos
2022-06-15 15:04   ` [bug#55997] [PATCH staging 3/4] gnu: unpin ruby-nokogiri-diff's ruby-nokogiri Tom Fitzhenry
2022-06-15 15:04   ` [bug#55997] [PATCH staging 4/4] gnu: Remove unused ruby-nokogiri-1.10 Tom Fitzhenry
2022-06-19 21:36   ` [bug#55997] [PATCH staging 1/4] gnu: Add ruby-hydra-minimal Thiago Jung Bauermann via Guix-patches via
2022-06-24 11:08 ` [bug#55997] [PATCH staging v2 0/5] Remove texlive's dependence on mariadb Tom Fitzhenry
2022-06-24 11:08   ` Tom Fitzhenry [this message]
2022-06-24 11:08   ` [bug#55997] [PATCH staging v2 2/5] gnu: Remove texlive's dependence on ruby-rspec and ruby-byebug Tom Fitzhenry
2022-06-24 11:08   ` [bug#55997] [PATCH staging v2 3/5] gnu: Unpin ruby-nokogiri-diff's ruby-nokogiri Tom Fitzhenry
2022-06-24 11:08   ` [bug#55997] [PATCH staging v2 4/5] gnu: Remove unused ruby-nokogiri-1.10 Tom Fitzhenry
2022-06-24 11:08   ` [bug#55997] [PATCH staging v2 5/5] gnu: texlive-hyphen-package: Remove input labels Tom Fitzhenry
2022-06-29  9:32   ` [bug#55997] [PATCH staging v2 0/5] Remove texlive's dependence on mariadb Tom Fitzhenry
2022-07-01  2:07     ` Thiago Jung Bauermann via Guix-patches via
2022-08-08 15:25   ` bug#55997: [PATCH staging 0/4] " Ludovic Courtès

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=20220624110838.21580-2-tom@tom-fitzhenry.me.uk \
    --to=tom@tom-fitzhenry.me.uk \
    --cc=55997@debbugs.gnu.org \
    /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).