Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
emul-linux packages
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
vlooe
n00b
n00b


Joined: 04 Jun 2005
Posts: 35
Location: Germany

PostPosted: Wed Mar 04, 2009 10:05 pm    Post subject: emul-linux packages Reply with quote

Hi

I wrote a little script to build the emul-linux-x86-xlibs.
It works fine for the xlibs.

I tried to use it for the other emul packages too, but there are some ebuilds that makes trouble
For example libxml2 needs some x86 specific python headers

Will it be useful to patch sources/ebuilds to work with my script / build with ABI=x86?

How log could this be useful? Are there any changes planed to the emul-linux / multilib system?

build_emul_pkg.sh:
Code:

#!/bin/bash

PKG_CONFIG=/usr/lib32/pkgconfig
TMP_DIR=/var/tmp/portage/emul
CCACHE_DIR=/var/tmp/ccache
DISTFILES=/usr/portage/distfiles
PACKAGE_DIR=/usr/portage/packages
OVERLAY_DIR=/usr/portage/local/32bit_mesa_test/overlay

if [[ -n $1 ]]
then
   EMUL_LINUX_X86_LIBS=$1
else
   EMUL_LINUX_X86_LIBS=xlibs
fi

if [[ -n $2 && -s $2 ]]
then
   PACKAGELIST="$(emerge -p $(cat $2)| tail -n +5 | cut -d " " -f 8)"
else
   PACKAGELIST="$(emerge -p libXcursor libXrandr libXi libXinerama libXrender freetype fontconfig libXcomposite libICE libSM libXt libdrm libXfixes libXdamage libXxf86vm libXext libXau libX11 mesa | tail -n +5 | cut -d " " -f 8)"
   #PACKAGELIST="$(emerge -p libXext | tail -n +5 | cut -d " " -f 8)"
fi


function abort
{
   change_ccache 64
   exit 1
}

function prepare_ccache_dirs
{
   if [ -z "$(readlink ${CCACHE_DIR})" ]
   then
     mv ${CCACHE_DIR} ${CCACHE_DIR}64
   else
     rm -f ${CCACHE_DIR}
   fi
   mkdir -p ${CCACHE_DIR}32
   mkdir -p ${CCACHE_DIR}64
   ln -s ccache64 ${CCACHE_DIR}
}

function change_ccache
{
   rm ${CCACHE_DIR} || abort
   ln -s ccache$1 ${CCACHE_DIR} || abort
   echo new ccache is ccache$1
}


function run_emerge
{
   echo emergeing $1
   USE="-doc" PKG_CONFIG_PATH=${PKG_CONFIG} ABI=x86 linux32 emerge =$1 -1 --buildpkgonly || abort
}

function unpack_emul_package
{
   rm -rf ${TMP_DIR}
   mkdir -p ${TMP_DIR}/new_pkg || abort
   cd ${TMP_DIR}/new_pkg
   tar -xjvf ${DISTFILES}/emul-linux-x86-${EMUL_LINUX_X86_LIBS}-99999998.tar.bz2
   cd -
}

function unpack_package
{
   mkdir -p ${TMP_DIR}/pkg/$1  || abort
   qtbz2 --tarbz2 ${PACKAGE_DIR}/$1.tbz2 ${TMP_DIR}/pkg/$1.tar.bz2 || abort
   tar -xvjf ${TMP_DIR}/pkg/$1.tar.bz2 -C ${TMP_DIR}/new_pkg || abort
}

function make_new_emul_package
{
   cd ${TMP_DIR}/new_pkg/
   rm -rf ${TMP_DIR}/new_pkg/usr/share/man ${TMP_DIR}/new_pkg/usr/share/doc ${TMP_DIR}/new_pkg/usr/share/X11
   tar -cvjf ${DISTFILES}/emul-linux-x86-${EMUL_LINUX_X86_LIBS}-99999998.tar.bz2 *
   cd -

   #generate new md5 sum usw
   ebuild ${OVERLAY_DIR}/app-emulation/emul-linux-x86-${EMUL_LINUX_X86_LIBS}/emul-linux-x86-${EMUL_LINUX_X86_LIBS}-99999998.ebuild manifest --force
}

function emerge_new_emul_package
{
   emerge -1 =emul-linux-x86-${EMUL_LINUX_X86_LIBS}-99999998 || abort
}



echo ${PACKAGELIST}

prepare_ccache_dirs
change_ccache 32 || abort


for I in ${PACKAGELIST}
do
   run_emerge ${I} || abort
   unpack_emul_package || abort
   unpack_package ${I} || abort
   make_new_emul_package || abort
   emerge_new_emul_package || abort

done

change_ccache 64


emul-linux-x86-xlibs-99999998.ebuild
Code:

# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit emul-linux-x86

LICENSE="fontconfig FTL GPL-2 LGPL-2 glut libdrm libICE libSM libX11 libXau
                libXaw libXcomposite libXcursor libXdamage libXdmcp libXext libXfixes libXft
                libXi libXinerama libXmu libXp libXpm libXrandr libXrender libXScrnSaver libXt
                libXtst libXv libXvMC libXxf86dga libXxf86dga libXxf86vm MOTIF"
KEYWORDS="-* amd64"
IUSE="opengl"

DEPEND="opengl? ( app-admin/eselect-opengl )"
RDEPEND=">=app-emulation/emul-linux-x86-baselibs-20071114
        x11-libs/libX11"

src_unpack() {
        ALLOWED="(${S}/usr/lib32/pkgconfig)"
        emul-linux-x86_src_unpack
        rm -f "${S}/usr/lib32/libGL.so"
}

pkg_postinst() {
        #update GL symlinks
        use opengl && eselect opengl set --use-old
}
Back to top
View user's profile Send private message
alex.blackbit
Advocate
Advocate


Joined: 26 Jul 2005
Posts: 2397

PostPosted: Fri Mar 06, 2009 12:17 pm    Post subject: Reply with quote

maybe you are interested in this forums post and this bug.
Back to top
View user's profile Send private message
vlooe
n00b
n00b


Joined: 04 Jun 2005
Posts: 35
Location: Germany

PostPosted: Fri Mar 06, 2009 12:40 pm    Post subject: Reply with quote

thanks for the hint.

Looks interesting
I will read it complete at home this evening.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum