-
-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Do not set DESTDIR in makeFlags #65718
Comments
Some documentation on this could also go a long way. I've written up some basic docs: The global configure policy of Nixpkgs (which should be set for you when using autotools, but not necessarily other build systems) is:
It's a fairly common mistake to do To make sure installation happens correctly, you sometimes have to override make install flags like so:
|
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
This is a best practices issue, we still need to find a better place for it. |
I marked this as stale due to inactivity. → More info |
Is this sprintable? |
Yes. Each expression needs to be evaluated separately so the labour can be divided. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/creating-my-first-package-i3-gnome-in-nixos/10474/4 |
Can we update the nixpkgs manual to include this under the https://nixos.org/manual/nixpkgs/stable/#var-stdenv-makefile section and close this issue? It would also be a lot more discoverable |
I marked this as stale due to inactivity. → More info |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/import-problems-creating-a-new-package-45drives-autotier/22035/6 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/import-problems-creating-a-new-package-45drives-autotier/22035/7 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/compile-openssl-with-nix-pkgs/37289/2 |
Can someone help me with waydroid/waydroid#1218 ? |
DESTDIR
is used by some package managers as a poor man’s sandbox, transparent to the package. SettingDESTDIR=$(out) PREFIX=
inmakeFlags
will place the files in the correct directory but the program itself will not be aware of the files’ location. For example, if the source code is hardcoding
PREFIX "foo"
, it will try to openfoo
instead of$out/foo
.This is usually done when
make install
tries to create a$(DESTDIR)/var
directory but as described above, it can have a negative side effect.With
autotools
you can setinstallFlags = [ "localstatedir=${placeholder "out"}/var" ];
orinstallFlags = [ "sysconfdir=${placeholder "out"}/etc" ];
that should fix most instances of the issue. When the project using hand-writtenMakefile
s, you need to check the files to see how to replace them. In the worst case, especially when the paths are hard-coded in the build files, you will need to patch the build files.The text was updated successfully, but these errors were encountered: