-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Do not set DESTDIR in makeFlags #65718
Copy link
Copy link
Open
Labels
2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md3.skill: sprintableA larger issue which is split into distinct actionable tasksA larger issue which is split into distinct actionable tasks6.topic: best practicesDocumentation and discussion around best practices for Nixpkgs developmentDocumentation and discussion around best practices for Nixpkgs development
Metadata
Metadata
Assignees
Labels
2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md3.skill: sprintableA larger issue which is split into distinct actionable tasksA larger issue which is split into distinct actionable tasks6.topic: best practicesDocumentation and discussion around best practices for Nixpkgs developmentDocumentation and discussion around best practices for Nixpkgs development
Fields
Give feedbackNo fields configured for issues without a type.
DESTDIRis used by some package managers as a poor man’s sandbox, transparent to the package. SettingDESTDIR=$(out) PREFIX=inmakeFlagswill 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 openfooinstead of$out/foo.This is usually done when
make installtries to create a$(DESTDIR)/vardirectory but as described above, it can have a negative side effect.With
autotoolsyou can setinstallFlags = [ "localstatedir=${placeholder "out"}/var" ];orinstallFlags = [ "sysconfdir=${placeholder "out"}/etc" ];that should fix most instances of the issue. When the project using hand-writtenMakefiles, 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.