# $Id$ # xorg global smage2 functions # must: X11_dir (defaults to /usr in sminc) # optional: # X11_FONT_DIR # SRCFILE # SRCDIR # SRC_URI # DEPEND # SDEPEND # global xorg functions needed in the sminc # checks if ${PNAME} is a font package is_xorg_font() { if [[ ${PNAME/#font-/} != ${PNAME} ]] && [[ ${PNAME} != font-alias ]] && [[ ${PNAME} != font-util ]] then return 0 fi return 1 } # checks if ${PNAME} is a video driver package is_xorg_video_driver() { [[ ${PNAME/#xf86-video/} != ${PNAME} ]] && return 0 return 1 } # checks if ${PNAME} is a input driver package is_xorg_input_driver() { [[ ${PNAME/#xf86-input/} != ${PNAME} ]] && return 0 return 1 } # checks for general driver packages is_xorg_driver() { if is_xorg_video_driver || is_xorg_input_driver then return 0 fi return 1 } # default vars X11_DIR="/usr" # satisfy mage with preinstall INHERITS="${INHERITS} xorg" # pkg setup : ${SRCFILE="${PNAME}-${PVER}.tar.bz2"} : ${SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"} #XORG_MIRROR="http://ftp.x.org/pub" XORG_MIRROR="http://xorg.freedesktop.org/archive" if [[ -n ${PCATEGORIE} ]] && [[ -z ${PCAT} ]] then PCAT="${PCATEGORIE}" fi # get the right subdir case ${PCAT} in app-doc) URISUBDIR="doc" ;; media-fonts) URISUBDIR="font" ;; x11-apps) URISUBDIR="app" ;; x11-base) URISUBDIR="xserver" ;; x11-drivers) URISUBDIR="driver" ;; x11-libs) URISUBDIR="lib" ;; x11-misc) case ${PNAME} in xbitmaps|xkbdata) URISUBDIR="data" ;; xkeyboard-config) URISUBDIR="data/xkeyboard-config" ;; *) URISUBDIR="util" ;; esac ;; x11-proto) URISUBDIR="proto" ;; x11-themes) URISUBDIR="data" ;; x11-wm) URISUBDIR="app" ;; esac SRC_URI=( ${SRC_URI[*]} # ${XORG_MIRROR}/individual/app/${SRCFILE} # ${XORG_MIRROR}/individual/data/${SRCFILE} # ${XORG_MIRROR}/individual/doc/${SRCFILE} # ${XORG_MIRROR}/individual/driver/${SRCFILE} # ${XORG_MIRROR}/individual/font/${SRCFILE} # ${XORG_MIRROR}/individual/lib/${SRCFILE} # ${XORG_MIRROR}/individual/proto/${SRCFILE} # ${XORG_MIRROR}/individual/testdir/${SRCFILE} # ${XORG_MIRROR}/individual/util/${SRCFILE} # ${XORG_MIRROR}/individual/xserver/${SRCFILE} ${XORG_MIRROR}/individual/${URISUBDIR}/${SRCFILE} mirror://${PNAME}/${SRCFILE} ) # add default deps DEPEND="${DEPEND} >= virtual/man" SDEPEND="${SDEPEND} >= dev-util/pkgconfig-0.20 >= x11-misc/util-macros-1" # font dependencies if is_xorg_font then DEPEND="${DEPEND} >= x11-apps/mkfontscale-1 >= x11-apps/mkfontdir-1 >= media-fonts/font-alias-1" # encodings are run-time needed to rebuild the font.dirs files !! # so don't use SDEPEND but DEPEND here! DEPEND="${DEPEND} >= media-fonts/encodings-1" XORG_FONT_PKG=yes SPECIAL_VARS="${SPECIAL_VARS} XORG_FONT_PKG" #INHERITS="${INHERITS} xorg" fi # default input driver dependencies if is_xorg_input_driver then DEPEND="${DEPEND} >= x11-base/xorg-server-1" SDEPEND="${SDEPEND} >= x11-proto/inputproto-1 >= x11-proto/randrproto-1 >= x11-proto/xproto-7" fi # default video driver dependencies if is_xorg_video_driver then DEPEND="${DEPEND} >= x11-base/xorg-server-1" SDEPEND="${SDEPEND} >= x11-proto/fontsproto-2 >= x11-proto/randrproto-1 >= x11-proto/renderproto-0.9 >= x11-proto/xextproto-7 >= x11-proto/xproto-7 >= x11-proto/videoproto-2" fi xorg_src_prepare() { # check for old xorg installations is_old_xorg_installed munpack ${SRCFILE} || die } xorg_src_configure() { cd ${SRCDIR} # abort if configure script is not found [ ! -x ./configure ] && return local conf_opts="$@" # setup fonts if is_xorg_font then # setup default font dir : ${XORG_FONT_DIR=${PNAME##*-}} # fix case of font directories XORG_FONT_DIR=${XORG_FONT_DIR/ttf/TTF} XORG_FONT_DIR=${XORG_FONT_DIR/otf/OTF} XORG_FONT_DIR=${XORG_FONT_DIR/type1/Type1} XORG_FONT_DIR=${XORG_FONT_DIR/speedo/Speedo} conf_opts="${conf_opts} --with-fontdir=/usr/share/fonts/${XORG_FONT_DIR}" fi # setup drivers if is_xorg_driver then # don't build static driver modules conf_opts="${conf_opts} --disable-static" fi mconfigure \ --prefix=${X11_DIR} \ ${conf_opts} \ || die } xorg_src_compile() { cd ${SRCDIR} xorg_src_configure || die mmake || die } xorg_src_install() { cd ${SRCDIR} make DESTDIR=${BINDIR} install || die # remove libtool files for server modules if [ -e ${BINDIR}/usr/$(mlibdir)/xorg/modules ] then find ${BINDIR}/usr/$(mlibdir)/xorg/modules -name '*.la' | xargs rm -f fi } xorg_preinstall() { # run this in postinstall to cover --src-install builds # ( the is now package-dir at this moment, cause its not already builded :) # if [[ -n ${XORG_FONT_PKG} ]] # then # xorg_discover_font_dirs # fi return 0 } export_inherits xorg src_prepare src_compile src_install preinstall