mozilla.scm 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
  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 (guix build-system mozilla)
  19. #:use-module (guix build-system gnu)
  20. #:use-module (guix build-system)
  21. #:use-module (guix utils)
  22. #:export (mozilla-build-system))
  23. ;;
  24. ;; Build procedure for packages using Autotools with the Mozillian conventions
  25. ;; for --target, --host and --build, which are different from the GNU
  26. ;; conventions.
  27. ;;
  28. ;; Code:
  29. (define* (lower-mozilla name #:key system target #:allow-other-keys
  30. #:rest arguments)
  31. (define lower (build-system-lower gnu-build-system))
  32. (if target
  33. (apply lower name
  34. (substitute-keyword-arguments arguments
  35. ;; Override --target and --host to what Mozillian configure
  36. ;; scripts expect.
  37. ((#:configure-flags configure-flags ''())
  38. `(cons* ,(string-append "--target=" target)
  39. ,(string-append "--host=" (nix-system->gnu-triplet system))
  40. ,configure-flags))))
  41. (apply lower name arguments))) ; not cross-compiling
  42. (define mozilla-build-system
  43. (build-system
  44. (name 'mozilla)
  45. (description "The build system for Mozilla software using the Autotools")
  46. (lower lower-mozilla)))
  47. ;;; mozilla.scm ends here