libbsd.scm 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
  3. ;;; Copyright © 2022 Marius Bakke <marius@gnu.org>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. (define-module (gnu packages libbsd)
  20. #:use-module (guix build-system gnu)
  21. #:use-module (guix download)
  22. #:use-module (guix licenses)
  23. #:use-module (guix packages)
  24. #:use-module (guix gexp)
  25. #:use-module (gnu packages crypto))
  26. (define-public libbsd
  27. (package
  28. (name "libbsd")
  29. (version "0.11.6")
  30. (source (origin
  31. (method url-fetch)
  32. (uri (string-append "https://libbsd.freedesktop.org/releases/"
  33. "libbsd-" version ".tar.xz"))
  34. (sha256
  35. (base32
  36. "1pxmk42brddk43bj8lp4a64f9iwhc5ii91y6w7k97xpaf8qqzcqr"))))
  37. (build-system gnu-build-system)
  38. (arguments
  39. (list #:configure-flags #~'("--disable-static")
  40. #:phases #~(modify-phases %standard-phases
  41. (add-after 'install 'embed-absolute-libmd-references
  42. (lambda* (#:key inputs #:allow-other-keys)
  43. (let ((libmd (search-input-file inputs
  44. "lib/libmd.so")))
  45. ;; Add absolute references to libmd so it
  46. ;; does not need to be propagated.
  47. (with-directory-excursion #$output
  48. (substitute* "lib/libbsd.so"
  49. (("^GROUP")
  50. (string-append "SEARCH_DIR("
  51. (dirname libmd)
  52. ")\nGROUP")))
  53. (substitute* (find-files "lib/pkgconfig"
  54. "\\.pc$")
  55. (("-lmd")
  56. (string-append "-L" (dirname libmd)
  57. " -lmd")))))))
  58. (add-before 'check 'disable-pwcache-test
  59. (lambda _
  60. ;; This test expects the presence of a root
  61. ;; user and group, which do not exist in the
  62. ;; build container.
  63. (substitute* "test/Makefile"
  64. (("pwcache\\$\\(EXEEXT\\) ")
  65. "")))))))
  66. (inputs
  67. (list libmd))
  68. (synopsis "Utility functions from BSD systems")
  69. (description "This library provides useful functions commonly found on BSD
  70. systems, and lacking on others like GNU systems, thus making it easier to port
  71. projects with strong BSD origins, without needing to embed the same code over
  72. and over again on each project.")
  73. (home-page "https://libbsd.freedesktop.org/wiki/")
  74. ;; This package is a collection of third-party functions that were
  75. ;; originally released under various non-copyleft licenses.
  76. (license (list bsd-2 bsd-3 bsd-4 expat isc public-domain
  77. (non-copyleft "file://COPYING"
  78. "See COPYING in the distribution.")))))