OpenNI2
OpenNI2 copied to clipboard
Installation confusion
We've been asked to add a port for openni2 to MacPorts, and I'm trying to do this, but I'm unclear how to install it.
With openni1, it was relatively simple to build with cd Platform/Linux/CreateRedist && CXX=clang++ ./RedistMaker
and install with cd ../Redist/* && ./install.sh -c $DESTDIR
.
With openni2, I can build with make release ALLOW_WARNINGS=1 CXX=clang
but I don't know how to install. The directory Packaging contains a directory OpenNI-MacOSX-x64-2.2 but the install.sh script inside it doesn't install anything; it just creates a text file OpenNIDevEnvironment.
How should we proceed? Why does the Makefile not have an install
target like other Makefiles do that puts the files where other programs will expect them to be?
Actually, the architecture in OpenNI 2.x is a bit different. The SDK no longer installs itself into /usr/lib and /usr/include, as we want to allow each applications to have its own private copy of the library (similar to the architecture of Qt).
The install script simply helps in exporting environment variables for development of libraries/applications that use OpenNI.
Of course it is possible to install OpenNI into /usr/lib and /usr/include, but that's up to each developer.
The SDK no longer installs itself into /usr/lib and /usr/include, as we want to allow each applications to have its own private copy of the library
If that's true, then we should not add openni2 to MacPorts, right? We currently have two ports using openni1: libpcl and opencv. You're saying that if the developers of libpcl and opencv were to switch to openni2, they should do so by including a copy of the openni2 source code in their own programs' source download packages?
(similar to the architecture of Qt).
In MacPorts we certainly do have a port for Qt, and dozens of ports use it. Individual Qt-using programs, like qupzilla or digikam or gnuplot or aqbanking, do not include their own copy of the (enormous) Qt source code.
Of course it is possible to install OpenNI into /usr/lib and /usr/include, but that's up to each developer.
But it has to be standardized. If you're going to install files into $prefix/lib, $prefix/include, etc, then you do it so that other programs can use them. And if you do that, you have to install them in predictable locations. And that's what install scripts do.
I'm sorry if I was not clear enough. I didn't mean that each library/application should include OpenNI source code, only OpenNI binaries. Qt is similar - if you download Qt installation from the website - it does not install itself into $prefix, but to your home directory (see Qt download page - http://qt-project.org/downloads). Qt chose to give the responsibility of deployment to their users - see their deployment guide (http://qt-project.org/doc/qt-5.0/qtdoc/deployment.html) - so that each application is responsible to either use it as static libraries or deploy Qt binaries with it.
I assume that whoever added Qt into MacPorts decided to install its binaries and include files into $prefix, so that other libraries/applications in MacPorts can use it. This means you get to make the exact same choice :).
Translation: we don't care about standard conventions, and we're not going to give the slightest nod to anyone who wants to follow them, so pound sand.
Sorry, that comment was made in a moment of weakness. To redeem myself, I'll try to post the build script I use soon that works around the problem.
In the meantime, http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/2013-November/035400.html points to the git repo being used to package it for Debian (and I've used similar patches locally with success on Ubuntu), https://github.com/totakke/homebrew-openni2 has a homebrew recipe (that unfortunately still requires env settings), and https://trac.macports.org/ticket/40107 is the ticket Ryan was prompted by.
There is also an Arch Linux openni2 package in the AUR. Looks like it installs into /usr/include
and /usr/lib
.