[solved] Problem when building the runtime manually

I’m trying to build Panda3D-runtime-1.0.0 form source on Gentoo Linux using makepanda because it was suggested here. Previously I’ve successfully build the Panda3D SDK (1.7.0).

I get this error:

$ makepanda/makepanda.py --everything
Generating library cache...
WARNING: Could not locate thirdparty package artoolkit, excluding from build
WARNING: Could not locate thirdparty package fcollada, excluding from build
WARNING: Could not locate thirdparty package fftw, excluding from build
WARNING: Could not locate thirdparty package fmodex, excluding from build
WARNING: Could not locate thirdparty package ode, excluding from build
WARNING: Could not locate thirdparty package opencv, excluding from build
WARNING: Could not locate thirdparty package squish, excluding from build
WARNING: Could not locate thirdparty package vrpn, excluding from build
WARNING: Could not locate thirdparty package tinyxml, excluding from build
Traceback (most recent call last):
  File "makepanda/makepanda.py", line 1730, in <module>
    CopyAllFiles(GetOutputDir()+"/plugins/",  "pandatool/src/scripts/", ".mel")
  File "/home/t/dev/panda3d-runtime-1.0.0/makepanda/makepandacore.py", line 1633, in CopyAllFiles
    for x in GetDirectoryContents(srcdir, ["*"+suffix]):
  File "/home/t/dev/panda3d-runtime-1.0.0/makepanda/makepandacore.py", line 249, in GetDirectoryContents
    files = os.listdir(dir)
OSError: [Errno 2] No such file or directory: 'pandatool/src/scripts/'

How can I prevent this error?

Add the “–runtime” and “–distributor cmu” options.

Ok, that works… I got more meaningful output and a new error:

Generating library cache...
WARNING: Could not locate thirdparty package npapi, excluding from build
Storing dependency cache.
Elapsed Time: 0 sec
Runtime must be compiled with OpenSSL, TinyXML, ZLib, NPAPI, JPEG, X11 and PNG support!
Build terminated.

I can’t find npapi in the Gentoo package repository. Where can I find this npapi? Should xulrunner provide this interface? (I have xulrunner already installed.)

The Xulrunner SDK should include npapi.h.

Ok, I found the file. It’s at /usr/include/xulrunner-1.9.2/npapi.h.

How can I tell makepanda.py where to find it?

Ah. Apparently, as of Xulrunner SDK 1.9.2, there is no longer a stable/ subdirectory in the include dir.
Edit makepanda/makepanda.py, and locate this line:

        SmartPkgEnable("NPAPI", "",          (), ("xulrunner-*/stable", "xulrunner-*/stable/npapi.h", "nspr*/prtypes.h", "nspr*"))

Replace it with:

        SmartPkgEnable("NPAPI", "",          (), ("xulrunner-*", "xulrunner-*/npapi.h", "nspr*/prtypes.h", "nspr*"))

Thanks rdb, that fixed the issue.