Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 89852 - x11-base/xorg-x11 Gentoo/FreeBSD compatibility
Summary: x11-base/xorg-x11 Gentoo/FreeBSD compatibility
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Gentoo X packagers
URL: https://bugs.freedesktop.org/show_bug...
Whiteboard:
Keywords:
Depends on:
Blocks: 93119 93587
  Show dependency tree
 
Reported: 2005-04-20 12:07 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2005-05-24 15:21 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
xorg-x11-6.8.99.3-ebuild.patch (xorg-x11-6.8.99.3-ebuild.patch,1.85 KB, patch)
2005-04-20 12:07 UTC, Diego Elio Pettenò (RETIRED)
Details | Diff
Updated patch (xorg-x11-6.8.99.3.patch,2.62 KB, patch)
2005-05-02 09:05 UTC, Diego Elio Pettenò (RETIRED)
Details | Diff
xorg-x11.6.8.99.3.patch (xorg-x11.6.8.99.3.patch,2.60 KB, patch)
2005-05-03 03:10 UTC, Diego Elio Pettenò (RETIRED)
Details | Diff
5901_all_4.2.99.3-acecad-debug.patch (5901_all_4.2.99.3-acecad-debug.patch,664 bytes, patch)
2005-05-05 03:06 UTC, Diego Elio Pettenò (RETIRED)
Details | Diff
xdm.pamd (xdm.pamd,208 bytes, text/plain)
2005-05-05 03:06 UTC, Diego Elio Pettenò (RETIRED)
Details
xserver.pamd (xserver.pamd,228 bytes, text/plain)
2005-05-05 03:06 UTC, Diego Elio Pettenò (RETIRED)
Details
9999_all_6.8.99.5-openpam.patch (9999_all_6.8.99.5-openpam.patch,1.02 KB, patch)
2005-05-14 18:47 UTC, Diego Elio Pettenò (RETIRED)
Details | Diff
xorg-x11-fbsd.patch (xorg-x11-fbsd.patch,2.14 KB, patch)
2005-05-24 03:04 UTC, Diego Elio Pettenò (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-20 12:07:09 UTC
The attached patch, applied over 6.8.99.3 ebuild (I choosen this as it's a development version so it could be tested with less problems), ensures that xorg-x11 is built and installed using gmake and not other makes.
This is done because if make is not gmake, also if gmake is used to launch the make process (with an alias), later it tries to use the wrong make.

It changes nothing on linux systems as they must have anyway gmake.

Hope this can be merged with main portage so only minimum changes are needed for fbsd.

Diego
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-20 12:07:39 UTC
Created attachment 56778 [details, diff]
xorg-x11-6.8.99.3-ebuild.patch
Comment 2 Donnie Berkholz (RETIRED) gentoo-dev 2005-04-20 15:43:25 UTC
Does FBSD's port use gmake for it?
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-04-20 15:56:09 UTC
No it doesn't, it uses bsd's make, that can be done passing MAKE="make", and it works.

I used gmake just becase we can have exactly the same make program on both platforms (easier to maintain) but now I see that it didn't built X binary, so tomorrow I'll try with MAKE="make" and see what happens.
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-02 09:05:37 UTC
Created attachment 57846 [details, diff]
Updated patch

This is a new patch which uses make instead of gmake (seems to be needed on
fbsd userland, I don't really know why), and blacklist one patch from the
gentoo's ones, which states that breaks compatibility and which really break
it.
I don't know what that patch is supposed to do and why we are going to add it,
but under g/fbsd can't be applied as can't be applied upstream. If upstream can
work without it maybe we can, too.
Comment 5 Donnie Berkholz (RETIRED) gentoo-dev 2005-05-02 09:45:43 UTC
+		if [[ "${KERNEL}" == "FreeBSD" ]]; then
+			echo "#define __FreeBSD__" >> ${HOSTCONF}
+			echo "#undef linux" >> ${HOSTCONF}
+		fi

I'm concerned that it's necessary to do this. Is this because the compiler isn't smart enough to figure out which kernel it's running? I also don't understand why you're undefining linux instead of __linux__.

+	# As the patch sais, that breaks non-linux systems, more exaclty
+	# it breaks non-glibc systems where open64 and loff_t doesn't exists.
+	# Exclude this until a better workaround is in place.
+	[[ "$LIBC" == "glibc" ]] || \
+		EPATCH_EXCLUDE="${EPATCH_EXCLUDE} 0700_all_4.2.0-sessreg-highuid.patch"

Please use patch_exclude(), as it's been determined to work more consistently. Also please use an if/then for this.

<bunch of MAKE="make" stuff>

Is it possible to just export this once in pkg_setup() or something?
Comment 6 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-02 10:46:03 UTC
About the define/undef, I just copied that stuff from bug #82689.

The patch, I've changed that and I'm searching becase seems there are other patches which needs to be removed on freebsd.

About the make stuff, I've tried, but it fails, it spawns up something which ignores MAKE= exported in pkg_setup or also at global level.
Comment 7 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-03 03:10:20 UTC
Created attachment 57907 [details, diff]
xorg-x11.6.8.99.3.patch

Ok updated patch. It checks both for glibc and linux systems as acecad drivers
tries to include linux/ and sys/ headers.

It also changes from root:root owner for files to root:wheel, as root group
doesn't exists on fbsd (and wheel simply do the same thing for linux).

It still doesn't work well with opengl and xv but I'm going to fix this up
later.
Hope this can be applied with next xorg version :)
Comment 8 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-03 17:11:33 UTC
As for irc-ing, we found these notes:

- Patch 5901 must drop the first chunk as it's a bogus change which blocks compilation on non-linux systems.
- Patch 0700 will create problems on non-glibc non-uclibc systems, as there loff_t and *64() patches are in place. Seems like the comment above the patch makes glibc behave, with off_t, open() and read(), exactly as other systems.
- Tomorrow I'll try without those defines (on .5 ebuild).
Comment 9 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-05 03:05:30 UTC
Ok I'm going to attach a new 5901 patch which doesn't remove the #ifdef and seems to work fine both on linux and freebsd.

I'm going to attach also pamd files which works with openpam as well as linux-pam (sys-libs/pam). Please note that these will add dependency on virtual/pam which requires >=sys-libs/pam-0.78.

There's an error in xorg sources about pam, I'm going to fix it today and post the patch here and in fd.o bugzilla.
Comment 10 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-05 03:06:13 UTC
Created attachment 58116 [details, diff]
5901_all_4.2.99.3-acecad-debug.patch
Comment 11 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-05 03:06:39 UTC
Created attachment 58117 [details]
xdm.pamd
Comment 12 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-05 03:06:54 UTC
Created attachment 58118 [details]
xserver.pamd
Comment 13 Donnie Berkholz (RETIRED) gentoo-dev 2005-05-05 08:48:53 UTC
So that also forces us to wait on pam-0.78 to go stable before we can stable xorg.  I'd like an idea of when that should happen so I know which versions this is safe to add to.
Comment 14 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-14 18:47:46 UTC
Created attachment 58923 [details, diff]
9999_all_6.8.99.5-openpam.patch

Patch for openpam support.
Comment 15 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-14 18:49:07 UTC
I really need spanky's patch for binutils to have a working xorg-x11 ebuild as plain binutils are b0rked.

I've attached the needed patch for openpam compatibility.
Comment 16 Donnie Berkholz (RETIRED) gentoo-dev 2005-05-14 19:33:52 UTC
I'll be happy to add the xorg patch once it's committed upstream.
Comment 17 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-22 08:57:37 UTC
Can you just add the 9999 patch for g/fbsd? Upstream seems not to care too   
much about it, but g/fbsd really needs it, I'll take care if there will ever 
be problems with it on g/fbsd. 
   
Also the pamd files if you can update them, they works also with pam 0.78 (and   
there was someone who wanted to try the backport for 0.77 to make the   
stabilization process faster). 
  
Martin you have a timing for 0.78 anyway? 
  
5901 is completely sane IMHO so can just be updated as it is. 
Comment 18 Donnie Berkholz (RETIRED) gentoo-dev 2005-05-22 19:44:54 UTC
I just wanted to look at the upstream bug but the URL isn't anywhere on here.
Comment 19 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-22 23:48:22 UTC
Sorry I though I already posted it. 
https://bugs.freedesktop.org/show_bug.cgi?id=3219 there it is :) 
Comment 20 Donnie Berkholz (RETIRED) gentoo-dev 2005-05-22 23:54:30 UTC
I'll see if I can find anholt on IRC and ask him about it.
Comment 21 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-24 03:01:53 UTC
I've just started building 6.8.99.8 without pam support (thinking if that's 
the problem I had with xorg launched as user, maybe the openpam patch is 
incomplete). 
 
If you can fix in the mean time the 5901 patch we can care of one thing less. 
 
Comment 22 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-24 03:04:31 UTC
Created attachment 59687 [details, diff]
xorg-x11-fbsd.patch

That's the updated patch for xorg-x11 ebuild anyway.
Comment 23 Donnie Berkholz (RETIRED) gentoo-dev 2005-05-24 10:07:42 UTC
Possible. I see in xc/programs/Xserver/os/utils.c:

/*
 * CheckUserAuthorization: check if the user is allowed to start the
 * X server.  This usually means some sort of PAM checking, and it is
 * usually only done for setuid servers (uid != euid).
 */

etc.
Comment 24 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-24 10:22:04 UTC
Yes it seems to be that, built with -pam works fine. 
I'll find a better patch; in the mean time maybe you can disable pam when 
sys-libs/pam is not installed, or when sys-libs/openpam is installed? 
Comment 25 Donnie Berkholz (RETIRED) gentoo-dev 2005-05-24 10:43:33 UTC
That's what the USE flag is for.
Comment 26 Donnie Berkholz (RETIRED) gentoo-dev 2005-05-24 12:37:52 UTC
Committed the ebuild patch and 5901 to 6.8.2-r2 and 6.8.99.8.
Comment 27 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-24 15:06:27 UTC
This one can be considered fixed: xorg-x11 builds fine now, the only remaining 
change is the pam one, but that will require a few more changes, so for now, 
just close that. 
FreeBSD builds without pam, we can do that, too, until we have a working 
version maybe upstream. 
 
I'll open a new bug when pam will work fine :) 
 
Thanks again. 
Comment 28 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-24 15:06:41 UTC
This one can be considered fixed: xorg-x11 builds fine now, the only remaining 
change is the pam one, but that will require a few more changes, so for now, 
just close that. 
FreeBSD builds without pam, we can do that, too, until we have a working 
version maybe upstream. 
 
I'll open a new bug when pam will work fine :) 
 
Thanks again. 
Comment 29 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-05-24 15:21:44 UTC
wth happened?