1 # Manually Building X and Beyond
3 We try something **ill-advised**, we build a separate version of X.org in another directory, say */opt/xbeta*,
4 on the same machine where we have installed the latext pkgsrc. We do this because we have no choice but to
5 use the graphics hardware on this machine, but the risk is that it is very easy to link the wrong libraries
10 The following notes describe alterations to one's system that may leave the graphical user interface based
11 on X.org unusable. Use at one's own risk. Because the risk of damaging one's system is so great, I refuse
12 to provide ready-to-run scripts.
14 ## Installing from pkgsrc
16 ### GNU m4 1.4.14 and bison 2.4.2
18 Patch both *devel/m4* and *devel/bison* using the patch idea from:
19 <http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=43098>
21 Unfortunately the problems are in the *work* directories so that one needs the knowledge from
22 <http://www.netbsd.org/docs/pkgsrc/components.html>
23 to even get the patches to be applied.
25 Install *pkgtools/pkgdiff*.
29 As of 2010-05-09, I find it necessary on x86_64 to use the following patch for
30 pkgsrc gstreamer0.10, an eventual dependency of the full xfce desktop:
32 --- pkgsrc/multimedia/gstreamer0.10/Makefile.orig 2010-03-29 16:04:23 -0700
33 +++ pkgsrc/multimedia/gstreamer0.10/Makefile 2010-03-29 16:09:04 -0700
36 .include "../../mk/bsd.prefs.mk"
38 +# __udivti3 error otherwise
39 +.if ${OPSYS} == "DragonFly" && ${MACHINE_ARCH} == "x86_64"
40 +MAKEFLAGS+= CCVER=gcc44
43 .if ${OPSYS} == "NetBSD"
44 # We must have a glib2 compiled with the RTLD_GLOBAL fix; if not, plugins
47 See for example the following bug report for more details:
48 <http://mail-index.netbsd.org/pkgsrc-bugs/2010/03/30/msg037304.html>
52 We start with installing into */opt/xbeta* [expat 2.0.1](http://sourceforge.net/projects/expat/)
53 and [gettext 0.17](http://www.gnu.org/software/gettext/).
55 ### Git repository for most of X.org
57 We use the following listing:
59 [freedesktop.org git repository browser](http://cgit.freedesktop.org/)
61 One can easily script getting, updating, and building the projects listed on that page.
63 ### Example of using ldd
67 libc.so.7 => /usr/lib/libc.so.7 (0x800640000)
70 libc.so.7 => /usr/lib/libc.so.7 (0x800640000)
72 ### libxcb problem with Python 2.6 cElementTree
74 Library *xcb/libxcb* unfortunately needs to be built early and there is a catch for
75 using pkgsrc Python 2.6. Unfortunately at the current time not all of
76 *cElementTree* appears to be functional; therefore, one needs a patch similar to
78 diff --git a/src/c_client.py b/src/c_client.py
79 index d86d05e..36a7039 100755
84 -from xml.etree.cElementTree import *
85 +from xml.etree.ElementTree import *
86 from os.path import basename
90 As of May 20, 2010, the situation for libxcb seems to be more complicated. The latest *xcb/proto* needs
91 to be installed. If one does not wish to install on top of one's current Python modules,
94 export PYTHONPATH=${PREFIX}/lib/python2.6/site-packages
96 and apply a patch similar to below to change from using Python 2.6's *cElementTree* to *ElementTree*
98 diff --git a/xcbgen/matcher.py b/xcbgen/matcher.py
99 index e7958fa..16e8273 100644
100 --- a/xcbgen/matcher.py
101 +++ b/xcbgen/matcher.py
102 @@ -7,7 +7,7 @@ we do not create a new type object, we just record the existing one under a new
105 from os.path import join
106 -from xml.etree.cElementTree import parse
107 +from xml.etree.ElementTree import parse
111 diff --git a/xcbgen/state.py b/xcbgen/state.py
112 index 51efc94..e72dc3e 100644
113 --- a/xcbgen/state.py
114 +++ b/xcbgen/state.py
116 This module contains the namespace class and the singleton module class.
118 from os.path import dirname, basename
119 -from xml.etree.cElementTree import parse
120 +from xml.etree.ElementTree import parse
128 /usr/libexec/binutils217/elf/ld: .libs/extutil.o: relocation R_X86_64_PC32 against `xgeExtRegister' can not be used when making a shared object; recompile with -fPIC
129 /usr/libexec/binutils217/elf/ld: final link failed: Bad value
131 Use the following patch from <http://lists.x.org/archives/xorg-devel/2009-November/003724.html>
133 diff --git a/src/Xge.c b/src/Xge.c
134 index 7a583e5..2ea5d27 100644
137 @@ -294,7 +294,7 @@ _xgeEventToWire(Display* dpy, XEvent* re, xEvent* event)
139 * Extensions need to register callbacks for their events.
143 xgeExtRegister(Display* dpy, int offset, XExtensionHooks* callbacks)
149 We install [FreeType 2.3.12](http://www.freetype.org/). It appears that *GNUMAKE=gmake* is required.
150 Most of the X.org projects use *autogen.sh*, but here we use a standard call to *configure* somewhat
153 export ACLOCAL="aclocal -I ${PREFIX}/share/aclocal"
154 export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig"
155 GNUMAKE=gmake ./configure --prefix=${PREFIX} CPPFLAGS="-I${PREFIX}/include -I${PREFIX}/X11/include" LDFLAGS="-L${PREFIX}/lib -Wl,-rpath -Wl,${PREFIX}/lib -L${PREFIX}/X11/lib -Wl,-rpath -Wl,${PREFIX}/lib/X11"
157 where *$PREFIX* is where we install X.org, say */opt/xbeta*,
158 the first two exports of *ACLOCAL* and *PKG_CONFIG_PATH* occur for most X.org projects,
159 *CPPFLAGS* and *LDFLAGS* ensure that the *$PREFIX* include directories and library paths
160 are used, and *-Wl,-rpath ...* is an incantation that ensures that previous built
161 *libtool* libraries can be used.
165 *autogen.sh* script seems to build easier with
171 As of 2010-05-09, known problem with GNU m4 pkgsrc on DragonFly
173 /usr/pkg/bin/gm4: m4_esyscmd subprocess failed: Operation not permitted
174 /usr/pkg/bin/gm4:configure.ac:8: cannot run command `${MAKE-make} -s -f bin/version.mk version | tr -d '\n'': Operation not permitted
175 configure.ac:8: error: Failed to get the Mesa version from `make -f bin/version.mk version`
177 For now just manually run command
178 $ make -f bin/version.mk version
180 and substitute it using a patch similar to
182 diff --git a/configure.ac b/configure.ac
183 index c40c842..224a858 100644
186 @@ -4,7 +4,7 @@ AC_PREREQ([2.59])
188 dnl Versioning - scrape the version from configs/default
189 m4_define([mesa_version],
190 - [m4_esyscmd([${MAKE-make} -s -f bin/version.mk version | tr -d '\n'])])
192 m4_ifval(mesa_version,,
193 [m4_fatal([Failed to get the Mesa version from `make -f bin/version.mk version`])])
195 #### C99 fpclassify()
197 diff --git a/src/mesa/main/querymatrix.c b/src/mesa/main/querymatrix.c
198 index ca292aa..a0969f6 100644
199 --- a/src/mesa/main/querymatrix.c
200 +++ b/src/mesa/main/querymatrix.c
201 @@ -71,7 +71,7 @@ fpclassify(double x)
204 #elif defined(__APPLE__) || defined(__CYGWIN__) || defined(__FreeBSD__) || \
205 - (defined(__sun) && defined(__C99FEATURES__))
206 + defined(__DragonFly__) || (defined(__sun) && defined(__C99FEATURES__))
208 /* fpclassify is available. */
212 If one uses the patches alluded to in the pkgsrc section, one can avoid the following build error:
215 bison: m4 subprocess failed: Operation not permitted
216 gmake[3]: *** [parser.c] Error 1
218 Developer documentation appears to now be enabled by default; therefore, if one is bootstrapping
219 a new tree, one might want to use the option to *autogen.sh* to not build developer documentation:
221 I experienced the following build error:
224 No way to convert HTML to text found.
226 Corrected using the *autogen.sh* flag:
232 diff --git a/xinit.c b/xinit.c
233 index 313806e..0d31637 100644
236 @@ -48,6 +48,12 @@ in this Software without prior written authorization from The Open Group.
240 +/* For PRIO_PROCESS and setpriority() */
241 +#ifdef __DragonFly__
242 +#include <sys/time.h>
243 +#include <sys/resource.h>
244 +#endif /* __DragonFly__ */
250 ## Building a Separate Version of GNOME
254 See the bug report at <https://bugzilla.gnome.org/show_bug.cgi?id=618754> for an error similar to
256 /usr/libexec/binutils217/elf/ld: .libs/gthread.o: relocation R_X86_64_PC32
257 against `_g_mem_thread_init_noprivate_nomessage' can not be used when making a
258 shared object; recompile with -fPIC
259 /usr/libexec/binutils217/elf/ld: final link failed: Bad value
261 This bug is especially a problem because it may be related to some interaction with gcc 4.1.2 only on DragonFly.
263 The following patch is a complete hack:
265 diff --git a/configure.in b/configure.in
266 index 38288c3..51a1c07 100644
269 @@ -3033,7 +3033,7 @@ _______EOF
270 #define G_GNUC_INTERNAL __attribute__((visibility("hidden")))
271 #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
272 #define G_GNUC_INTERNAL __hidden
273 -#elif defined (__GNUC__) && defined (G_HAVE_GNUC_VISIBILITY)
274 +#elif defined (__GNUC__) && defined (G_HAVE_GNUC_VISIBILITY) && !defined(__DragonFly__)
275 #define G_GNUC_INTERNAL __attribute__((visibility("hidden")))
277 #define G_GNUC_INTERNAL
279 ### Graphics Image Formats
281 *libpng* <http://www.libpng.org/pub/png/libpng.html> version *1.4.2*
282 can be installed using *autogen.sh* and then *configure*, in contrast to
283 the X.org projects that pass parameters from *autogen.sh* to run *configure* automatically.
285 Independent JPEG Group's library <http://www.ijg.org/> version *8b* can be installed
286 using *configure* alone (there is no autogen.sh).
288 LibTIFF <http://www.remotesensing.org/libtiff/> has a recommended dependency on jpeg.
289 LibTIFF version 3.9.2 can be installed using *autogen.sh* and then *configure*.
293 after building any of the above three projects appears to produce passes tests.
299 *autogen.sh* calls *configure*
301 11 tests fail after *gmake check*
307 export LDFLAGS="-L${PREFIX}/lib -Wl,-rpath -Wl,${PREFIX}/lib -L${PREFIX}/lib/X11 -Wl,-rpath -Wl,${PREFIX}/lib/X11"
308 export CPPFLAGS="-I${PREFIX}/include -I${PREFIX}/X11/include"
310 When using gcc 4.1.2, *gmake check* gives:
313 ./.libs/libcairo.so: undefined reference to `__umodti3'
314 ./.libs/libcairo.so: undefined reference to `__udivti3'
316 When using *CCVER=gcc44* to force gcc 4.4, one obtains the worse:
319 cc1: error: unrecognized command line option "-Wlogical-op"
320 CHECK cairo-deprecated.h
321 cc1: error: unrecognized command line option "-Wlogical-op"
324 The problem is 128-bit division using gcc 4.1.2 as discussed earlier. One can examine
325 *src/cairo-wideint.c* and see the telltale code enclosed in an if test for *HAVE_UINT128_T*
326 with 128-bit division if defined.
330 Install *gnome-common* first, required.
332 If Cairo is not built with *CCVER=gcc44*, obtain build error similar to
335 /opt/xcatch/lib/libcairo.so: undefined reference to `__umodti3'
336 /opt/xcatch/lib/libcairo.so: undefined reference to `__udivti3'
337 gmake[3]: *** [pango-view] Error 1
339 Following patch corrects an API change not propagated to the test for *gmake check*
340 <https://bugzilla.gnome.org/show_bug.cgi?id=619456>
342 Not including patch itself because there are tabs. But edit file *pango/pangoft2.def*
344 pango_fc_font_create_metrics_for_context
346 pango_fc_font_create_base_metrics_for_context
348 ### GObject Introspection
350 *cElementTree* is changed to *ElementTree* in files
351 *giscanner/girparser.py*, *giscanner/glibtransformer.py*, and *giscanner/scannermain.py*.
353 Using *pkg_alternatives* for a python wrapper fails as a script is generated with
355 #! /usr/pkg/bin/python
360 A shell script cannot use another shell script as its interpreter.
361 What works for now is to manually create */usr/pkg/bin/python* as a symlink to */usr/pkg/bin/python2.6*.
365 *gobject-introspection* is listed as a dependency but can be avoided.
366 Use option *--disable-introspection* to avoid an error
368 checking for gobject-introspection... yes
369 ./configure: ${INTROSPECTION_GIRDIR/...}: Bad substitution