(no commit message)
authorChris White <chriswhite@gentoo.org>
Wed, 30 Nov 2005 10:04:10 +0000 (10:04 +0000)
committerChris White <chriswhite@gentoo.org>
Wed, 30 Nov 2005 10:04:10 +0000 (10:04 +0000)
media-libs/panda3d/files/digest-panda3d-1.0.5 [new file with mode: 0644]
media-libs/panda3d/files/panda3d-1.0.5-makepanda.patch [new file with mode: 0644]
media-libs/panda3d/panda3d-1.0.5.ebuild [new file with mode: 0644]

diff --git a/media-libs/panda3d/files/digest-panda3d-1.0.5 b/media-libs/panda3d/files/digest-panda3d-1.0.5
new file mode 100644 (file)
index 0000000..7f5ca01
--- /dev/null
@@ -0,0 +1 @@
+MD5 f647ea3409a558928536a375f4b0f01e panda3d-1.0.5.tar.gz 28996142
diff --git a/media-libs/panda3d/files/panda3d-1.0.5-makepanda.patch b/media-libs/panda3d/files/panda3d-1.0.5-makepanda.patch
new file mode 100644 (file)
index 0000000..9c01f17
--- /dev/null
@@ -0,0 +1,170 @@
+--- makepanda/makepanda.py.old 2005-10-04 13:55:15.000000000 +0900
++++ makepanda/makepanda.py     2005-10-04 14:07:34.000000000 +0900
+@@ -192,6 +192,7 @@
+ if (sys.platform == "win32"): COMPILERS=["MSVC7"]
+ if (sys.platform == "linux2"): COMPILERS=["LINUXA"]
+ PREFIX="built"
++LIBDIR="lib"
+ COMPILER=COMPILERS[0]
+ OPTIMIZE="3"
+ INSTALLER=0
+@@ -473,6 +474,7 @@
+     print "  --help            (print the help message you're reading now)"
+     print "  --package-info    (help info about the optional packages)"
+     print "  --prefix X        (install into prefix dir, default \"built\")"
++    print "  --libdir X              (install libs into libdir, default \"lib\")"
+     print "  --compiler X      (currently, compiler can only be MSVC7,LINUXA)"
+     print "  --optimize X      (optimization level can be 1,2,3,4)"
+     print "  --thirdparty X    (directory containing third-party software)"
+@@ -500,10 +502,10 @@
+     sys.exit(1)
+ 
+ def parseopts(args):
+-    global PREFIX,COMPILER,OPTIMIZE,OMIT,THIRDPARTY,INSTALLER,GENMAN
++    global PREFIX,LIBDIR,COMPILER,OPTIMIZE,OMIT,THIRDPARTY,INSTALLER,GENMAN
+     global PPGAME,COPYEXTRAS,VERSION,COMPRESSOR,DIRECTXSDK,VERBOSE
+     longopts = [
+-        "help","package-info","prefix=","compiler=","directx-sdk=","thirdparty=",
++        "help","package-info","prefix=","libdir=","compiler=","directx-sdk=","thirdparty=",
+         "optimize=","everything","nothing","installer","ppgame=","quiet","verbose",
+         "version=","lzma","no-python"]
+     anything = 0
+@@ -515,6 +517,7 @@
+             if (option=="--help"): raise "usage"
+             elif (option=="--package-info"): raise "package-info"
+             elif (option=="--prefix"): PREFIX=value
++          elif (option=="--libdir"): LIBDIR=value
+             elif (option=="--compiler"): COMPILER=value
+             elif (option=="--directx-sdk"): DIRECTXSDK=value
+             elif (option=="--thirdparty"): THIRDPARTY=value
+@@ -543,7 +546,8 @@
+     except "package-info": packageInfo()
+     except: usage(0)
+     if (anything==0): usage(0)
+-    if   (OPTIMIZE=="1"): OPTIMIZE=1
++    if   (OPTIMIZE=="0"): OPTIMIZE=0
++    elif (OPTIMIZE=="1"): OPTIMIZE=1
+     elif (OPTIMIZE=="2"): OPTIMIZE=2
+     elif (OPTIMIZE=="3"): OPTIMIZE=3
+     elif (OPTIMIZE=="4"): OPTIMIZE=4
+@@ -839,7 +843,7 @@
+ ##########################################################################################
+ 
+ if (sys.platform != "win32"):
+-    BUILTLIB = os.path.abspath(PREFIX+"/lib")
++    BUILTLIB = os.path.abspath(PREFIX+"/"+LIBDIR)
+     try:
+         LDPATH = []
+         f = file("/etc/ld.so.conf","r")
+@@ -849,7 +853,7 @@
+     if (os.environ.has_key("LD_LIBRARY_PATH")):
+         LDPATH = LDPATH + os.environ["LD_LIBRARY_PATH"].split(":")
+     if (LDPATH.count(BUILTLIB)==0):
+-        WARNINGS.append("Caution: the "+PREFIX+"/lib directory is not in LD_LIBRARY_PATH")
++        WARNINGS.append("Caution: the "+PREFIX+"/"+LIBDIR+" directory is not in LD_LIBRARY_PATH")
+         WARNINGS.append("or /etc/ld.so.conf.  You must add it before using panda.")
+         if (os.environ.has_key("LD_LIBRARY_PATH")):
+             os.environ["LD_LIBRARY_PATH"] = BUILTLIB + ":" + os.environ["LD_LIBRARY_PATH"]
+@@ -874,6 +878,7 @@
+             if (OMIT.count(x)==0): tkeep = tkeep + x + " "
+             else:                  tomit = tomit + x + " "
+         print "Makepanda: Prefix Directory:",PREFIX
++      print "Makepanda: Lib Directory:",PREFIX+"/"+LIBDIR
+         print "Makepanda: Compiler:",COMPILER
+         print "Makepanda: Optimize:",OPTIMIZE
+         print "Makepanda: Keep Pkg:",tkeep
+@@ -905,6 +910,10 @@
+ 
+ MakeDirectory(PREFIX)
+ MakeDirectory(PREFIX+"/bin")
++if (sys.platform == "win32"):
++      MakeDirectory(PREFIX+"/lib")
++else:
++      MakeDirectory(PREFIX+"/"+LIBDIR)
+ MakeDirectory(PREFIX+"/lib")
+ MakeDirectory(PREFIX+"/etc")
+ MakeDirectory(PREFIX+"/plugins")
+@@ -1260,17 +1269,26 @@
+         if (older(wobj, dep)):
+             if VERBOSE >= 0:
+                 checkIfNewDir(ipath[1])
+-            if (src[-2:]==".c"): cmd = 'gcc -c -o ' + wobj
+-            else:                cmd = 'g++ -ftemplate-depth-30 -c -o ' + wobj
++            if (src[-2:]==".c"): 
++              if os.environ.has_key("CFLAGS"):
++                      cmd = 'gcc ' + os.environ["CFLAGS"] + ' -c -o ' + wobj
++              else:
++                      cmd = 'gcc -c -o ' + wobj
++            else:                
++              if os.environ.has_key("CXXFLAGS"):
++                      cmd = 'g++ ' + os.environ["CXXFLAGS"] + ' -c -o ' + wobj
++              else:
++                      cmd = 'g++ -ftemplate-depth-30 -c -o ' + wobj
+             if (OMIT.count("PYTHON")==0): cmd = cmd + ' -I"' + PYTHONSDK + '"'
+             if (PkgSelected(opts,"VRPN")):     cmd = cmd + ' -I' + THIRDPARTY + '/linux-libs-a/vrpn/include'
+             if (PkgSelected(opts,"FFTW")):     cmd = cmd + ' -I' + THIRDPARTY + '/linux-libs-a/fftw/include'
+-            if (PkgSelected(opts,"FMOD")):     cmd = cmd + ' -I' + THIRDPARTY + '/linux-libs-a/fmod/include'
++            if (PkgSelected(opts,"FMOD")):     pass
+             if (PkgSelected(opts,"NVIDIACG")): cmd = cmd + ' -I' + THIRDPARTY + '/linux-libs-a/nvidiacg/include'
+-            if (PkgSelected(opts,"NSPR")):     cmd = cmd + ' -I' + THIRDPARTY + '/linux-libs-a/nspr/include'
++            if (PkgSelected(opts,"NSPR")):     cmd = cmd + ' -I/usr/include/nspr'
+             if (PkgSelected(opts,"FREETYPE")): cmd = cmd + ' -I/usr/include/freetype2'
+             for x in ipath: cmd = cmd + ' -I' + x
+             if (opts.count("WITHINPANDA")): cmd = cmd + ' -DWITHIN_PANDA'
++          if (OPTIMIZE==0): pass
+             if (OPTIMIZE==1): cmd = cmd + " -g"
+             if (OPTIMIZE==2): cmd = cmd + " -O1"
+             if (OPTIMIZE==3): cmd = cmd + " -O2"
+@@ -1390,7 +1408,7 @@
+ 
+     if (COMPILER=="MSVC7"):
+         if (lib[-4:]==".ilb"): wlib = PREFIX+"/tmp/" + lib[:-4] + ".lib"
+-        else:                  wlib = PREFIX+"/lib/" + lib[:-4] + ".lib"
++        else:                  wlib = PREFIX+"/"+LIBDIR+"/" + lib[:-4] + ".lib"
+         wobj = xpaths(PREFIX+"/tmp/",obj,"")
+         ALLTARGETS.append(wlib)
+         if (older(wlib, wobj)):
+@@ -1523,14 +1541,14 @@
+ 
+     if (COMPILER=="LINUXA"):
+         if (dll[-4:]==".exe"): wdll = PREFIX+"/bin/"+dll[:-4]
+-        else: wdll = PREFIX+"/lib/"+dll[:-4]+".so"
++        else: wdll = PREFIX+"/"+LIBDIR+"/"+dll[:-4]+".so"
+         ALLTARGETS.append(wdll)
+         wobj = []
+         for x in obj:
+             suffix = x[-4:]
+             if   (suffix==".obj"): wobj.append(PREFIX+"/tmp/"+x[:-4]+".o")
+             elif (suffix==".dll"): wobj.append(PREFIX+"/lib/"+x[:-4]+".so")
+-            elif (suffix==".lib"): wobj.append(PREFIX+"/lib/"+x[:-4]+".a")
++            elif (suffix==".lib"): wobj.append(PREFIX+"/"+LIBDIR+"/"+x[:-4]+".a")
+             elif (suffix==".ilb"): wobj.append(PREFIX+"/tmp/"+x[:-4]+".a")
+             else: sys.exit("unknown suffix in object list.")
+         if (older(wdll, wobj+xdep)):
+@@ -1540,14 +1558,14 @@
+                 suffix = x[-4:]
+                 if   (suffix==".obj"): cmd = cmd + ' ' + PREFIX + '/tmp/' + x[:-4] + '.o'
+                 elif (suffix==".dll"): cmd = cmd + ' -l' + x[3:-4]
+-                elif (suffix==".lib"): cmd = cmd + ' ' + PREFIX + '/lib/' + x[:-4] + '.a'
++                elif (suffix==".lib"): cmd = cmd + ' ' + PREFIX + '/'+LIBDIR+'/' + x[:-4] + '.a'
+                 elif (suffix==".ilb"): cmd = cmd + ' ' + PREFIX + '/tmp/' + x[:-4] + '.a'
+-            if (PkgSelected(opts,"FMOD")):     cmd = cmd + ' -L' + THIRDPARTY + '/linux-libs-a/fmod/lib -lfmod-3.74'
++            if (PkgSelected(opts,"FMOD")):     cmd = cmd + ' -lfmod'
+             if (PkgSelected(opts,"NVIDIACG")):
+                 cmd = cmd + ' -L' + THIRDPARTY + 'nvidiacg/lib '
+                 if (opts.count("CGGL")): cmd = cmd + " -lCgGL"
+                 cmd = cmd + " -lCg"
+-            if (PkgSelected(opts,"NSPR")):     cmd = cmd + ' -L' + THIRDPARTY + '/linux-libs-a/nspr/lib -lpandanspr4'
++            if (PkgSelected(opts,"NSPR")):     cmd = cmd + ' -L/usr/' + LIBDIR + '/nspr -lnspr4'
+             if (PkgSelected(opts,"ZLIB")):     cmd = cmd + " -lz"
+             if (PkgSelected(opts,"PNG")):      cmd = cmd + " -lpng"
+             if (PkgSelected(opts,"JPEG")):     cmd = cmd + " -ljpeg"
+@@ -1918,7 +1936,7 @@
+                 CopyAllFiles(PREFIX+"/bin/",THIRDPARTY+"/win-libs-vc7/"+pkg.lower()+"/bin/")
+         if (COMPILER == "LINUXA"):
+             if (os.path.exists(THIRDPARTY+"/linux-libs-a/"+pkg.lower()+"/lib")):
+-                CopyAllFiles(PREFIX+"/lib/",THIRDPARTY+"/linux-libs-a/"+pkg.lower()+"/lib/")
++                CopyAllFiles(PREFIX+"/"+LIBDIR+"/",THIRDPARTY+"/linux-libs-a/"+pkg.lower()+"/"+LIBDIR+"/")
+ 
+ if (sys.platform == "win32"):
+     CopyFile(PREFIX+'/bin/', 'thirdparty/win-python/python22.dll')
diff --git a/media-libs/panda3d/panda3d-1.0.5.ebuild b/media-libs/panda3d/panda3d-1.0.5.ebuild
new file mode 100644 (file)
index 0000000..600ac95
--- /dev/null
@@ -0,0 +1,116 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/panda3d/panda3d-1.0.5.ebuild,v 1.1.1.1 2005/11/30 10:04:09 chriswhite Exp $
+
+inherit eutils python
+
+DESCRIPTION="A 3D framework in C++ with python bindings"
+HOMEPAGE="http://panda3d.org"
+SRC_URI="http://panda3d.org/download/${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 )
+               ssl? ( dev-libs/openssl )
+               truetype? ( media-libs/freetype )
+               zlib? ( sys-libs/zlib )
+               python? (dev-lang/python)"
+
+use_no()
+{
+       local UWORD="$2"
+       if [ -z "${UWORD}" ]; then
+               UWORD="$1"
+       fi
+
+       if useq $1 ; then
+               echo "--use-${UWORD}"
+       else
+               echo "--no-${UWORD}"
+       fi
+}
+
+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}
+       cd "${S}"
+       epatch "${FILESDIR}"/${P}-makepanda.patch
+}
+
+src_compile()
+{
+       ./makepanda/makepanda.py \
+       --compiler LINUXA \
+       --prefix built \
+       --libdir $(get_libdir) \
+       $(use_no python) \
+       $(use_no png) $(use_no jpeg) \
+       $(use_no tiff) $(use_no fmod) \
+       $(use_no ssl) $(use_no truetype freetype) \
+       $(use_no zlib) $(use_no nspr) \
+       || 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
+               cd ${S}/built
+               epydoc --html direct
+       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/built 
+               /opt/panda3d/built/$(get_libdir)
+               EOF
+       fi
+
+       cp -R ${S}/built/* ${D}/opt/panda3d
+       use python && touch ${D}/opt/panda3d/built/__init__.py
+}
+
+pkg_postinst()
+{
+       einfo "Panda3d is installed in /opt/panda3d"
+       einfo
+       if use doc ; then
+               einfo "Documentation is avaliable in /opt/panda3d/html"
+               einfo "Samples are avalaible in /opt/panda3d/samples"
+       fi
+       einfo "For C++ compiling, include directory must be set:"
+       einfo "g++ -I/opt/panda3d/include [other flags]"
+       if use python ; then
+               einfo
+               einfo "ppython is depricated and panda3d modules are"
+               einfo "now installed as standard python modules."
+       fi
+       einfo
+       einfo "Tutorials avaliable at http://panda3d.org"
+}