| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So far the runtimeDependencies variable has been rather useless unless
you also set dontPatchelf, because the patchelf setup hook ran *after*
the autoPatchelfHook and thus stripped off the additional RPATHs added
using runtimeDependencies.
I did this by moving the autoPatchelfHook to be run in postFixup instead
of fixupOutput, however I needed to replicate the for loop that runs the
hook on all outputs.
Until we have a way to influence order of execution for hooks I've
marked this with an XXX so that we can use fixupOutput again.
Tested this against all packages that use autoPatchelfHook using the
following and checking whether the output contains any errors concerning
shared libraries:
nix-build -E 'with import ./. { config.allowUnfree = true; };
runCommand "test-executables" {
drvs = [
masterpdfeditor franz zoom-us anydesk teamviewer maxx
oracle-instantclient cups-kyodialog3 virtlyst powershell
];
} "for i in $drvs; do for b in $i/bin/*; do \"$b\" || :; done; done"
'
Signed-off-by: aszlig <aszlig@nix.build>
Fixes: https://github.com/NixOS/nixpkgs/issues/43082
Cc: @Ericson2314
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A .la file specifies linker flags to link with the library it describes. Its
"dependency_libs" field lists the libraries that this library depends upon.
This list often contains "-l" flags without corresponding "-L" flags. Many
packages in Nixpkgs deal with this in one of these ways:
- delete .la file [1]
- clear dependency_libs [2]
- add -L flags to dependency_libs [3]
- propagate dependencies [4]
Sometimes "dependency_libs" contain wrong "-L" flags pointing to the "dev"
output with headers rather than to the main output with libraries. They have to
be edited or deleted to reduce closure size [5].
Deleting .la files is often but not always safe [6]. Atomatically deleting as
many of them as possible is complex [7]. Deleting .la files that describe
shared rather than static libraries is probably safe; but clearing their
"dependency_libs" field achieves the same effect with less potential for
unintended consequences. This is the approach that may be enabled for all
Nixpkgs.
[1] https://github.com/NixOS/nixpkgs/commit/2a79d296d3de74da77b49ca8dc9d356b1a7a1c8d
[2] https://github.com/NixOS/nixpkgs/commit/c83a53098599c49ec57823bf655ce8b45f6aea10
[3] https://github.com/NixOS/nixpkgs/commit/9e0dcf3bd9fcfeed576132b9101b866aa3cb76ff
[4] https://github.com/NixOS/nixpkgs/commit/01134e698fdfb3b61f8ab8ec3bf13e0718f63955
[5] https://github.com/NixOS/nixpkgs/commit/f6c73f1e37c735abb686d07449f349b796c54cf8
[6] https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Handling_Libtool_Archives
[7] https://github.com/gentoo/gentoo/blob/fb1f2435/eclass/ltprune.eclass
|
|
|
|
|
|
|
|
|
|
|
| |
If there is a shared object or executable that's using
position-independent code, the file's mime type is
"application/x-pie-executable", so until this change its dependencies
wouldn't be patched.
This simply adds the mime type to the search loop.
Signed-off-by: aszlig <aszlig@nix.build>
|
|
|
|
|
| |
Also fix some setup hooks that unnecessarily used environment hooks,
which revolted in the same variable being modified too many times.
|
|\
| |
| | |
descent 1 & 2: use assets from gog.com with the dxx-rebirth project
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I originally wrote this for packaging proprietary games in Vuizvui[1]
but I thought it would be generally useful as we have a fair amount of
proprietary software lurking around in nixpkgs, which are a bit tedious
to maintain, especially when the library dependencies change after an
update.
So this setup hook searches for all ELF executables and libraries in the
resulting output paths after install phase and uses patchelf to set the
RPATH and interpreter according to what dependencies are available
inside the builder.
For example consider something like this:
stdenv.mkDerivation {
...
nativeBuildInputs = [ autoPatchelfHook ];
buildInputs = [ mesa zlib ];
...
}
Whenever for example an executable requires mesa or zlib, the RPATH will
automatically be set to the lib dir of the corresponding dependency.
If the library dependency is required at runtime, an attribute called
runtimeDependencies can be used to list dependencies that are added to
all executables that are discovered unconditionally.
Beside this, it also makes initial packaging of proprietary software
easier, because one no longer has to manually figure out the
dependencies in the first place.
[1]: https://github.com/openlab-aux/vuizvui
Signed-off-by: aszlig <aszlig@nix.build>
Closes: #34506
|
|/
|
|
|
|
| |
Close #33281. Edits by vcunat:
- use Eelco's idea: empty file instead of full copy
- use longer name suffix to decrease the likelihood of collision
|
|
|
|
|
| |
This commits needs a MAJOR audit as I oftentimes just guessed which of
`$hostOffset`, `$targetOffset`, or a fixed offset should be used.
|
|
|
|
|
| |
`dontStrip` is still a catch-all, but `dontStripHost` and
`dontStripTarget` are also now available for finer-grained disabling.
|
|
|
|
|
| |
This hook sets LD to CC, for use with software that works as if LD=$CC when LD
is unset, and does not work when LD=ld.
|
|
|
|
| |
This is more robust for cross-compilation
|
|\
| |
| | |
stdenv: Move devhelp books to outputDevdoc
|
| | |
|
|\ \
| | |
| | | |
stdenv setup: Always use both propagated files
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This continues #23374, which always kept around both attributes, by
always including both propagated files: `propgated-native-build-inputs`
and `propagated-build-inputs`. `nativePkgs` and `crossPkgs` are still
defined as before, however, so this change should only barely
observable.
This is an incremental step to fully keeping the dependencies separate
in all cases.
|
| |
| |
| |
| | |
because --run is good enough.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After #31497 starter quoting all values, there arouse the need to left some
values evaluated.
`--set-default var value` expands to `export var=${var-value}`, where value is
not evaluated and literally assigned to var unless it is already set.
`--set-eval var value` expands to `export var=$(eval echo value)`, where value
is evaluated by `eval`.
|
|/
|
|
|
|
|
| |
This uses Bash ${foo@Q} feature to quote values properly, which allows us to
handle values containing spaces, dollars etc.
Thanks orivej for the idea!
|
|
|
|
|
| |
> bash: warning: command substitution: ignored null byte in input
/cc #28227. Also break the overlong line.
|
|
|
|
|
| |
`findInputs` is a stdenv/setup helper we should strive not to call
elsewhere. Using normal deps is more idiomatic anyways.
|
|\ |
|
| | |
|
| |
| |
| |
| | |
set-source-date-epoch-to-latest.sh to ignore files newer than "$NIX_BUILD_TOP/.." (unlike "$NIX_BUILD_TOP" it is root-owned and cannot be touched by nixbld1).
|
| | |
|
| |
| |
| |
| |
| | |
All the other plain variable references (before e1d46c0c4) are without
braces.
|
| |
| |
| |
| |
| |
| | |
Because if you were to disable man pages via 'programs.man.enable',
the "man" output wouldn't be installed and the info pages would go
missing.
|
| |
| |
| |
| |
| | |
Because .doc is normally not installed to user environments, these
manpages are unaccessible by default otherwise.
|
|\ \
| |/
|/| |
replace "Mac OS X" and "OS X" with "macOS"
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
as it is the official name since 2016
https://en.wikipedia.org/wiki/Macintosh_operating_systems#Desktop
exception are parts refering to older versions of macOS like
"GUI support for Mac OS X 10.6 - 10.12. Note that Emacs 23 and later [...]"
|
| |
| |
| |
| |
| | |
In some cases wrappers could not be made. See e.g.
https://github.com/NixOS/nixpkgs/pull/24944#issuecomment-321175692
|
|\ \
| | |
| | | |
makeWrapper: Fail loudly when misused
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`makeWrapper` and `wrapProgram` are being invoked on all kinds of
wacky things (usually with the help of bash globs or other machine
assistance).
So far, I have come across `wrapProgram` being invoked on a directory,
as well as on the empty string.
As far as I can tell, it's only valid to invoke these utilities on a
normal (non-directory, non-device) executable file. This commit
enforces that precondition.
|
|\ \
| | |
| | | |
Fix makewrapper unsupported args
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously, makeWrapper would accept arguments it didn't recognize,
potentially allowing argument misspellings or broken callers.
Now, makeWrapper dies with a backtrace if it is called incorrectly.
Also changes `wrapProgram` so that it doesn't pass through the first
argument twice --- this was tripping up the argument checking.
|
| |/
| |
| |
| |
| | |
Calling `die "Error message"` causes the current script to exit with
an error, printing a backtrace
|
|\ \
| |/
|/| |
polari: unbreak
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some programs store the executable in a different place and link it
from the `bin` directory. For example, Polari links `$out/bin/polari`
to `$out/share/polari/org.gnome.Polari`. `wrapGAppsHook` did not follow
symlinks so it was not able to wrap Polari, making it unable to access
GObject introspection definitions required for running the program.
I made the wrapping script follow symlinks to fix this corner case.
|
|/
|
|
|
|
|
|
| |
This setup hook is propagated by gdb. Thus, a typical use is:
$ nix-shell -p gdb nix nix.debug sqlite.debug ...
and gdb will be able find the debug symbols of nix etc. automatically.
|
|
|
|
|
|
|
|
|
|
| |
As @oxij points out in [1], this breakage is especially serious because
it changes the contents of built environments without a corresonding
change in their hashes. Also, the revert is easier than I thought.
This reverts commit 3cb745d5a69018829ac15f7d5a508135f6bda123.
[1]: https://github.com/NixOS/nixpkgs/pull/27427#issuecomment-317293040
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes those files a bit easier to read. Also, for what it's worth,
it brings us one baby step closer to handling spaces in store paths.
Also, I optimized handling of many transitive deps with read. Probably,
not very beneficial, but nice to enforce the pkg-per-line structure.
Doing so let me find much dubious code and fix it.
Two misc notes:
- `propagated-user-env-packages` also needed to be adjusted as
sometimes it is copied to/from the propagated input files.
- `local fd` should ensure that file descriptors aren't clobbered
during recursion.
|
|
|
|
|
|
|
|
|
|
| |
This will override the existing winsymlinks setting. nativestrict
will cause ln to fail if it's unable to create a native symlink.
Native symlinks are required for the windows dll loader to find the
libraries.
This script is also used for cross-mingw, but setting CYGWIN
shouldn't cause a problem.
|
| |
|
| |
|
|\
| |
| | |
wrapGAppsHook: Correct `wrapProgram` invocations
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This change fixes several defects in the way `wrapGAppsHook` selected
the executable to wrap.
Previously, it would wrap any top-level files in the target `/bin` and
`/libexec` directories, including directories and non-executable
files. In addition, it failed to wrap files in subdirectories.
Now, it uses `find` to iterate over these directory hierarchies,
selecting only executable files for wrapping.
|
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 8b9f153bb9c8156ec4f3d56d61845e432d19dcd6 of
https://github.com/NixOS/nixpkgs/pull/25183 because it breaks builds of
packages that don't install both a "bin" and a "libexec" directory. See
https://github.com/NixOS/nixpkgs/pull/25183#issuecomment-298064769 for more
details.
|
|\ \
| | |
| | | |
wrapGAppsHook: Correct `wrapProgram` invocations
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This change fixes several defects in the way `wrapGAppsHook` selected
the executable to wrap.
Previously, it would wrap any top-level files in the target `/bin` and
`/libexec` directories, including directories and non-executable
files. In addition, it failed to wrap files in subdirectories.
Now, it uses `find` to iterate over these directory hierarchies,
selecting only executable files for wrapping.
|
|/ |
|