GNU bug report logs - #62196
[PATCH 000/182] Add FPM, update Rails and other Ruby additions/updates

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Wed, 15 Mar 2023 03:01:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 62196 <at> debbugs.gnu.org
Cc: Christopher Baines <mail <at> cbaines.net>
Subject: [bug#62196] [PATCH 000/182] Add FPM, update Rails and other Ruby additions/updates
Date: Thu, 23 Mar 2023 00:04:25 -0400
[Message part 1 (text/plain, inline)]
Hi,

I needed the following adjustments to get fpm to truly work:

--8<---------------cut here---------------start------------->8---
modified   gnu/local.mk
@@ -1136,6 +1136,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/fp16-implicit-double.patch		\
   %D%/packages/patches/fp16-system-libraries.patch		\
   %D%/packages/patches/fpc-reproducibility.patch		\
+  %D%/packages/patches/fpm-newer-clamp-fix.patch		\
   %D%/packages/patches/freedink-engine-fix-sdl-hints.patch	\
   %D%/packages/patches/freeimage-unbundle.patch		\
   %D%/packages/patches/fuse-glibc-2.34.patch			\
modified   gnu/packages/package-management.scm
@@ -2021,7 +2021,8 @@ (define-public fpm
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1m2zxf7wyk7psvm611yxs68hnwm0pyqilsmcq3x791hz7rvbg68w"))))
+                "1m2zxf7wyk7psvm611yxs68hnwm0pyqilsmcq3x791hz7rvbg68w"))
+              (patches (search-patches "fpm-newer-clamp-fix.patch"))))
     (build-system ruby-build-system)
     (arguments
      (list #:phases
@@ -2034,6 +2035,11 @@ (define-public fpm
                      (("\"/bin/sh\"")
                       (string-append "\"" (search-input-file inputs "bin/sh")
                                      "\"")))))
+               (add-after 'extract-gemspec 'relax-requirements
+                 (lambda _
+                   (substitute* "fpm.gemspec"
+                     (("\"clamp\", \"~> 1.0.0\"")
+                      "\"clamp\", \">= 1.0.0\""))))
                (add-after 'extract-gemspec 'disable-problematic-tests
                  ;; Disable some tests which are failing (see:
                  ;; https://github.com/jordansissel/fpm/issues/2000).
new file   gnu/packages/patches/fpm-newer-clamp-fix.patch
@@ -0,0 +1,31 @@
+From 956a218a7b35de08ea35da3b702ffdc716656b68 Mon Sep 17 00:00:00 2001
+From: Jordan Sissel <jls <at> semicomplete.com>
+Date: Mon, 15 Oct 2018 21:05:47 -0700
+Subject: [PATCH] Check if an option has a default value before we try to look
+ it up.
+
+This fixes fpm when used with clamp 1.3.0 or above.
+
+Fixes #1543
+---
+ lib/fpm/command.rb | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/lib/fpm/command.rb b/lib/fpm/command.rb
+index a204001e1..a99ddb627 100644
+--- a/lib/fpm/command.rb
++++ b/lib/fpm/command.rb
+@@ -394,7 +394,12 @@ def execute
+     set = proc do |object, attribute|
+       # if the package's attribute is currently nil *or* the flag setting for this
+       # attribute is non-default, use the value.
+-      if object.send(attribute).nil? || send(attribute) != send("default_#{attribute}")
++
++      # Not all options have a default value, so we assume `nil` if there's no default. (#1543)
++      # In clamp >= 1.3.0, options without `:default => ..` will not have any # `default_xyz` 
++      # methods generated, so we need to check for the presence of this method first.
++      default = respond_to?("default_#{attribute}") ? send("default_#{attribute}") : nil
++      if object.send(attribute).nil? || send(attribute) != default
+         logger.info("Setting from flags: #{attribute}=#{send(attribute)}")
+         object.send("#{attribute}=", send(attribute))
+       end
--8<---------------cut here---------------end--------------->8---

Attached is the modified patch.

[0001-gnu-Add-fpm.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Thanks,
Maxim

This bug report was last modified 2 years and 57 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.