unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: taylanbayirli@gmail.com (Taylan Ulrich Bayırlı/Kammer)
To: Andreas Enge <andreas@enge.fr>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] gnu: mesa: Add libva input.
Date: Thu, 30 Apr 2015 10:20:09 +0200	[thread overview]
Message-ID: <87oam6c9ja.fsf@taylan.uni.cx> (raw)
In-Reply-To: <20150430072934.GA4097@debian> (Andreas Enge's message of "Thu, 30 Apr 2015 09:29:34 +0200")

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

Andreas Enge <andreas@enge.fr> writes:

> On Wed, Apr 29, 2015 at 11:52:30PM +0200, Taylan Ulrich Bayırlı/Kammer wrote:
>> Right.  I don't know what I did wrong before, but it actually seems to
>> work fine to put it in gl.scm.  New patch:
>
> Okay, looks good.

Actually, I hit the problem again now; it's during the compilation of
.scm files.

The problem seems to be that 'inherit' fields of packages are evaluated
eagerly, so when video.scm directly or indirectly imports gl.scm before
having bound the libva variable to its value, and the libva-without-mesa
definition in gl.scm tries to reference libva, it errors.

I can solve this by wrapping the libva-without-mesa definition in a
delay, and forcing it in the input field of mesa.  Is that OK?

New patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-gnu-mesa-Add-libva-input.patch --]
[-- Type: text/x-diff, Size: 2647 bytes --]

From 8ca6a9ea562f2f20763978c6cfc111a0ce34db16 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 <taylanbayirli@gmail.com>
Date: Tue, 28 Apr 2015 15:08:47 +0200
Subject: [PATCH 2/3] gnu: mesa: Add libva input.

There is a circular dependency between Mesa and libVA, so we use a
libva-no-mesa package that builds libVA without GLX and EGL support, and use
that for building Mesa.

* gnu/packages/gl.scm (libva-for-mesa): New variable.
(mesa): Add as input.
---
 gnu/packages/gl.scm | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index e640f83..ea38f1e 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -21,11 +21,13 @@
 
 (define-module (gnu packages gl)
   #:use-module (ice-9 match)
+  #:use-module (guix build utils)
   #:use-module ((guix licenses) #:prefix l:)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
   #:use-module (guix packages)
+  #:use-module (guix utils)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages flex)
@@ -37,6 +39,7 @@
   #:use-module (gnu packages xml)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages guile)
+  #:use-module (gnu packages video)
   #:use-module (gnu packages xdisorg))
 
 (define-public glu
@@ -159,6 +162,23 @@ Polygon meshes, and Extruded polygon meshes")
 also known as DXTn or DXTC) for Mesa.")
     (license l:expat)))
 
+;;; Mesa needs LibVA headers to build its Gallium-based VA API implementation;
+;;; LibVA itself depends on Mesa.  We use the following to solve the circular
+;;; dependency.
+(define libva-without-mesa
+  ;; Delay to work around circular import problem.
+  (delay
+    (package
+      (inherit libva)
+      (name "libva-without-mesa")
+      (inputs (alist-delete "mesa" (package-inputs libva)))
+      (arguments
+       (strip-keyword-arguments
+        '(#:make-flags)
+        (substitute-keyword-arguments (package-arguments libva)
+          ((#:configure-flags flags)
+           '(list "--disable-glx" "--disable-egl"))))))))
+
 (define-public mesa
   (package
     (name "mesa")
@@ -187,8 +207,8 @@ also known as DXTn or DXTC) for Mesa.")
         ("dri3proto" ,dri3proto)
         ("presentproto" ,presentproto)
         ("expat" ,expat)
+        ("libva" ,(force libva-without-mesa))
         ("libxml2" ,libxml2)
-        ;; TODO: Add 'libva'
         ;; TODO: Add 'libxml2-python' for OpenGL ES 1.1 and 2.0 support
         ("makedepend" ,makedepend)
         ("s2tc" ,s2tc)))
-- 
2.2.1


  parent reply	other threads:[~2015-04-30  8:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-28 13:14 [PATCH] gnu: mesa: Add libva input Taylan Ulrich Bayırlı/Kammer
2015-04-28 14:14 ` Taylan Ulrich Bayırlı/Kammer
2015-04-28 14:20 ` 宋文武
2015-04-28 20:21   ` Taylan Ulrich Bayırlı/Kammer
2015-04-29  8:59     ` 宋文武
2015-04-29 21:12     ` Andreas Enge
2015-04-29 21:52       ` Taylan Ulrich Bayırlı/Kammer
2015-04-30  7:29         ` Andreas Enge
2015-04-30  7:31           ` Andreas Enge
2015-04-30  7:52             ` Taylan Ulrich Bayırlı/Kammer
2015-04-30 13:26               ` Taylan Ulrich Bayırlı/Kammer
2015-04-30 22:18                 ` Ludovic Courtès
2015-04-30  7:49           ` Taylan Ulrich Bayırlı/Kammer
2015-04-30  8:20           ` Taylan Ulrich Bayırlı/Kammer [this message]
2015-04-30 22:17             ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oam6c9ja.fsf@taylan.uni.cx \
    --to=taylanbayirli@gmail.com \
    --cc=andreas@enge.fr \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).