aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/rpm.scm
blob: 008ddd6fe709d3743531655af1937a203c062bc6 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages rpm)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix packages)
  #:use-module (guix build-system cmake)
  #:use-module (guix build-system meson)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages check)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages curl)
  #:use-module (gnu packages docbook)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages man)
  #:use-module (gnu packages package-management)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages popt)
  #:use-module (gnu packages python)
  #:use-module (gnu packages serialization)
  #:use-module (gnu packages sqlite)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages xml))

(define-public drpm
  (package
    (name "drpm")
    (version "0.5.0")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/rpm-software-management/drpm")
                    (commit version)))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "0m269nl8s31yjyz7kknv4jl9mx12xjpx2ly6wf66zs5613m4rj1z"))))
    (build-system cmake-build-system)
    (native-inputs
     `(("cmocka" ,cmocka)
       ("pkg-config" ,pkg-config)))
    (inputs
     `(("bzip2" ,bzip2)
       ("lzlib" ,lzlib)
       ("openssl" ,openssl)
       ("popt" ,popt)
       ("rpm" ,rpm)
       ("xz" ,xz)
       ("zlib" ,zlib)
       ("zstd" ,zstd "lib")))
    (home-page "https://github.com/rpm-software-management/drpm")
    (synopsis "Delta RPM library")
    (description "This package provides a library for making, reading and
applying deltarpms, compatible with the original deltarpm packages.")
    (license license:lgpl2.1+)))

(define-public libmodulemd
  (package
    (name "libmodulemd")
    (version "2.13.0")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://github.com/fedora-modularity/"
                                  "libmodulemd/releases/download/" version
                                  "/modulemd-" version ".tar.xz"))
              (sha256
               (base32
                "1g4wizr2wwl5x77ni5j46nfcax8fbb7nqq5nr7va9sccyigwwwnc"))))
    (build-system meson-build-system)
    (outputs '("out" "doc"))            ;2.6 MiB of HTML documentation
    (arguments
     `(#:configure-flags
       (list (string-append "-Dgobject_overrides_dir_py3="
                            (python:site-packages %build-inputs %outputs)))
       #:imported-modules (,@%meson-build-system-modules
                           (guix build python-build-system))
       #:modules ((guix build meson-build-system)
                  ((guix build python-build-system) #:prefix python:)
                  (guix build utils))
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'fix-glib-doc-prefix
           (lambda* (#:key inputs #:allow-other-keys)
             (let ((glib:doc (assoc-ref inputs "glib:doc")))
               (substitute* "meson.build"
                 (("glib_docpath = .*")
                  (format #f "glib_docpath = '~a'~%"
                          (string-append glib:doc
                                         "/share/gtk-doc/html")))))))
         (add-after 'unpack 'fix-docbook-references
           ;; gtk-doc doesn't seem to honor DocBook 4.1.2's docbook.cat's
           ;; catalog file, even when adding it to XML_CATALOG_FILES.  Work
           ;; around it by adjusting the DocBook references directly.
           (lambda* (#:key inputs #:allow-other-keys)
             (substitute* "modulemd/modulemd-docs.xml"
               (("http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd")
                (string-append (assoc-ref inputs "docbook-xml")
                               "/xml/dtd/docbook/docbookx.dtd")))))
         (add-after 'install 'move-documentation
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (doc (assoc-ref outputs "doc"))
                    (src (string-append out "/share/gtk-doc"))
                    (dst (string-append doc "/share/gtk-doc")))
               (mkdir-p (dirname dst))
               (rename-file src dst)))))))
    (native-inputs
     `(("docbook-xml" ,docbook-xml-4.1.2)
       ("glib:bin" ,glib "bin")
       ("glib:doc" ,glib-with-documentation "doc")
       ("gobject-introspection" ,gobject-introspection) ;for g-ir-scanner
       ("gtk-doc" ,gtk-doc)
       ("help2man" ,help2man)
       ("pkg-config" ,pkg-config)))
    (inputs
     `(("gtk" ,gtk+)
       ("python-pygobject" ,python-pygobject)))
    (propagated-inputs
     ;; glib and gobject are listed as 'Requires' in modulemd-2.0.pc.
     `(("glib" ,glib)
       ;; yaml and rpm are listed as 'Requires.private' in modulemd-2.0.pc.
       ("libyaml" ,libyaml)
       ("rpm" ,rpm)))
    (home-page "https://github.com/fedora-modularity/libmodulemd")
    (synopsis "C library for manipulating module metadata files")
    (description "The libmodulemd API provides a number of convenience tools
for interacting with repodata (that is, streams of YAML that contains
information on multiple streams, default data and translations).")
    (license license:expat)))

(define-public createrepo-c
  (package
    (name "createrepo-c")
    (version "0.17.4")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/rpm-software-management/createrepo_c")
                    (commit version)))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "1fgf71mkhghgbp0pf2pazc7hyaix5igb5nl4fqsisjksfvzdfm5k"))))
    (build-system cmake-build-system)
    (arguments
     `(#:imported-modules (,@%cmake-build-system-modules
                           (guix build python-build-system))
       #:modules ((guix build cmake-build-system)
                  ((guix build python-build-system) #:prefix python:)
                  (guix build utils))
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'fix-python-site-prefix
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (substitute* "src/python/CMakeLists.txt"
               (("EXECUTE_PROCESS.*OUTPUT_VARIABLE PYTHON_INSTALL_DIR.*")
                (format #f "set (PYTHON_INSTALL_DIR ~a)~%"
                        (python:site-packages inputs outputs))))))
         (add-after 'unpack 'fix-bash-completion-prefix
           (lambda* (#:key outputs #:allow-other-keys)
             (substitute* "CMakeLists.txt"
               (("execute_process.*OUTPUT_VARIABLE BASHCOMP_DIR.*")
                (format #f "set (BASHCOMP_DIR ~a\
/share/bash-completion/completions)~%" (assoc-ref outputs "out")))))))))
    (native-inputs
     `(("bash-completion" ,bash-completion)
       ("pkg-config" ,pkg-config)
       ("python" ,python)))
    (inputs
     `(("bzip2" ,bzip2)
       ("curl" ,curl)
       ("drpm" ,drpm)
       ("libmodulemd" ,libmodulemd)
       ("libxml2" ,libxml2)
       ("openssl" ,openssl)
       ("sqlite" ,sqlite)
       ("zchunk" ,zchunk)))
    (home-page "https://rpm-software-management.github.io/createrepo_c/")
    (synopsis "C implementation of the createrepo tool")
    (description "This package provides the @command{createrepo} command,
which can be used to create RPM repositories.")
    (license license:gpl2+)))