[gentoo-dev] [RFC] New eclass for x11 packages

2010-02-18 Thread Tomáš Chvátal
Hi,
we prepared new eclass for x11 packages that should be used as
replacement for x-modular.eclass.

After long discussion with others on irc we choose to name it as
xorg-2.eclass.

Whats new/changed:

1 removed function call (pkg_preinst iirc) and 1 new added pkg_setup.

Requires eapi3 or any later when added, so wont work with eapi 012.

Removed most code that kept backcompat up to old mono xorg :]

Added static-libs useflag hopefully everywhere where usefull.

Fonts handling slightly rewritten to be done as written in specs (or i
hope i did so :]).

Removed weird debug useflag handling which just altered C/XX/FLAGS.

Prefix support done.

Its used everywhere in x11 overlay and you can see it also as attachment
to this mail.

Please help us to find issues we might miss, before inclusion. Which
will happen in 14 days since today (4.3. 2010) if nothing major will be
found.

Cheers


Tomáš Chvátal
Gentoo Linux Developer [Council/KDE/Overlays/QA/X11]
E-Mail  : scarab...@gentoo.org
GnuPG FP: 94A4 5CCD 85D3 DE24 FE99 F924 1C1E 9CDE 0341 4587
GnuPG ID: 03414587
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
# @ECLASS: xorg-2.eclass
# @MAINTAINER:
# x...@gentoo.org

# Author: Tomáš Chvátal scarab...@gentoo.org
# Author: Donnie Berkholz dberkh...@gentoo.org
# @BLURB: Reduces code duplication in the modularized X11 ebuilds.
# @DESCRIPTION:
# This eclass makes trivial X ebuilds possible for apps, fonts, drivers,
# and more. Many things that would normally be done in various functions
# can be accessed by setting variables instead, such as patching,
# running eautoreconf, passing options to configure and installing docs.
#
# All you need to do in a basic ebuild is inherit this eclass and set
# DESCRIPTION, KEYWORDS and RDEPEND/DEPEND. If your package is hosted
# with the other X packages, you don't need to set SRC_URI. Pretty much
# everything else should be automatic.

GIT_ECLASS=
if [[ ${PV} == ** ]]; then
GIT_ECLASS=git
SNAPSHOT=yes
SRC_URI=
fi

# If we're a font package, but not the font.alias one
FONT_ECLASS=
if [[ ${PN} == font* \
 ${CATEGORY} = media-fonts \
 ${PN} != font-alias \
 ${PN} != font-util ]]; then
# Activate font code in the rest of the eclass
FONT=yes
FONT_ECLASS=font
fi

inherit eutils base libtool multilib toolchain-funcs flag-o-matic autotools \
${FONT_ECLASS} ${GIT_ECLASS}

EXPORTED_FUNCTIONS=src_unpack src_compile src_install pkg_postinst pkg_postrm
case ${EAPI:-0} in
3) EXPORTED_FUNCTIONS=${EXPORTED_FUNCTIONS} src_prepare src_configure 
;;
*) DEPEND=EAPI-UNSUPPORTED ;;
esac

# exports must be ALWAYS after inherit
EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}

# @ECLASS-VARIABLE: XDIR
# @DESCRIPTION:
# Directory prefix to use for everything. If you want to install to a
# non-default prefix (e.g., /opt/xorg), change XDIR. This has not been
# recently tested. You may need to uncomment the setting of datadir and
# mandir in xorg-2_src_install() or add it back in if it's no longer
# there. You may also want to change the SLOT.
: ${XDIR:=/usr}

IUSE=
HOMEPAGE=http://xorg.freedesktop.org/;

# @ECLASS-VARIABLE: SNAPSHOT
# @DESCRIPTION:
# If set to 'yes' and configure.ac exists, eautoreconf will run. Set
# before inheriting this eclass.
: ${SNAPSHOT:=no}

# Set up SRC_URI for individual modular releases
BASE_INDIVIDUAL_URI=http://xorg.freedesktop.org/releases/individual;
# @ECLASS-VARIABLE: MODULE
# @DESCRIPTION:
# The subdirectory to download source from. Possible settings are app,
# doc, data, util, driver, font, lib, proto, xserver. Set above the
# inherit to override the default autoconfigured module.
if [[ -z ${MODULE} ]]; then
MODULE=
case ${CATEGORY} in
app-doc) MODULE=doc ;;
media-fonts) MODULE=font;;
x11-apps|x11-wm) MODULE=app ;;
x11-misc|x11-themes) MODULE=util;;
x11-drivers) MODULE=driver  ;;
x11-base)MODULE=xserver ;;
x11-proto)   MODULE=proto   ;;
x11-libs)MODULE=lib ;;
esac
fi

