guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

40/45: gnu: ruby-anystyle-data: Don't write to installed gem.


From: guix-commits
Subject: 40/45: gnu: ruby-anystyle-data: Don't write to installed gem.
Date: Thu, 4 Aug 2022 06:07:11 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit bc2de56572872eefdc2992b34cce69c77deb485a
Author: Philip McGrath <philip@philipmcgrath.com>
AuthorDate: Mon Jul 25 08:16:32 2022 -0400

    gnu: ruby-anystyle-data: Don't write to installed gem.
    
    * gnu/packages/patches/ruby-anystyle-data-immutable-install.patch: New
    patch.
    * gnu/local.mk (dist_patch_DATA): Add it.
    * gnu/packages/ruby.scm (ruby-anystyle-data)[patches]: Use it.
    
    Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/local.mk                                       |  1 +
 .../ruby-anystyle-data-immutable-install.patch     | 40 ++++++++++++++++++++++
 gnu/packages/ruby.scm                              |  2 ++
 3 files changed, 43 insertions(+)

diff --git a/gnu/local.mk b/gnu/local.mk
index ca3b83c550..32ee102943 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1782,6 +1782,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-anystyle-data-immutable-install.patch      \
   %D%/packages/patches/ruby-latex-decode-fix-test.patch                \
   %D%/packages/patches/ruby-mustache-1.1.1-fix-race-condition-tests.patch \
   %D%/packages/patches/ruby-sanitize-system-libxml.patch       \
diff --git a/gnu/packages/patches/ruby-anystyle-data-immutable-install.patch 
b/gnu/packages/patches/ruby-anystyle-data-immutable-install.patch
new file mode 100644
index 0000000000..d5d7149a67
--- /dev/null
+++ b/gnu/packages/patches/ruby-anystyle-data-immutable-install.patch
@@ -0,0 +1,40 @@
+From a6f5b37cd22daa6069d8fbef8cba9dc60a6731f6 Mon Sep 17 00:00:00 2001
+From: Philip McGrath <philip@philipmcgrath.com>
+Date: Sun, 24 Jul 2022 23:54:19 -0400
+Subject: [PATCH] `AnyStyle::Data.setup()`: adjust for immutable install
+
+Don't override the default paths for `Dictionary::Marshal`,
+`Dictionary::GDBM`, and `Dictionary:LDBM` to point to this gem: we can't
+populate such files without the 'anystyle' gem (which depends on this
+one), and we won't be able to write to the directory where this gem is
+installed later, so the files will never exist at those locations.
+---
+ lib/anystyle/data/setup.rb | 12 ------------
+ 1 file changed, 12 deletions(-)
+
+diff --git a/lib/anystyle/data/setup.rb b/lib/anystyle/data/setup.rb
+index 17efdf8..08246fa 100644
+--- a/lib/anystyle/data/setup.rb
++++ b/lib/anystyle/data/setup.rb
+@@ -4,18 +4,6 @@ module AnyStyle
+ 
+     def self.setup
+       Dictionary.defaults[:source] = File.join(ROOT, 'dict.txt.gz')
+-
+-      if defined? Dictionary::Marshal
+-        Dictionary::Marshal.defaults[:path] = File.join(ROOT, 'dict.marshal')
+-      end
+-
+-      if defined? Dictionary::GDBM
+-        Dictionary::GDBM.defaults[:path] = File.join(ROOT, 'dict.db')
+-      end
+-
+-      if defined? Dictionary::LDBM
+-        Dictionary::LDBM.defaults[:path] = ROOT
+-      end
+     end
+   end
+ end
+-- 
+2.32.0
+
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index cdb9f53830..6e0b2dd14c 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -13446,6 +13446,8 @@ the power of the built-in @code{OptionParser}.")
               (snippet
                ;; remove pre-built file
                #~(delete-file "lib/anystyle/data/dict.txt.gz"))
+              (patches
+               (search-patches "ruby-anystyle-data-immutable-install.patch"))
               (file-name (git-file-name name version))))
     (build-system ruby-build-system)
     (arguments



reply via email to

[Prev in Thread] Current Thread [Next in Thread]