cpplocate
cpplocate copied to clipboard
Problem: cpplocate cannot be installed to non-system directories in system-dir-install
We want to package cpplocate (and others) but we cannot install it using system-dir-install into fakeroot due to auto-recognition of cppassist
Solution: add an optional override flag to do that
Thanks for providing a PR that solves a problem using our libraries. I'll use this PR as representative for the other ones (https://github.com/cginternals/cppfs/pull/4, https://github.com/cginternals/cppexpose/pull/42, and https://github.com/cginternals/cppassist/pull/38) to talk about contents and reviews as I think everything applies there as well.
I'm currently trying to understand your deployment prodecure to get a clue on how your fix is working. It seems like you want to install cpplocate as a package maintainer in a fakeroot environment so that the correct file permissions are set prior to packaging. We currently target PPA deployment for Ubuntu, where I think we do something similar. However, we use cmake-builtin functionality and a small cmake-init hack to emulate the DESTDIR
behavior on linux systems. Can you give an example on how you try to package our libraries and which steps are not working as intended?
Although your solution seems effective, we try to keep the cmake options required for deployment at a minimum (currently zero) and usually search for other solutions.
Here is an example how we use the existing cmake build system to prepare our libraries for deb-file packaging:
export BUILDDIR = build
mkdir $(BUILDDIR)
cd $(BUILDDIR);cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DOPTION_BUILD_DOCS=On ..
cd $(BUILDDIR); DESTDIR=../debian/tmp COMPONENT=runtime make component_install
mkdir -p debian/tmp/DEBIAN
dpkg-gencontrol -plibcpplocate
dpkg --build debian/tmp ..
rm -rf debian/tmp
cd $(BUILDDIR); DESTDIR=../debian/tmp COMPONENT=dev make component_install
mkdir -p debian/tmp/DEBIAN
dpkg-gencontrol -plibcpplocate-dev
dpkg --build debian/tmp ..
rm -rf debian/tmp
cd $(BUILDDIR); DESTDIR=../debian/tmp COMPONENT=docs make component_install
mkdir -p debian/tmp/DEBIAN
dpkg-gencontrol -plibcpplocate-docs
dpkg --build debian/tmp ..
rm -rf debian/tmp
thanks for your answer... Unfortunately we cannot detect the SYSTEM_DIR_INSTALL
by comparing the CMAKE_INSTALL_PREFIX
with /usr/
because our install directory is something arbitrary in a temporary location... Also we use exactly the same filesystem structure (UNIX-like) on Windows OS, where the if query will fail anyway which results in the dll to be located in the root of the install dir and not in bin...
It seemed the easiest way to me to solve it like this, I just wanted a "clean" UNIX-like installation tree, no matter where I install to or in which platform I am...
Yes, the current behavior of detecting system-dir installs by comparing with /usr or /usr/local does not work with the described use case. I think your solution is fine for the moment, we will later rewrite this from the ground up (but it will most likely be very similar to this, use an option instead of trying to detect it).
well auto detection is always somewhat critical for packaging although I understand the need to reduce configuration options...