>From f1bd9edbbae498fb3b4726428daf523e3fd83060 Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Sat, 10 Oct 2015 11:27:27 +0300 Subject: [PATCH] gnu: sdl-union: Wrap into a procedure and export it. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggested by Ludovic Courtès . * gnu/packages/sdl.scm (sdl-union): Make it a procedure returning 'sdl-union' package. (guile-sdl): Use it. --- gnu/packages/sdl.scm | 68 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/gnu/packages/sdl.scm b/gnu/packages/sdl.scm index 50fe010..021feff 100644 --- a/gnu/packages/sdl.scm +++ b/gnu/packages/sdl.scm @@ -42,7 +42,8 @@ sdl-image sdl-mixer sdl-net - sdl-ttf)) + sdl-ttf + sdl-union)) (define sdl (package @@ -268,33 +269,42 @@ SDL.") (home-page "http://www.libsdl.org/projects/SDL_ttf/") (license zlib))) -(define sdl-union - (package - (name "sdl-union") - (version (package-version sdl)) - (source #f) - (build-system trivial-build-system) - (arguments - '(#:modules ((guix build union)) - #:builder (begin - (use-modules (ice-9 match) - (guix build union)) - (match %build-inputs - (((names . directories) ...) - (union-build (assoc-ref %outputs "out") - directories)))))) - (inputs `(("sdl" ,sdl) - ("sdl-gfx" ,sdl-gfx) - ("sdl-image" ,sdl-image) - ("sdl-mixer" ,sdl-mixer) - ("sdl-ttf" ,sdl-ttf))) - (synopsis "Union of all SDL libraries") - (description - "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 -directory.") - (home-page (package-home-page sdl)) - (license (package-license sdl)))) +(define (sdl-union . sdl-packages) + "Return 'sdl-union' package that is the union of SDL-PACKAGES. +If SDL-PACKAGES are not specified, all SDL libraries are used." + (let* ((sdl-packages (if (null? sdl-packages) + (list sdl + sdl-gfx + sdl-image + sdl-mixer + sdl-net + sdl-ttf) + sdl-packages)) + (inputs (map (lambda (pkg) + (list (package-name pkg) pkg)) + sdl-packages))) + (package + (name "sdl-union") + (version (package-version sdl)) + (source #f) + (build-system trivial-build-system) + (arguments + '(#:modules ((guix build union)) + #:builder (begin + (use-modules (ice-9 match) + (guix build union)) + (match %build-inputs + (((names . directories) ...) + (union-build (assoc-ref %outputs "out") + directories)))))) + (inputs inputs) + (synopsis "Union of SDL libraries") + (description + "A union of SDL and its extension libraries. The union is +required because sdl-config assumes that all of the headers and +libraries are in the same directory.") + (home-page (package-home-page sdl)) + (license (package-license sdl))))) (define-public guile-sdl (package @@ -316,7 +326,7 @@ directory.") ("libjpeg" ,libjpeg))) (inputs `(("guile" ,guile-2.0) - ("sdl-union" ,sdl-union))) + ("sdl-union" ,(sdl-union)))) (arguments '(#:configure-flags (list (string-append "--with-sdl-prefix=" -- 2.5.0