The generated CMake targets file was referring to an incorrect
destination as the derivation manually moved the libraries during
installPhase, while CMake uses the path it thinks is going to be used
(the DESTINATION in the install rule) in the IMPORTED_LOCATION property.
By setting the install destinations via CMake flags (and patching the
DESTINATION for the binary install rules), CMake will pick up the
correct locations in the generated AlembicTargets-release.cmake file.
Along with fixing that issue, this commit also includes the following
changes:
* Remove unused unzip nativeBuildInput
* Enable unit tests
* Add missing direct dependency ilmbase:
Previously it was only picked up indirectly, resulting in CMake
configuration warnings
* Add ilmbase as propagatedBuildInput:
Downstream users of Alembic (via CMake) need to add ilmbase as a
dependency as well
For some reason this is not discovered correctly otherwise
* Use CMake setup hooks instead of setting buildPhase/installPhase
When expanding path variables, kpathsea uses a trick to speed up identifying
leaf directories. The manual says
> The trick is that in every real Unix implementation (as opposed to the POSIX
> specification), a directory which contains no subdirectories will have
> exactly two links (namely, one for . and one for ..). That is to say, the
> st_nlink field in the ‘stat’ structure will be two. Thus, we don’t have to
> stat everything in the bottom-level (leaf) directories—we can just check
> st_nlink, notice it’s two, and do no more work.
>
> But if you have a directory that contains a single subdirectory and 500
> regular files, st_nlink will be 3, and Kpathsea has to stat every one of those
> 501 entries. Therein lies slowness.
>
> You can disable the trick by undefining ST_NLINK_TRICK in
> kpathsea/config.h. (It is undefined by default except under Unix.)
This does not work as expected with nixpkgs symlink trees and programs that rely
on kpathsea path expansion do not work properly.
One example is luaotfload's font database, which is populated by the font files
in the directories obtained by path-expanding the value of the `OPENTYPEFONTS`
configuration variable with kpathsea. The expanded value can be checked with
`kpsewhich --show-path="opentype fonts"`. Before this change, the expanded
value does not include the various font directories symlinked into
`/texmf/fonts/opentype/public`, since kpathsea considers this a leaf
directory (every child is a symlink, not a directory). Hence luaotfload does
not find the fonts in the texlive installation.
This patch disables this trick.
- when building with CUDA, we must make sure to use the same C/C++ compiler as NVCC to avoid symbol errors when linking
- move to cudaPackages to reduce closure size
- separate build-time and run-time CUDA dependencies