rpm.scm 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  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. (define-module (gnu packages rpm)
  19. #:use-module ((guix licenses) #:prefix license:)
  20. #:use-module (guix download)
  21. #:use-module (guix git-download)
  22. #:use-module (guix packages)
  23. #:use-module (guix build-system cmake)
  24. #:use-module (guix build-system meson)
  25. #:use-module (gnu packages bash)
  26. #:use-module (gnu packages check)
  27. #:use-module (gnu packages compression)
  28. #:use-module (gnu packages curl)
  29. #:use-module (gnu packages docbook)
  30. #:use-module (gnu packages glib)
  31. #:use-module (gnu packages gtk)
  32. #:use-module (gnu packages man)
  33. #:use-module (gnu packages package-management)
  34. #:use-module (gnu packages pkg-config)
  35. #:use-module (gnu packages popt)
  36. #:use-module (gnu packages python)
  37. #:use-module (gnu packages serialization)
  38. #:use-module (gnu packages sqlite)
  39. #:use-module (gnu packages tls)
  40. #:use-module (gnu packages xml))
  41. (define-public drpm
  42. (package
  43. (name "drpm")
  44. (version "0.5.0")
  45. (source (origin
  46. (method git-fetch)
  47. (uri (git-reference
  48. (url "https://github.com/rpm-software-management/drpm")
  49. (commit version)))
  50. (file-name (git-file-name name version))
  51. (sha256
  52. (base32
  53. "0m269nl8s31yjyz7kknv4jl9mx12xjpx2ly6wf66zs5613m4rj1z"))))
  54. (build-system cmake-build-system)
  55. (native-inputs
  56. `(("cmocka" ,cmocka)
  57. ("pkg-config" ,pkg-config)))
  58. (inputs
  59. `(("bzip2" ,bzip2)
  60. ("lzlib" ,lzlib)
  61. ("openssl" ,openssl)
  62. ("popt" ,popt)
  63. ("rpm" ,rpm)
  64. ("xz" ,xz)
  65. ("zlib" ,zlib)
  66. ("zstd" ,zstd "lib")))
  67. (home-page "https://github.com/rpm-software-management/drpm")
  68. (synopsis "Delta RPM library")
  69. (description "This package provides a library for making, reading and
  70. applying deltarpms, compatible with the original deltarpm packages.")
  71. (license license:lgpl2.1+)))
  72. (define-public libmodulemd
  73. (package
  74. (name "libmodulemd")
  75. (version "2.13.0")
  76. (source (origin
  77. (method url-fetch)
  78. (uri (string-append "https://github.com/fedora-modularity/"
  79. "libmodulemd/releases/download/" version
  80. "/modulemd-" version ".tar.xz"))
  81. (sha256
  82. (base32
  83. "1g4wizr2wwl5x77ni5j46nfcax8fbb7nqq5nr7va9sccyigwwwnc"))))
  84. (build-system meson-build-system)
  85. (outputs '("out" "doc")) ;2.6 MiB of HTML documentation
  86. (arguments
  87. `(#:configure-flags
  88. (list (string-append "-Dgobject_overrides_dir_py3="
  89. (python:site-packages %build-inputs %outputs)))
  90. #:imported-modules (,@%meson-build-system-modules
  91. (guix build python-build-system))
  92. #:modules ((guix build meson-build-system)
  93. ((guix build python-build-system) #:prefix python:)
  94. (guix build utils))
  95. #:phases
  96. (modify-phases %standard-phases
  97. (add-after 'unpack 'fix-glib-doc-prefix
  98. (lambda* (#:key inputs #:allow-other-keys)
  99. (let ((glib:doc (assoc-ref inputs "glib:doc")))
  100. (substitute* "meson.build"
  101. (("glib_docpath = .*")
  102. (format #f "glib_docpath = '~a'~%"
  103. (string-append glib:doc
  104. "/share/gtk-doc/html")))))))
  105. (add-after 'unpack 'fix-docbook-references
  106. ;; gtk-doc doesn't seem to honor DocBook 4.1.2's docbook.cat's
  107. ;; catalog file, even when adding it to XML_CATALOG_FILES. Work
  108. ;; around it by adjusting the DocBook references directly.
  109. (lambda* (#:key inputs #:allow-other-keys)
  110. (substitute* "modulemd/modulemd-docs.xml"
  111. (("http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd")
  112. (string-append (assoc-ref inputs "docbook-xml")
  113. "/xml/dtd/docbook/docbookx.dtd")))))
  114. (add-after 'install 'move-documentation
  115. (lambda* (#:key outputs #:allow-other-keys)
  116. (let* ((out (assoc-ref outputs "out"))
  117. (doc (assoc-ref outputs "doc"))
  118. (src (string-append out "/share/gtk-doc"))
  119. (dst (string-append doc "/share/gtk-doc")))
  120. (mkdir-p (dirname dst))
  121. (rename-file src dst)))))))
  122. (native-inputs
  123. `(("docbook-xml" ,docbook-xml-4.1.2)
  124. ("glib:bin" ,glib "bin")
  125. ("glib:doc" ,glib-with-documentation "doc")
  126. ("gobject-introspection" ,gobject-introspection) ;for g-ir-scanner
  127. ("gtk-doc" ,gtk-doc)
  128. ("help2man" ,help2man)
  129. ("pkg-config" ,pkg-config)))
  130. (inputs
  131. `(("gtk" ,gtk+)
  132. ("python-pygobject" ,python-pygobject)))
  133. (propagated-inputs
  134. ;; glib and gobject are listed as 'Requires' in modulemd-2.0.pc.
  135. `(("glib" ,glib)
  136. ;; yaml and rpm are listed as 'Requires.private' in modulemd-2.0.pc.
  137. ("libyaml" ,libyaml)
  138. ("rpm" ,rpm)))
  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
  142. for interacting with repodata (that is, streams of YAML that contains
  143. information on multiple streams, default data and translations).")
  144. (license license:expat)))
  145. (define-public createrepo-c
  146. (package
  147. (name "createrepo-c")
  148. (version "0.17.4")
  149. (source (origin
  150. (method git-fetch)
  151. (uri (git-reference
  152. (url "https://github.com/rpm-software-management/createrepo_c")
  153. (commit version)))
  154. (file-name (git-file-name name version))
  155. (sha256
  156. (base32
  157. "1fgf71mkhghgbp0pf2pazc7hyaix5igb5nl4fqsisjksfvzdfm5k"))))
  158. (build-system cmake-build-system)
  159. (arguments
  160. `(#:imported-modules (,@%cmake-build-system-modules
  161. (guix build python-build-system))
  162. #:modules ((guix build cmake-build-system)
  163. ((guix build python-build-system) #:prefix python:)
  164. (guix build utils))
  165. #:phases
  166. (modify-phases %standard-phases
  167. (add-after 'unpack 'fix-python-site-prefix
  168. (lambda* (#:key inputs outputs #:allow-other-keys)
  169. (substitute* "src/python/CMakeLists.txt"
  170. (("EXECUTE_PROCESS.*OUTPUT_VARIABLE PYTHON_INSTALL_DIR.*")
  171. (format #f "set (PYTHON_INSTALL_DIR ~a)~%"
  172. (python:site-packages inputs outputs))))))
  173. (add-after 'unpack 'fix-bash-completion-prefix
  174. (lambda* (#:key outputs #:allow-other-keys)
  175. (substitute* "CMakeLists.txt"
  176. (("execute_process.*OUTPUT_VARIABLE BASHCOMP_DIR.*")
  177. (format #f "set (BASHCOMP_DIR ~a\
  178. /share/bash-completion/completions)~%" (assoc-ref outputs "out")))))))))
  179. (native-inputs
  180. `(("bash-completion" ,bash-completion)
  181. ("pkg-config" ,pkg-config)
  182. ("python" ,python)))
  183. (inputs
  184. `(("bzip2" ,bzip2)
  185. ("curl" ,curl)
  186. ("drpm" ,drpm)
  187. ("libmodulemd" ,libmodulemd)
  188. ("libxml2" ,libxml2)
  189. ("openssl" ,openssl)
  190. ("sqlite" ,sqlite)
  191. ("zchunk" ,zchunk)))
  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,
  195. which can be used to create RPM repositories.")
  196. (license license:gpl2+)))