Changeset View
Standalone View
Mk/Uses/xorg-cat.mk
- This file was added.
# $FreeBSD$ | |||||
# | |||||
# xorg ports categories and other things needed to build xorg ports. | |||||
# This is intended only for ports of xorg and freedesktop.org applications. | |||||
# | |||||
# Use USES=xorg and USE_XORG to depend on various xorg components. | |||||
# | |||||
tobik: "Use USES=xorg and USE_XORG to depend ..." | |||||
# Feature: xorg-cat | |||||
# Usage: USES=xorg-cat:category[,buildsystem] | |||||
# | |||||
# category is one of: | |||||
# * app Installs applications, no shared libraries. | |||||
# * data Installs only data. | |||||
# * doc no particular notes | |||||
# * driver depends on xorgproto at least | |||||
# * font don't install .pc file | |||||
# * lib various dependencies, install .pc file, needs | |||||
# pathfix | |||||
# * proto install .pc file, needs pathfix, most only needed at | |||||
# build time. | |||||
# * util no particular notes | |||||
# * xserver xorg x servers | |||||
# | |||||
# These categories has to match upstream categories. Don't invent | |||||
# your own. | |||||
# | |||||
# builsystem is one of: | |||||
# * autotools (default) | |||||
# * meson (experimental) | |||||
# | |||||
# | |||||
# By defining USE_GITLAB and GL_COMMIT, it is possible to pull code straight | |||||
# from the freedesktop.org gitlab, instead of official release tarballs. | |||||
Done Inline ActionsTypo straight not straigt tobik: Typo `straight` not `straigt` | |||||
# | |||||
#.MAINTAINER: x11@FreeBSD.org | |||||
.if !defined(_INCLUDE_USES_XORG_CAT_MK) | |||||
_INCLUDE_USES_XORG_CAT_MK=yes | |||||
_XORG_CATEGORIES= app data doc driver font lib proto util xserver | |||||
_XORG_BUILDSYSTEMS= autotools meson | |||||
_XORG_CAT= # empty | |||||
_XORG_BUILDSYS= # empty | |||||
. if empty(xorg-cat_ARGS) | |||||
IGNORE= no arguments specified to xorg-cat | |||||
. endif | |||||
Done Inline ActionsUSES=xorg-cat not xorg_cat tobik: `USES=xorg-cat` not `xorg_cat` | |||||
Done Inline ActionsOops. And the joy of copy-pasting means it is everywhere. :) zeising: Oops. And the joy of copy-pasting means it is everywhere. :) | |||||
. for _arg in ${xorg-cat_ARGS} | |||||
. if ${_XORG_CATEGORIES:M${_arg}} | |||||
. if empty(_XORG_CAT) | |||||
_XORG_CAT= ${_arg} | |||||
. else | |||||
IGNORE= multipe xorg categories specified via xorg-cat:${xorg-cat_ARGS:ts,} | |||||
. endif | |||||
Done Inline ActionsSame as above. ${xorg-cat_ARGS:ts,} would be simpler than ${xorg-cat_ARGS:S/ /,/gW} tobik: Same as above.
`${xorg-cat_ARGS:ts,}` would be simpler than `${xorg-cat_ARGS:S/ /,/gW}` | |||||
Done Inline ActionsThank you, didn't know it was possible to do it that way. zeising: Thank you, didn't know it was possible to do it that way. | |||||
. elif ${_XORG_BUILDSYSTEMS:M${_arg}} | |||||
. if empty(_XORG_BUILDSYS) | |||||
_XORG_BUILDSYS= ${_arg} | |||||
. else | |||||
IGNORE= multipe xorg build systems specified via xorg-cat:${xorg-cat_ARGS:ts,} | |||||
. endif | |||||
Done Inline ActionsSame. tobik: Same. | |||||
. else | |||||
IGNORE= unknown argument specified via xorg-cat:${xorg-cat_ARGS:ts,} | |||||
. endif | |||||
Done Inline ActionsSame. tobik: Same. | |||||
. endfor | |||||
# Default to the autotools build system | |||||
. if empty(_XORG_BUILDSYS) | |||||
_XORG_BUILDSYS= autotools | |||||
. endif | |||||
# Default variables, common to all new modular xorg ports. | |||||
. if empty(USES:Mtar) | |||||
EXTRACT_SUFX?= .tar.bz2 | |||||
. endif | |||||
DIST_SUBDIR= xorg/${_XORG_CAT} | |||||
. if ${_XORG_BUILDSYS} == meson | |||||
IGNORE= meson build not supported yet | |||||
.include "${USESDIR}/meson.mk" | |||||
. elif ${_XORG_BUILDSYS} == autotools | |||||
GNU_CONFIGURE= yes | |||||
. else | |||||
# This should not happen | |||||
IGNORE= unknown build system specified via xorg-cat:${xorg-cat_ARGS:ts,} | |||||
. endif | |||||
. if defined(USE_GITLAB) | |||||
# Set up things for fetching from freedesktop.org gitlab. | |||||
# This can be overridden using normal GL_* macros in the ports Makefile. | |||||
# We make a best guess for GL_ACCOUNT and GL_PROJECT. | |||||
GL_SITE?= https://gitlab.freedesktop.org/xorg | |||||
GL_ACCOUNT?= ${_XORG_CAT} | |||||
Done Inline ActionsI am not sure this is correct, it should probably be: GL_SITE?= https://gitlab.freedesktop.org/xorg GL_ACCOUNT?= ${_XORG_CAT} mat: I am not sure this is correct, it should probably be:
```
GL_SITE?= https… | |||||
Done Inline ActionsYeah, that is better, at least from the way we handle DIST_SUBDIR. zeising: Yeah, that is better, at least from the way we handle DIST_SUBDIR.
Interestingly enough, there… | |||||
GL_PROJECT?= ${PORTNAME:tl} | |||||
. if ${_XORG_BUILDSYS} == meson | |||||
# set up meson stuff here | |||||
Done Inline ActionsYou should probably add a IGNORE="not supported yet" or something so that it is clear. mat: You should probably add a `IGNORE="not supported yet"` or something so that it is clear. | |||||
. else | |||||
# Things from GL doesn't come with pre-generated configure, add dependency on | |||||
# autoreconf and run it, if we're using autotools. | |||||
.include "${USESDIR}/autoreconf.mk" | |||||
. endif | |||||
. else | |||||
MASTER_SITES?= XORG/individual/${_XORG_CAT} | |||||
. endif | |||||
Done Inline ActionsPlease, do not add more MASTER_SITE_SUBDIR, it should be: MASTER_SITES?= XORG/individual/${_XORG_CAT} mat: Please, do not add more `MASTER_SITE_SUBDIR`, it should be:
```
MASTER_SITES?=… | |||||
Done Inline ActionsThis was copied from the original bsd.xorg.mk, I've changed it. zeising: This was copied from the original bsd.xorg.mk, I've changed it. | |||||
# | |||||
## All xorg ports needs pkgconfig to build, but some ports look for pkgconfig | |||||
## and then continues the build. | |||||
Done Inline ActionsThis should go earlier, before the inclusion of autoreconf.mk, you would not need to patch autoreconf then. mat: This should go earlier, before the inclusion of autoreconf.mk, you would not need to patch… | |||||
Done Inline ActionsThis does not work. The variable should move earlier, but ports with USES=autoreconf and libtool from xorg-cat.mk still fail. zeising: This does not work. The variable should move earlier, but ports with USES=autoreconf and… | |||||
Done Inline ActionsWell, as it is handled by xorg-cat, simply remove autoreconf from those ports. No? Seems easier to fix a few ports with this than try to force a shoe in the framework because of them. And add a DEV_WARNING if a port sets USES=autoreconf xorg-cat telling them how to do it properly. mat: Well, as it is handled by xorg-cat, simply remove autoreconf from those ports. No? Seems… | |||||
Done Inline ActionsBut what is the right way? Ports having USES=autoreconf needs to set USES=libtool as needed, even if it's normally in the framework? Isn't it better to solve the ordering issue in the framework itself? I also realized that setting lbtool_ARGS can't be done in cases where Uses/libtool.mk isn't needed. Ports might require autoreconf without needing libtoolize, and setting libtool_ARGS unconditionally would always pull in libtoolize in the autoreconf case. This can probably be fixed in xorg-cat.mk by doing the USE_GITLAB preparation at the end of the file. zeising: But what is the right way? Ports having USES=autoreconf needs to set USES=libtool as needed… | |||||
Done Inline Actionslibtool_ARGS needs to be defined right before you include Uses/libtool.mk and only if you include Uses/libtool.mk. That way you essentially replicate the way USES works. tijl: libtool_ARGS needs to be defined right before you include Uses/libtool.mk and only if you… | |||||
.include "${USESDIR}/pkgconfig.mk" | |||||
# | |||||
## All xorg ports needs xorg-macros. | |||||
. if ${PORTNAME} != xorg-macros | |||||
USE_XORG+= xorg-macros | |||||
. endif | |||||
. if ${_XORG_CAT} == app | |||||
# Nothing at the moment | |||||
. elif ${_XORG_CAT} == data | |||||
# Nothing at the moment. | |||||
. elif ${_XORG_CAT} == driver | |||||
USE_XORG+= xi xorg-server xorgproto | |||||
. if ${_XORG_BUILDSYS} == meson | |||||
# Put special stuff for meson here | |||||
. else | |||||
CONFIGURE_ENV+= DRIVER_MAN_SUFFIX=4x DRIVER_MAN_DIR='$$(mandir)/man4' | |||||
libtool_ARGS?= # empty | |||||
Done Inline ActionsThis should probably be a long .if / .elif / elif / ... as if the first is true, the next ones will not be. mat: This should probably be a long `.if / .elif / elif / ...` as if the first is true, the next… | |||||
Done Inline ActionsThe style was copied from how it was in bsd.xorg.mk. I'll change it to an if/elif/.../else/endif style. I've tried to keep some white space around, to make it easier to see which block belongs to which _xorg_cat. I know this isn't 100% style, but I think it makes it more readable. zeising: The style was copied from how it was in bsd.xorg.mk. I'll change it to an if/elif/... | |||||
.include "${USESDIR}/libtool.mk" | |||||
INSTALL_TARGET= install-strip | |||||
. endif | |||||
. elif ${_XORG_CAT} == font | |||||
FONTNAME?= ${PORTNAME:C/.*-//g:S/type/Type/:S/ttf/TTF/:S/speedo/Speedo/} | |||||
. if ${_XORG_BUILDSYS} == meson | |||||
# Put special stuff for meson here | |||||
. else | |||||
CONFIGURE_ARGS+= --with-fontrootdir=${PREFIX}/share/fonts | |||||
CONFIGURE_ENV+= FONTROOTDIR=${PREFIX}/share/fonts | |||||
. endif | |||||
. if !defined(NOFONT) | |||||
.include "${USESDIR}/fonts.mk" | |||||
BUILD_DEPENDS+= mkfontscale>=0:x11-fonts/mkfontscale \ | |||||
bdftopcf:x11-fonts/bdftopcf | |||||
PLIST_FILES+= "@comment ${FONTSDIR}/fonts.dir" \ | |||||
"@comment ${FONTSDIR}/fonts.scale" | |||||
. endif | |||||
. elif ${_XORG_CAT} == lib | |||||
.include "${USESDIR}/pathfix.mk" | |||||
. if ${_XORG_BUILDSYS} == meson | |||||
# put meson stuff here | |||||
. else | |||||
libtool_ARGS?= # empty | |||||
.include "${USESDIR}/libtool.mk" | |||||
USE_LDCONFIG= yes | |||||
CONFIGURE_ARGS+=--enable-malloc0returnsnull | |||||
. endif | |||||
. elif ${_XORG_CAT} == proto | |||||
.include "${USESDIR}/pathfix.mk" | |||||
. elif ${_XORG_CAT} == xserver | |||||
DISTNAME?= xorg-server-${PORTVERSION} | |||||
.include "${USESDIR}/pathfix.mk" | |||||
. if ${_XORG_BUILDSYS} == meson | |||||
# put meson stuff here | |||||
Done Inline ActionsRemove WRKSRC, it is at its default value. mat: Remove WRKSRC, it is at its default value. | |||||
. else | |||||
CONFIGURE_ARGS+= --with-xkb-path=${LOCALBASE}/share/X11/xkb \ | |||||
--with-fontrootdir=${LOCALBASE}/share/fonts | |||||
. endif | |||||
LIB_PC_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/dri.pc:graphics/mesa-dri | |||||
USE_XORG+= fontutil | |||||
Done Inline ActionsThis should probably only set DISTNAME?=xorg-server-${PORTVERSION} as the .tar.bz2 is already taken care of earlier, and both variables depend on DISTNAME being correct. mat: This should probably only set `DISTNAME?=xorg-server-${PORTVERSION}` as the `.tar.bz2` is… | |||||
. endif # ${_XORG_CAT} == <category> | |||||
# We onlu need USES=xorg if we want USE_XORG modules | |||||
. if defined(USE_XORG) && !empty(USE_XORG) | |||||
.include "${USESDIR}/xorg.mk" | |||||
. endif | |||||
.endif |
"Use USES=xorg and USE_XORG to depend ..."