Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: Use 'install' to install and respect DESTDIR #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Flowdalic
Copy link
Contributor

@Flowdalic Flowdalic commented Dec 20, 2021

Gentoo uses a staged install mechanism, and hence likes to have DESTDIR :)

mkdir -p ${PREFIX}/include/capnp/
cp capnpc-java ${PREFIX}/bin
cp compiler/src/main/schema/capnp/java.capnp ${PREFIX}/include/capnp/
install -D capnpc-java "${DESTDIR}/${PREFIX}"/bin/capnpc-java
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if PREFIX is a relative path?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this about PREFIX not starting with /? This would be uncommon, although I believe the current change would accept it and still do the right thing™, because there is an explicit / between DESTDIR and PREFIX.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If PREFIX is a relative path and DESTDIR is empty, then the / will make the result an incorrect absolute path.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are saying that I should remove the explicit / between DESTDIR and PREFIX, then I am happy to do so. :)

@paxel
Copy link
Contributor

paxel commented Dec 22, 2021 via email

@Flowdalic
Copy link
Contributor Author

does not solve the problem. you should check if destdir is empty and replace it in that case with a single dot. that would result in . /$prefix which would be relative again.

I fear I don't see how this doesn't solve the problem: if PREFIX is usr/foo and DESTDIR is empty, then the result, assuming the / between DESTDIR and PREFIX is removed, is also relativ, even though it has no trailing ./.

@paxel
Copy link
Contributor

paxel commented Dec 22, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants