On 05/01/2011 21:05, Gaetan Nadon wrote:
> On Wed, 2011-01-05 at 20:30 +0000, Jon TURNEY wrote:
> 
>> On 05/01/2011 14:25, Daniel Stone wrote:
>>> Previously the XWin build required a live internet connection (and
>>> Khronos's servers to not be down for maintenance, etc) in order to
>>> download the (W)GL specs to autogenerate files from.  Even if you
>>> weren't building XWin, this broke distcheck.
>>>
>>> It's a fairly upsetting diffstat, but not being able to distcheck on
>>> the train makes me sad-in-pants.
>>>
>>> Signed-off-by: Daniel Stone 
>>> <daniel-rLtY4a/8tF1rovVCs/utlw-xmd5yjdbdmtouj55ttl...@public.gmane.org.org>
>>> ---
>>>
>>> Note that this is not the real patch: SMTP doesn't allow even 1024-character
>>> lines, let alone 31488 characters (sigh).  The real patch can be found at:
>>> git://people.freedesktop.org/~daniels/xserver in the master branch
>>>
>>> But you get the idea.
>>
>> Yes, this is pretty bad atm.  I'm not sure why I did things this way in the
>> first place.  I think perhaps I was concerned about that I didn't know the
>> license terms for those files and didn't want to get stuck with manually
>> updating them.
> 
> It looks promising as the terms of the license are copied from the X11
> license.
> http://oss.sgi.com/projects/FreeB/SGIFreeSWLicB.2.0.pdf.
> 
> The build reproducibility is important. Various distros building X must
> do so from the same source code.
> Those building from tarballs expect the source code to be complete.
> One should be able to rebuild a 2 year old server with the same 2 year
> old gl spec.

I'm not sure I totally buy this argument.  We don't include stdio.h to ensure
that we can build with the version that was installed 2 years ago :-)

(Although I'm sure this problem is solved by a package build system which
audits the build dependencies)

>> Perhaps it would be better to simply remove these files, and I should just
>> create a package for cygwin containing these files, and then make that a
>> build-time requirement?

It makes me very uncomfortable to add a copy of those files, so here is an
alternative patch which removes the downloading of the files, which hopefully
fixes the distcheck problem, and the ~2.5 people who actually build XWin can
ensure they are made available in an appropriate way.

(I had a look at how Wine does this, as it needs to generate these same
wrappers with the opposite thunking, to see if it did this in a better way,
but unfortunately, that downloads the files also :-( [1] )

[1] http://source.winehq.org/git/wine.git/?a=tree;f=dlls/opengl32
>From 299934fc88cf83274e493f2e525dd2f31ab681f2 Mon Sep 17 00:00:00 2001
From: Daniel Stone <dan...@fooishbar.org>
Date: Wed, 5 Jan 2011 14:09:02 +0000
Subject: [PATCH] XWin: Look for GL specs in a known place, rather than 
downloading them

Previously the XWin build required a live internet connection (and
Khronos's servers to not be down for maintenance, etc) in order to
download the (W)GL specs to autogenerate files from.  Even if you
weren't building XWin, this broke distcheck.

Also, wglext.h should probably be provided by w32api/GL

Based on a patch by Daniel Stone <dan...@fooishbar.org>

Signed-off-by: Jon TURNEY <jon.tur...@dronecode.org.uk>
---
 hw/xwin/glx/.gitignore  |    5 -----
 hw/xwin/glx/Makefile.am |   36 +++++++++++++-----------------------
 2 files changed, 13 insertions(+), 28 deletions(-)

diff --git a/hw/xwin/glx/.gitignore b/hw/xwin/glx/.gitignore
index e7c7617..6cdb91f 100644
--- a/hw/xwin/glx/.gitignore
+++ b/hw/xwin/glx/.gitignore
@@ -1,8 +1,3 @@
 # ignore downloaded and generated files
 generated_gl_wrappers.c
 generated_wgl_wrappers.c
-gl.spec
-gl.tm
-wgl.tm
-wglext.spec
-wglext.h
diff --git a/hw/xwin/glx/Makefile.am b/hw/xwin/glx/Makefile.am
index e9fea50..effd7ef 100644
--- a/hw/xwin/glx/Makefile.am
+++ b/hw/xwin/glx/Makefile.am
@@ -26,35 +26,25 @@ AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \
             -I$(top_srcdir)/hw/xwin/
 
 glwrap.c: generated_gl_wrappers.c
-wgl_ext_api.c: generated_wgl_wrappers.c wglext.h
-wgl_ext_api.h: wglext.h
+wgl_ext_api.c: generated_wgl_wrappers.c
 indirect.c: wgl_ext_api.h
 
-SPEC_FILES = gl.spec gl.tm wglext.spec wgl.tm
+# we expect to find OpenGL spec files in a known place
+# if they aren't packaged for your platform, you can populate this directory 
with the following commands
+# wget http://www.opengl.org/registry/api/gl.spec
+# wget http://www.opengl.org/registry/api/gl.tm
+# wget http://www.opengl.org/registry/api/wglext.spec
+# wget http://www.opengl.org/registry/api/wgl.tm
 
-gl.spec:
-       wget http://www.opengl.org/registry/api/gl.spec
+OPENGL_SPEC_DIR = /usr/share/opengl/spec
 
-gl.tm:
-       wget http://www.opengl.org/registry/api/gl.tm
+generated_gl_wrappers.c: gen_gl_wrappers.py $(OPENGL_SPEC_DIR)/gl.spec 
$(OPENGL_SPEC_DIR)/gl.tm
+       $(srcdir)/gen_gl_wrappers.py --spec=$(OPENGL_SPEC_DIR)/gl.spec 
--typemap=$(OPENGL_SPEC_DIR)/gl.tm 
--dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers 
>generated_gl_wrappers.c
 
-wglext.spec:
-       wget http://www.opengl.org/registry/api/wglext.spec
-
-wgl.tm:
-       wget http://www.opengl.org/registry/api/wgl.tm
-
-generated_gl_wrappers.c: gen_gl_wrappers.py gl.spec gl.tm
-       $(srcdir)/gen_gl_wrappers.py --spec=$(srcdir)/gl.spec 
--typemap=$(srcdir)/gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h 
--staticwrappers >generated_gl_wrappers.c
-
-generated_wgl_wrappers.c: gen_gl_wrappers.py wglext.spec wgl.tm
-       $(srcdir)/gen_gl_wrappers.py --spec=$(srcdir)/wglext.spec 
--typemap=$(srcdir)/wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c
-
-wglext.h:
-       wget http://www.opengl.org/registry/api/wglext.h
+generated_wgl_wrappers.c: gen_gl_wrappers.py $(OPENGL_SPEC_DIR)/wglext.spec 
$(OPENGL_SPEC_DIR)/wgl.tm
+       $(srcdir)/gen_gl_wrappers.py --spec=$(OPENGL_SPEC_DIR)/wglext.spec 
--typemap=$(OPENGL_SPEC_DIR)/wgl.tm --prefix=wgl --preresolve 
>generated_wgl_wrappers.c
 
 BUILT_SOURCES = generated_gl_wrappers.c generated_wgl_wrappers.c
 CLEANFILES = $(BUILT_SOURCES)
-DISTCLEANFILES = $(SPEC_FILES) wglext.h
 
-EXTRA_DIST = gen_gl_wrappers.py $(SPEC_FILES) wglext.h
+EXTRA_DIST = gen_gl_wrappers.py
-- 
1.7.3.3

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to