if [[ -n ${GIT_ECLASS} ]]; then
EGIT_REPO_URI=git://anongit.freedesktop.org/git/xorg/${MODULE}/${PN}
else
SRC_URI+= ${BASE_INDIVIDUAL_URI}/${MODULE}/${P}.tar.bz2
fi

: ${SLOT:=0}

# Set the license for the package. This can be overridden by setting
# LICENSE after the inherit. Nearly all FreeDesktop-hosted X packages
# are under the MIT license. (This is what Red Hat does in their rpms)
: ${LICENSE=MIT}

# Set up shared dependencies
if [[ ${SNAPSHOT} != no ]]; then
DEPEND+=
=sys-devel/libtool-2.2.6a
sys-devel/m4
# These 2 versions MUST BE STABLE
[[ ${PN} == util-macros ]] || DEPEND+= 

Re: [gentoo-dev] [RFC] New eclass for x11 packages

2010-02-18 Thread Jeremy Olexa

On Thu, 18 Feb 2010 23:33:42 +0100, Tomáš Chvátal scarab...@gentoo.org
wrote:
 Requires eapi3 or any later when added, so wont work with eapi 012.

Hey, can you explain why you choose to do this and what benefit there is
to doing so? Thanks.
-Jeremy



Re: [gentoo-dev] [RFC] New eclass for x11 packages

2010-02-18 Thread Tomáš Chvátal
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dne 18.2.2010 23:39, Jeremy Olexa napsal(a):
 
 On Thu, 18 Feb 2010 23:33:42 +0100, Tomáš Chvátal scarab...@gentoo.org
 wrote:
 Requires eapi3 or any later when added, so wont work with eapi 012.
 
 Hey, can you explain why you choose to do this and what benefit there is
 to doing so? Thanks.
 -Jeremy
 
Only one: no need for backcompat and limit the subset of eapis we have
to bother with.

Tom
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkt9x2gACgkQHB6c3gNBRYc0IwCglQY66MwCOCVmjJHOofzmt1cQ
DaoAn0EhAWL05AoOQE6oKA+ZMQvPY5lR
=2G6w
-END PGP SIGNATURE-



Re: [gentoo-dev] [RFC] New eclass for x11 packages

2010-02-18 Thread David Leverton
On Thursday 18 February 2010 22:33:42 Tomáš Chvátal wrote:
   [[ ${PN} == util-macros ]] || DEPEND+= =x11-misc/util-macros-1.3.0
   [[ ${PN} == font-util ]] || DEPEND+= =media-fonts/font-util-1.1.1-r1

Do non-fonts really need font-util there?  Looks like that sets up a nice 
circular dependency.

   [[ -e ./configure.ac ]]  eautoreconf || ewarn 
 Unable to autoreconf 
the configure script. Things may fail.

That'll ewarn if configure.ac doesn't exist at all.  Doesn't eautoreconf die 
anyway if it fails, and if not, is it a good idea for failures to only give a 
warning?



Re: [gentoo-dev] [RFC] New eclass for x11 packages

2010-02-18 Thread Tomáš Chvátal
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dne 19.2.2010 00:11, David Leverton napsal(a):
 On Thursday 18 February 2010 22:33:42 Tomáš Chvátal wrote:
  [[ ${PN} == util-macros ]] || DEPEND+= =x11-misc/util-macros-1.3.0
  [[ ${PN} == font-util ]] || DEPEND+= =media-fonts/font-util-1.1.1-r1
 
 Do non-fonts really need font-util there?  Looks like that sets up a nice 
 circular dependency.
The same dep is in x-modular eclass. I spoted it in some fonts packages
as required so i left it there.
Good work/idea would be if someone doublecheck that one :]

 
  [[ -e ./configure.ac ]]  eautoreconf || ewarn 
 Unable to autoreconf 
 the configure script. Things may fail.
 
 That'll ewarn if configure.ac doesn't exist at all.  Doesn't eautoreconf die 
 anyway if it fails, and if not, is it a good idea for failures to only give a 
 warning?
 
That || die is not for eautoreconf

[[ -e something ]]  somethingexists || somethingisnotexisting

For your behaviour it would have to look like this

[[ -e something ]]  { somethingexists || die if the commands failed ; }

Tomas
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkt9ymYACgkQHB6c3gNBRYe5kQCgjpAgHUl7icElBtdAUHTcfPOI
wjkAn1CFH/9VxaO9IBnNMlVpLQT60JX+
=+A3h
-END PGP SIGNATURE-



