summaryrefslogtreecommitdiff
path: root/gnu/packages/package-management.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-03-13 22:28:36 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-03-28 22:22:41 -0400
commit7e5c0dc8746c673a31266394987ec026cd99bb24 (patch)
treeb4fde2e62a7815a14f088cba8ebabab3655efba0 /gnu/packages/package-management.scm
parent5a693a3235a01e8ce6258ec57d31a36856858a45 (diff)
gnu: Add fpm.
* gnu/packages/package-management.scm (fpm): New variable. * gnu/packages/patches/fpm-newer-clamp-fix.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it.
Diffstat (limited to 'gnu/packages/package-management.scm')
-rw-r--r--gnu/packages/package-management.scm86
1 files changed, 86 insertions, 0 deletions
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index b439f9326c..537d01e164 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -59,6 +59,7 @@
#:use-module (gnu packages crypto)
#:use-module (gnu packages curl)
#:use-module (gnu packages databases)
+ #:use-module (gnu packages debian)
#:use-module (gnu packages dejagnu)
#:use-module (gnu packages dbm)
#:use-module (gnu packages docbook)
@@ -87,6 +88,7 @@
#:use-module (gnu packages nettle)
#:use-module (gnu packages networking)
#:use-module (gnu packages ninja)
+ #:use-module (gnu packages node)
#:use-module (gnu packages nss)
#:use-module (gnu packages patchutils)
#:use-module (gnu packages perl)
@@ -98,6 +100,7 @@
#:use-module (gnu packages python-check)
#:use-module (gnu packages python-web)
#:use-module (gnu packages python-xyz)
+ #:use-module (gnu packages ruby)
#:use-module (gnu packages serialization)
#:use-module (gnu packages sqlite)
#:use-module (gnu packages ssh)
@@ -117,6 +120,7 @@
#:use-module (guix build-system guile)
#:use-module (guix build-system meson)
#:use-module (guix build-system python)
+ #:use-module (guix build-system ruby)
#:use-module (guix build-system trivial)
#:use-module (guix download)
#:use-module (guix gexp)
@@ -2005,6 +2009,88 @@ applications")
sandboxed desktop applications on GNU/Linux.")
(license license:lgpl2.1+)))
+(define-public fpm
+ (package
+ (name "fpm")
+ (version "1.15.1")
+ (source (origin
+ (method git-fetch) ;for tests
+ (uri (git-reference
+ (url "https://github.com/jordansissel/fpm")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1m2zxf7wyk7psvm611yxs68hnwm0pyqilsmcq3x791hz7rvbg68w"))
+ (patches (search-patches "fpm-newer-clamp-fix.patch"))))
+ (build-system ruby-build-system)
+ (arguments
+ (list #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'extract-gemspec 'patch-paths
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* '("lib/fpm/util.rb"
+ "spec/fpm/util_spec.rb"
+ "spec/fpm/package/rpm_spec.rb")
+ (("\"/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).
+ (lambda _
+ ;; There are 4 'NoMethodError' test failures in the
+ ;; command_spec suite, for unknown reasons.
+ (delete-file "spec/fpm/command_spec.rb")
+ (substitute* "spec/fpm/package_spec.rb"
+ (("@oldtmp = ENV\\[\"TMP\"]" all)
+ "skip('fails with guix')"))
+ (substitute* "spec/fpm/package/cpan_spec.rb"
+ ;; This test is marked as expected to fail (pending) when
+ ;; TRAVIS_OS_NAME is set, but passes with Guix; skip it.
+ (("it \"should unpack tarball containing" all)
+ (string-append "x" all)))
+ (substitute* "spec/fpm/package/gem_spec.rb"
+ ;; This test fails for unknown reason; perhaps a patched
+ ;; shebang.
+ (("it 'should not change the shebang'" all)
+ (string-append "x" all)))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ ;; Set TRAVIS_OS_NAME to skip tests known to cause
+ ;; problems in minimal environments.
+ (setenv "TRAVIS_OS_NAME" "GNU Guix")
+ (invoke "rspec")))))))
+ (native-inputs
+ (list dpkg
+ libarchive
+ node
+ perl-app-cpanminus
+ python
+ ruby-rspec
+ squashfs-tools
+ zstd))
+ (inputs
+ (list bash-minimal
+ ruby-arr-pm
+ ruby-backports
+ ruby-cabin
+ ruby-clamp
+ ruby-pleaserun
+ ruby-rexml
+ ruby-stud))
+ (home-page "https://github.com/jordansissel/fpm/")
+ (synopsis "Package building and mangling tool")
+ (description "@command{fpm} is a command to convert directories, RPMs,
+Python eggs, Ruby gems, and more to RPMs, debs, Solaris packages and more.")
+ (license license:expat)))
+
(define-public akku
(package
(name "akku")