gnu: sdl-union: Wrap into a procedure and export it.

Suggested by Ludovic Courtès <ludo@gnu.org>.

* gnu/packages/sdl.scm (sdl-union): Make it a procedure returning
  'sdl-union' package.
  (guile-sdl): Use it.
This commit is contained in:
Alex Kost 2015-10-10 11:27:27 +03:00
parent 0f6139b1b5
commit 40e94665d4
1 changed files with 12 additions and 9 deletions

View File

@ -2,6 +2,7 @@
;;; Copyright © 2013 David Thompson <dthompson2@worcester.edu> ;;; Copyright © 2013 David Thompson <dthompson2@worcester.edu>
;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -42,7 +43,8 @@
sdl-image sdl-image
sdl-mixer sdl-mixer
sdl-net sdl-net
sdl-ttf)) sdl-ttf
sdl-union))
(define sdl (define sdl
(package (package
@ -268,7 +270,10 @@ SDL.")
(home-page "http://www.libsdl.org/projects/SDL_ttf/") (home-page "http://www.libsdl.org/projects/SDL_ttf/")
(license zlib))) (license zlib)))
(define sdl-union (define* (sdl-union #:optional (packages (list sdl sdl-gfx sdl-net sdl-ttf
sdl-image sdl-mixer)))
"Return 'sdl-union' package which is a union of PACKAGES.
If PACKAGES are not specified, all SDL packages are used."
(package (package
(name "sdl-union") (name "sdl-union")
(version (package-version sdl)) (version (package-version sdl))
@ -283,12 +288,10 @@ SDL.")
(((names . directories) ...) (((names . directories) ...)
(union-build (assoc-ref %outputs "out") (union-build (assoc-ref %outputs "out")
directories)))))) directories))))))
(inputs `(("sdl" ,sdl) (inputs (map (lambda (package)
("sdl-gfx" ,sdl-gfx) (list (package-name package) package))
("sdl-image" ,sdl-image) packages))
("sdl-mixer" ,sdl-mixer) (synopsis "Union of SDL libraries")
("sdl-ttf" ,sdl-ttf)))
(synopsis "Union of all SDL libraries")
(description (description
"A union of SDL and its extension libraries. A union is required because "A union of SDL and its extension libraries. A union is required because
sdl-config assumes that all of the headers and libraries are in the same sdl-config assumes that all of the headers and libraries are in the same
@ -316,7 +319,7 @@ directory.")
("libjpeg" ,libjpeg))) ("libjpeg" ,libjpeg)))
(inputs (inputs
`(("guile" ,guile-2.0) `(("guile" ,guile-2.0)
("sdl-union" ,sdl-union))) ("sdl-union" ,(sdl-union))))
(arguments (arguments
'(#:configure-flags '(#:configure-flags
(list (string-append "--with-sdl-prefix=" (list (string-append "--with-sdl-prefix="