Re: [gentoo-dev] [RFC] New eclass for x11 packages

2010-02-18 Thread Tomáš Chvátal
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

  [[ -e ./configure.ac ]]  eautoreconf || ewarn 
 Unable to autoreconf 
 the configure script. Things may fail.
 
 That'll ewarn if configure.ac doesn't exist at all.  Doesn't eautoreconf die 
 anyway if it fails, and if not, is it a good idea for failures to only give 
 a 
 warning?
 
 That || die is not for eautoreconf
 
 [[ -e something ]]  somethingexists || somethingisnotexisting
 
 For your behaviour it would have to look like this
 
 [[ -e something ]]  { somethingexists || die if the commands failed ; }
 
Mea culpa,
now I see you ask if I should not die if that configure.ac is not found.
Well the issue is that things Might fail, not 100% fail :] and it is for
prefix only so we can update behaviour for it later to be more strict.

Tomas
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkt9y1EACgkQHB6c3gNBRYdkqQCgpCsvS1tJQbeP7sZaxP9xNn1m
ogsAoIrPbn8ilxnTd5oXT77lSXsju0g4
=4/mJ
-END PGP SIGNATURE-



Re: [gentoo-dev] [RFC] New eclass for x11 packages

2010-02-18 Thread David Leverton
On Thursday 18 February 2010 23:16:54 Tomáš Chvátal wrote:
 That || die is not for eautoreconf

 [[ -e something ]]  somethingexists || somethingisnotexisting

 For your behaviour it would have to look like this

 [[ -e something ]]  { somethingexists || die if the commands failed ; }

Do you mean that it's /supposed/ to ewarn if configure.ac doesn't exist?  Do 
you expect that to happen for X.org packages that have a configure script at 
all?  (Which IIRC is all of them; if there are any that don't have a 
configure, there's obviously no reason to worry about not being able to 
rebuild it.)



[gentoo-dev] Re: [RFC] New eclass for x11 packages

2010-02-18 Thread Ryan Hill
On Thu, 18 Feb 2010 23:33:42 +0100
Tomáš Chvátal scarab...@gentoo.org wrote:

 Hi,
 we prepared new eclass for x11 packages that should be used as
 replacement for x-modular.eclass.
 
 After long discussion with others on irc we choose to name it as
 xorg-2.eclass.
 
 Whats new/changed:

 Fonts handling slightly rewritten to be done as written in specs (or i
 hope i did so :]).

It'd be nice to move all of the fonts stuff to font.eclass.  Right now we
have two similar-but-not-quite font systems that tend to do the same thing
but drift apart sometimes in incompatible ways.

But I know I don't have time to do it and it seems to work well enough right 
now, so
meh. ;)

 [[ ${PN} == util-macros ]] || DEPEND+= =x11-misc/util-macros-1.3.0
 [[ ${PN} == font-util ]] || DEPEND+= =media-fonts/font-util-1.1.1-r1 
  
 
 Do non-fonts really need font-util there?  Looks like that sets up a nice 
 circular dependency.  
The same dep is in x-modular eclass. I spoted it in some fonts packages
as required so i left it there.
Good work/idea would be if someone doublecheck that one :]

Hmm, I don't see it in x-modular.  It shouldn't be required for non-fonts
unless something in git needs it for some wacky reason.


  remove_font_metadata() {
  if [[ ${FONT_DIR} != Speedo  ${FONT_DIR} != CID ]]; then
  einfo Removing font metadata
  rm -rf 
${ED}/usr/share/fonts/${FONT_DIR}/fonts.{scale,dir,cache-1}
  fi
  }

Sorry, I forgot I was going to follow up on this..  FONT_DIR is a
space-separated list of directories.  The only example of a font with
multiple directories I know of is font-misc-ethiopic.  In that case, the
command run here would be:

  rm -rf /usr/share/fonts/TTF OTF/fonts.{scale,dir,cache-1}

:/

cleanup_fonts(), create_fonts_scale(), and create_fonts_dir() are similarly
broken with multiple directories.


  create_fonts_scale() {
  if [[ ${DIR} != Speedo  ${DIR} != CID ]]; then

I think you mean ${FONT_DIR} here.  

Honestly, you might consider dropping TTF from font-misc-ethiopic and only
install the OTF version.  It would simplify things greatly.


-- 
fonts,by design, by neglect
gcc-porting,  for a fact or just for effect
wxwidgets @ gentoo EFFD 380E 047A 4B51 D2BD C64F 8AA8 8346 F9A4 0662


signature.asc
Description: PGP signature