Gentoo ebuilds for 1.4.2 stable and 1.5.0 release

Panda3D Forum Index -> Compiling or Editing the Panda Source Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
joeldg


Posts: 15
Location: NYC

PostPosted: Wed Apr 09, 2008 6:09 pm    Post subject: Gentoo ebuilds for 1.4.2 stable and 1.5.0 release Reply with quote
Here is a 1.4.2 STABLE ebuild (panda3d-1.4.2.ebuild) for gentoo that I am submitting to the gentoo maintainers ..

here is the request at gentoo for 1.4.2:
http://bugs.gentoo.org/show_bug.cgi?id=217064

and for 1.5.0
http://bugs.gentoo.org/show_bug.cgi?id=217066

the above bugs were compiled into
http://bugs.gentoo.org/show_bug.cgi?id=144259

to use (in case you don't know how to integrate a new ebuild)
~# ebuild /usr/local/portage/media-libs/panda3d/panda3d-1.4.2.ebuild digest

then you can jsut `emerge -va media-libs/panda3d`

If you name the following panda3d-1.4.2.ebuild in media-libs/panda3d and then copy it to panda3d-1.5.0.ebuild it should work the same. (follow the same directions above using `ebuild`)

EDIT: be careful there is screwy line wrapping happening on these forums

Code:
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# 1.4.2 'stable' by joeldg - blog.peoplesdns.com
# $Header: $

inherit eutils python

DESCRIPTION="A 3D framework in C++ with python bindings"
HOMEPAGE="http://panda3d.org"
SRC_URI="http://panda3d.org/download/${P}/${P}.tar.gz"

LICENSE="Panda3D"
SLOT="0"
KEYWORDS="~x86"
IUSE="png jpeg tiff fmod nspr python ssl truetype doc zlib"

DEPEND="doc? ( dev-python/epydoc )
      png? ( media-libs/libpng )
      jpeg? ( media-libs/jpeg )
      tiff? ( media-libs/tiff )
      nspr? ( >=dev-libs/nspr-4.4.1-r2 )
      fmod? ( =media-libs/fmod-3* )
      ssl? ( dev-libs/openssl )
      truetype? ( media-libs/freetype )
      zlib? ( sys-libs/zlib )
      python? ( dev-lang/python )"

pkg_setup() {
   ewarn "Please note that python bindings are now"
   ewarn "set by the python USE flag to coordinate"
   ewarn "with upstream."
}

src_unpack()
{
   unpack ${A}
}

src_compile()
{
   #
   # the everything keyword has checks for your current libs
   # and will skip them if not available..
   # this also adds support for maya and max models.
   #
   ./makepanda/makepanda.py --everything   || die "build failed"
}

src_install()
{
   dodir /opt/panda3d

   doenvd ${FILESDIR}/50panda3d
   sed -i -e "s:lib:$(get_libdir):g" \
   ${D}/etc/env.d/50panda3d \
   || die "libdir patching failed"

   if use doc; then
      cp -R ${S}/samples ${S}/built
      cp -R ${S}/direct/src ${S}/built/direct/src
      cd ${S}/built
   fi

   if use python ; then
      # python installation
      python_version
      dodir /usr/$(get_libdir)/python${PYVER}/site-packages
      cat <<- EOF > ${D}/usr/$(get_libdir)/python${PYVER}/site-packages/panda3d.pth
      # This document sets up paths for python to access the
      # panda3d modules
      /opt/panda3d/lib
      /opt/panda3d/direct
      /opt/panda3d/pandac
      /opt/panda3d/built
      /opt/panda3d/built/$(get_libdir)   

      EOF
   fi

   cp -R ${S}/direct/src ${S}/built/direct/
   cp -R ${S}/built/* ${D}/opt/panda3d
   use python && touch ${D}/opt/panda3d/built/__init__.py
}

pkg_postinst()
{
   elog "Panda3d is installed in /opt/panda3d"
   elog
   if use doc ; then
      elog "Documentation is avaliable in /opt/panda3d/doc"
      elog "Samples are avalaible in /opt/panda3d/samples"
   fi
   elog "For C++ compiling, include directory must be set:"
   elog "g++ -I/opt/panda3d/include [other flags]"
   if use python ; then
      elog
      elog "ppython is depricated and panda3d modules are"
      elog "now installed as standard python modules."
   fi
   elog
   elog "Tutorials avaliable at http://panda3d.org"
}



also

Code:
joeldg@localhost ~ $ more /usr/portage/media-libs/panda3d/files/50panda3d
# /etc/env.d/50panda3d:
# $Header: /var/cvsroot/gentoo-x86/media-libs/panda3d/files/50panda3d,v 1.1 2005
/06/24 05:28:52 chriswhite Exp $

PATH="/opt/panda3d/bin"
ROOTPATH="/opt/panda3d/bin"
LDPATH="/opt/panda3d/lib"



IF YOU RUN INTO ISSUES UNABLE TO FIND MODULES:
The newer ebuilds I added have one issue that causes me a problem and that is with the python bindings for direct may need to be added as
Code:
ln -s /opt/panda3d/direct/  /usr/lib/python2.4/site-packages/

and for pandac
Code:
ln -s /opt/panda3d/pandac/ /usr/lib/python2.4/site-packages/

and also
edit /usr/lib/python2.4/site-packages/panda3d.pth
and add /opt/panda3d/lib

that should get you up and running if for some reason the pth files are not working as they should


Last edited by joeldg on Thu Apr 10, 2008 5:29 pm; edited 4 times in total
joeldg


Posts: 15
Location: NYC

PostPosted: Wed Apr 09, 2008 7:03 pm    Post subject: Reply with quote
as a quick note..
change
Code:
   if use doc; then
      cp -R ${S}/samples ${S}/built
      cp -R ${S}/direct/src ${S}/built/direct/src
      cd ${S}/built
   fi


to

Code:
   #if use doc; then
      cp -R ${S}/samples ${S}/built
      cp -R ${S}/direct/src ${S}/built/direct/src
      cd ${S}/built
   #fi


if you do not have doc in your use flags
otherwise you will not get the samples and such
joeldg


Posts: 15
Location: NYC

PostPosted: Thu Apr 10, 2008 5:30 pm    Post subject: Reply with quote
I updated this to fix some path issues
Display posts from previous:   
Post new topic   Reply to topic    Panda3D Forum Index -> Compiling or Editing the Panda Source All times are GMT - 5 Hours
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


Powered by phpBB © 2001, 2005 phpBB Group