cmake-utils.eclass: Drop remaining support for <cmake-3.4.0_rc1
[gentoo.git] / eclass / xorg-2.eclass
index 437265a9eaa81b4bb380be487c29e6385fb87ff6..4ed65e676a01343a1b322e80edba795c3212d4b7 100644 (file)
@@ -1,6 +1,5 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Id$
 
 # @ECLASS: xorg-2.eclass
 # @MAINTAINER:
@@ -8,6 +7,7 @@
 # @AUTHOR:
 # Author: Tomáš Chvátal <scarabeus@gentoo.org>
 # Author: Donnie Berkholz <dberkholz@gentoo.org>
+# @SUPPORTED_EAPIS: 3 4 5
 # @BLURB: Reduces code duplication in the modularized X11 ebuilds.
 # @DESCRIPTION:
 # This eclass makes trivial X ebuilds possible for apps, fonts, drivers,
@@ -61,7 +61,7 @@ esac
 EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
 
 IUSE=""
-HOMEPAGE="http://xorg.freedesktop.org/"
+HOMEPAGE="https://www.x.org/wiki/ https://cgit.freedesktop.org/"
 
 # @ECLASS-VARIABLE: XORG_EAUTORECONF
 # @DESCRIPTION:
@@ -73,7 +73,7 @@ HOMEPAGE="http://xorg.freedesktop.org/"
 # @DESCRIPTION:
 # Set up SRC_URI for individual modular releases. If set to an empty
 # string, no SRC_URI will be provided by the eclass.
-: ${XORG_BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual"}
+: ${XORG_BASE_INDIVIDUAL_URI="https://www.x.org/releases/individual"}
 
 # @ECLASS-VARIABLE: XORG_MODULE
 # @DESCRIPTION:
@@ -88,7 +88,6 @@ if [[ -z ${XORG_MODULE} ]]; then
                x11-misc|x11-themes) XORG_MODULE=util/    ;;
                x11-base)            XORG_MODULE=xserver/ ;;
                x11-drivers)         XORG_MODULE=driver/  ;;
-               x11-proto)           XORG_MODULE=proto/   ;;
                x11-libs)            XORG_MODULE=lib/     ;;
                *)                   XORG_MODULE=         ;;
        esac
@@ -101,7 +100,7 @@ fi
 : ${XORG_PACKAGE_NAME:=${PN}}
 
 if [[ -n ${GIT_ECLASS} ]]; then
-       : ${EGIT_REPO_URI:="git://anongit.freedesktop.org/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME} http://anongit.freedesktop.org/git/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME}"}
+       : ${EGIT_REPO_URI:="https://anongit.freedesktop.org/git/xorg/${XORG_MODULE}${XORG_PACKAGE_NAME}.git"}
 elif [[ -n ${XORG_BASE_INDIVIDUAL_URI} ]]; then
        SRC_URI="${XORG_BASE_INDIVIDUAL_URI}/${XORG_MODULE}${P}.tar.bz2"
 fi
@@ -115,7 +114,7 @@ fi
 
 # Set up autotools shared dependencies
 # Remember that all versions here MUST be stable
-XORG_EAUTORECONF_ARCHES="x86-interix ppc-aix x86-winnt"
+XORG_EAUTORECONF_ARCHES="ppc-aix x86-winnt"
 EAUTORECONF_DEPEND+="
        >=sys-devel/libtool-2.2.6a
        sys-devel/m4"
@@ -158,7 +157,7 @@ if [[ ${FONT} == yes ]]; then
        # Set up configure options, wrapped so ebuilds can override if need be
        [[ -z ${FONT_OPTIONS} ]] && FONT_OPTIONS="--with-fontdir=\"${EPREFIX}/usr/share/fonts/${FONT_DIR}\""
 
-       [[ ${PN##*-} = misc || ${PN##*-} = 75dpi || ${PN##*-} = 100dpi || ${PN##*-} = cyrillic ]] && IUSE+=" nls"
+       [[ ${PN} = font-misc-misc || ${PN} = font-schumacher-misc || ${PN##*-} = 75dpi || ${PN##*-} = 100dpi || ${PN##*-} = cyrillic ]] && IUSE+=" nls"
 fi
 
 # If we're a driver package, then enable DRIVER case
@@ -176,7 +175,6 @@ if [[ ${XORG_STATIC} == yes \
                && ${FONT} != yes \
                && ${CATEGORY} != app-doc \
                && ${CATEGORY} != x11-apps \
-               && ${CATEGORY} != x11-proto \
                && ${CATEGORY} != x11-drivers \
                && ${CATEGORY} != media-fonts \
                && ${PN} != util-macros \
@@ -200,26 +198,18 @@ DRI_COMMON_DEPEND="
        x11-base/xorg-server[-minimal]
        x11-libs/libdrm
 "
-DRI_DEPEND="
-       x11-proto/xf86driproto
-       x11-proto/glproto
-       x11-proto/dri2proto
-"
 case ${XORG_DRI} in
        no)
                ;;
        always)
                COMMON_DEPEND+=" ${DRI_COMMON_DEPEND}"
-               DEPEND+=" ${DRI_DEPEND}"
                ;;
        *)
                COMMON_DEPEND+=" ${XORG_DRI}? ( ${DRI_COMMON_DEPEND} )"
-               DEPEND+=" ${XORG_DRI}? ( ${DRI_DEPEND} )"
                IUSE+=" ${XORG_DRI}"
                ;;
 esac
-unset DRI_DEPEND
-unset DRI_COMMONDEPEND
+unset DRI_COMMON_DEPEND
 
 if [[ -n "${DRIVER}" ]]; then
        COMMON_DEPEND+="
@@ -227,26 +217,13 @@ if [[ -n "${DRIVER}" ]]; then
        "
 fi
 if [[ -n "${DRIVER}" && ${PN} == xf86-input-* ]]; then
-       DEPEND+="
-               x11-proto/inputproto
-               x11-proto/kbproto
-               x11-proto/xproto
-       "
+       DEPEND+=" x11-base/xorg-proto"
 fi
 if [[ -n "${DRIVER}" && ${PN} == xf86-video-* ]]; then
        COMMON_DEPEND+="
                x11-libs/libpciaccess
        "
-       # we also needs some protos and libs in all cases
-       DEPEND+="
-               x11-proto/fontsproto
-               x11-proto/randrproto
-               x11-proto/renderproto
-               x11-proto/videoproto
-               x11-proto/xextproto
-               x11-proto/xineramaproto
-               x11-proto/xproto
-       "
+       DEPEND+=" x11-base/xorg-proto"
 fi
 
 # @ECLASS-VARIABLE: XORG_DOC
@@ -306,10 +283,6 @@ DEPEND+=" ${COMMON_DEPEND}"
 RDEPEND+=" ${COMMON_DEPEND}"
 unset COMMON_DEPEND
 
-if [[ ${XORG_MULTILIB} == yes ]]; then
-       RDEPEND+=" abi_x86_32? ( !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)] )"
-fi
-
 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND=${DEPEND}"
 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND=${RDEPEND}"
 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: PDEPEND=${PDEPEND}"
@@ -359,7 +332,7 @@ xorg-2_reconf_source() {
        debug-print-function ${FUNCNAME} "$@"
 
        case ${CHOST} in
-               *-interix* | *-aix* | *-winnt*)
+               *-aix* | *-winnt*)
                        # some hosts need full eautoreconf
                        [[ -e "./configure.ac" || -e "./configure.in" ]] \
                                && AUTOTOOLS_AUTORECONF=1
@@ -392,7 +365,8 @@ xorg-2_font_configure() {
        if has nls ${IUSE//+} && ! use nls; then
                if grep -q -s "disable-all-encodings" ${ECONF_SOURCE:-.}/configure; then
                        FONT_OPTIONS+="
-                               --disable-all-encodings"
+                               --disable-all-encodings
+                               --enable-iso8859-1"
                else
                        FONT_OPTIONS+="
                                --disable-iso8859-2
@@ -468,8 +442,14 @@ xorg-2_src_configure() {
                local dep_track="--disable-dependency-tracking"
        fi
 
+       # Check if package supports disabling of selective -Werror=...
+       if grep -q -s "disable-selective-werror" ${ECONF_SOURCE:-.}/configure; then
+               local selective_werror="--disable-selective-werror"
+       fi
+
        local myeconfargs=(
                ${dep_track}
+               ${selective_werror}
                ${FONT_OPTIONS}
                "${xorgconfadd[@]}"
        )
@@ -503,12 +483,6 @@ xorg-2_src_install() {
 
        local install_args=( docdir="${EPREFIX}/usr/share/doc/${PF}" )
 
-       if [[ ${CATEGORY} == x11-proto ]]; then
-               install_args+=(
-                       ${PN/proto/}docdir="${EPREFIX}/usr/share/doc/${PF}"
-               )
-       fi
-
        if [[ ${XORG_MULTILIB} == yes ]]; then
                autotools-multilib_src_install "${install_args[@]}"
        else
@@ -542,6 +516,8 @@ xorg-2_pkg_postinst() {
                create_fonts_scale
                create_fonts_dir
                font_pkg_postinst "$@"
+
+               ewarn "Installed fonts changed. Run 'xset fp rehash' if you are using non-fontconfig applications."
        fi
 }