From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: [PATCH] gnu: sdl-union: Wrap into a procedure and export it. Date: Sat, 10 Oct 2015 11:48:44 +0300 Message-ID: <87lhbbrtw3.fsf_-_@gmail.com> References: <87wpv2jvgr.fsf@gmail.com> <87oag8qkp8.fsf@gnu.org> <87twpz4sff.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zkppd-0003DW-PC for guix-devel@gnu.org; Sat, 10 Oct 2015 04:48:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkppZ-0004s8-Dg for guix-devel@gnu.org; Sat, 10 Oct 2015 04:48:45 -0400 In-Reply-To: <87twpz4sff.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 09 Oct 2015 23:56:36 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s (2015-10-10 00:56 +0300) wrote: > "Thompson, David" skribis: > >> On Fri, Oct 9, 2015 at 8:40 AM, Ludovic Court=C3=A8s wrot= e: >>> Alex Kost skribis: >>> >>>> I don't know if there is a better workaround for the SDL headers, but >>>> this problem is rather common: there is a workaround in 'abbaye' and a >>>> special patch for 'pingus'. >>>> >>>> The problem is: the source code has lines like this: >>>> >>>> #include >>>> >>>> but the headers of all SDL packages are placed in =E2=80=9Cinclude/SDL= /=E2=80=9D >>>> subdirectories. And an upstream often doesn't use "pkg-config" for >>>> every SDL package to define CFLAGS and assumes that all SDL headers are >>>> placed in one directory. So we have to invent workarounds for such >>>> packages. >>>> >>>> I just mention this problem here, perhaps someone will come up with a >>>> general solution. >>> >>> Can=E2=80=99t =E2=80=98sdl-union=E2=80=99 be used here? I think it was= created specifically to >>> solve this problem. (Currently it=E2=80=99s private to (gnu packages s= dl) but >>> you can export it.) >> >> Do you have any concerns about this package being picked up by UIs now >> that it will be public? Might confuse a user or two, dunno. > > No opinion. If you think we=E2=80=99d rather keep it hidden, we can wrap= it in > a thunk for instance so that the UIs don=E2=80=99t pick it up. WDYT? I like it. But since there are several sdl libraries, and not all of them may be required, what about making it a procedure that takes sdl packages instead? (the patch is attached) --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-gnu-sdl-union-Wrap-into-a-procedure-and-export-it.patch Content-Transfer-Encoding: quoted-printable >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=3DUTF-8 Content-Transfer-Encoding: 8bit Suggested by Ludovic Court=C3=A8s . * 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)) =20 (define sdl (package @@ -268,33 +269,42 @@ SDL.") (home-page "http://www.libsdl.org/projects/SDL_ttf/") (license zlib))) =20 -(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 bec= ause -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))))) =20 (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=3D" --=20 2.5.0 --=-=-=--