gnu: python-deepmerge: Use pyproject-build-system.
[jackhill/guix/guix.git] / gnu / packages / rpm.scm
CommitLineData
4613a994 1;;; GNU Guix --- Functional package management for GNU
c162dc37 2;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
4613a994
MC
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages rpm)
20 #:use-module ((guix licenses) #:prefix license:)
21 #:use-module (guix download)
c162dc37 22 #:use-module (guix gexp)
4613a994
MC
23 #:use-module (guix git-download)
24 #:use-module (guix packages)
25 #:use-module (guix build-system cmake)
0413e90a 26 #:use-module (guix build-system meson)
daeef2e7 27 #:use-module (gnu packages bash)
4613a994
MC
28 #:use-module (gnu packages check)
29 #:use-module (gnu packages compression)
0413e90a
MC
30 #:use-module (gnu packages curl)
31 #:use-module (gnu packages docbook)
32 #:use-module (gnu packages glib)
33 #:use-module (gnu packages gtk)
34 #:use-module (gnu packages man)
4613a994
MC
35 #:use-module (gnu packages package-management)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages popt)
daeef2e7 38 #:use-module (gnu packages python)
0413e90a 39 #:use-module (gnu packages serialization)
daeef2e7
MC
40 #:use-module (gnu packages sqlite)
41 #:use-module (gnu packages tls)
42 #:use-module (gnu packages xml))
4613a994
MC
43
44(define-public drpm
45 (package
46 (name "drpm")
da96de3b 47 (version "0.5.1")
4613a994
MC
48 (source (origin
49 (method git-fetch)
50 (uri (git-reference
51 (url "https://github.com/rpm-software-management/drpm")
52 (commit version)))
53 (file-name (git-file-name name version))
54 (sha256
55 (base32
da96de3b 56 "0czg69crs2idnd8zsr7p01cd02f981gb5hq15m3qkwd25zxxd1l0"))))
4613a994
MC
57 (build-system cmake-build-system)
58 (native-inputs
8394619b 59 (list cmocka pkg-config))
4613a994 60 (inputs
8394619b
LC
61 (list bzip2
62 lzlib
63 openssl
64 popt
65 rpm
66 xz
67 zlib
68 `(,zstd "lib")))
4613a994
MC
69 (home-page "https://github.com/rpm-software-management/drpm")
70 (synopsis "Delta RPM library")
71 (description "This package provides a library for making, reading and
72applying deltarpms, compatible with the original deltarpm packages.")
73 (license license:lgpl2.1+)))
0413e90a
MC
74
75(define-public libmodulemd
76 (package
77 (name "libmodulemd")
78 (version "2.13.0")
79 (source (origin
80 (method url-fetch)
81 (uri (string-append "https://github.com/fedora-modularity/"
82 "libmodulemd/releases/download/" version
83 "/modulemd-" version ".tar.xz"))
84 (sha256
85 (base32
86 "1g4wizr2wwl5x77ni5j46nfcax8fbb7nqq5nr7va9sccyigwwwnc"))))
87 (build-system meson-build-system)
88 (outputs '("out" "doc")) ;2.6 MiB of HTML documentation
89 (arguments
5ee30cfa
MC
90 (list
91 #:configure-flags
92 #~(list (string-append "-Dgobject_overrides_dir_py3="
93 (python:site-packages %build-inputs %outputs)))
94 #:imported-modules `(,@%meson-build-system-modules
0413e90a 95 (guix build python-build-system))
5ee30cfa 96 #:modules '((guix build meson-build-system)
0413e90a
MC
97 ((guix build python-build-system) #:prefix python:)
98 (guix build utils))
5ee30cfa
MC
99 #:phases
100 #~(modify-phases %standard-phases
101 (add-after 'unpack 'fix-glib-doc-prefix
102 (lambda* (#:key native-inputs inputs #:allow-other-keys)
103 (substitute* "meson.build"
104 (("glib_docpath = .*")
105 (format #f "glib_docpath = '~a'~%"
106 (search-input-directory (or native-inputs inputs)
107 "share/gtk-doc/html"))))))
108 (add-after 'unpack 'fix-docbook-references
109 ;; gtk-doc doesn't seem to honor DocBook 4.1.2's docbook.cat's
110 ;; catalog file, even when adding it to XML_CATALOG_FILES. Work
111 ;; around it by adjusting the DocBook references directly.
112 (lambda* (#:key inputs #:allow-other-keys)
113 (substitute* "modulemd/modulemd-docs.xml"
114 (("http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd")
115 (search-input-file inputs "xml/dtd/docbook/docbookx.dtd")))))
116 (add-after 'install 'move-documentation
117 (lambda* (#:key outputs #:allow-other-keys)
118 (let ((dst (string-append #$output:doc "/share/gtk-doc")))
119 (mkdir-p (dirname dst))
120 (rename-file (search-input-directory outputs "share/gtk-doc")
121 dst)))))))
0413e90a 122 (native-inputs
5ee30cfa
MC
123 (list docbook-xml-4.1.2
124 `(,glib "bin")
125 `(,glib-with-documentation "doc")
126 gobject-introspection ;for g-ir-scanner
127 gtk-doc
128 help2man
129 pkg-config
130 python)) ;for 'site-packages' call
0413e90a 131 (inputs
5ee30cfa
MC
132 (list gtk+
133 python-pygobject))
0413e90a
MC
134 (propagated-inputs
135 ;; glib and gobject are listed as 'Requires' in modulemd-2.0.pc.
8394619b
LC
136 (list glib
137 ;; yaml and rpm are listed as 'Requires.private' in modulemd-2.0.pc.
138 libyaml rpm))
0413e90a
MC
139 (home-page "https://github.com/fedora-modularity/libmodulemd")
140 (synopsis "C library for manipulating module metadata files")
141 (description "The libmodulemd API provides a number of convenience tools
142for interacting with repodata (that is, streams of YAML that contains
143information on multiple streams, default data and translations).")
144 (license license:expat)))
daeef2e7
MC
145
146(define-public createrepo-c
147 (package
148 (name "createrepo-c")
1a5384e9 149 (version "0.20.1")
daeef2e7
MC
150 (source (origin
151 (method git-fetch)
152 (uri (git-reference
153 (url "https://github.com/rpm-software-management/createrepo_c")
154 (commit version)))
155 (file-name (git-file-name name version))
156 (sha256
157 (base32
1a5384e9 158 "07d89s6kknf79phzan3d2vy1rq64ih49qk2w51hsmfn73qins9wy"))))
daeef2e7
MC
159 (build-system cmake-build-system)
160 (arguments
c162dc37
MC
161 (list
162 #:imported-modules `(,@%cmake-build-system-modules
daeef2e7 163 (guix build python-build-system))
c162dc37 164 #:modules '((guix build cmake-build-system)
daeef2e7
MC
165 ((guix build python-build-system) #:prefix python:)
166 (guix build utils))
c162dc37
MC
167 #:phases
168 #~(modify-phases %standard-phases
169 (add-after 'unpack 'fix-python-site-prefix
170 (lambda* (#:key inputs outputs #:allow-other-keys)
171 (substitute* "src/python/CMakeLists.txt"
172 (("EXECUTE_PROCESS.*OUTPUT_VARIABLE PYTHON_INSTALL_DIR.*")
173 (format #f "set (PYTHON_INSTALL_DIR ~a)~%"
174 (python:site-packages inputs outputs))))))
175 (add-after 'unpack 'fix-bash-completion-prefix
176 (lambda _
177 (substitute* "CMakeLists.txt"
178 (("execute_process.*OUTPUT_VARIABLE BASHCOMP_DIR.*")
179 (format #f "set (BASHCOMP_DIR ~a\
180/share/bash-completion/completions)~%" #$output))))))))
daeef2e7 181 (native-inputs
8394619b 182 (list bash-completion pkg-config python))
daeef2e7 183 (inputs
8394619b
LC
184 (list bzip2
185 curl
186 drpm
187 libmodulemd
188 libxml2
189 openssl
190 sqlite
191 zchunk))
daeef2e7
MC
192 (home-page "https://rpm-software-management.github.io/createrepo_c/")
193 (synopsis "C implementation of the createrepo tool")
194 (description "This package provides the @command{createrepo} command,
195which can be used to create RPM repositories.")
196 (license license:gpl2+)))