about summary refs log tree commit diff
path: root/pkgs/build-support/setup-hooks
AgeCommit message (Collapse)AuthorFilesLines
2022-06-12Merge pull request #172769 from ncfavier/wrappers-append-argsThiago Kenji Okada2-38/+60
makeWrapper,makeBinaryWrapper: implement `--append-flags`
2022-05-31makeBinaryWrapper: fix cross-compilation and add testNaïm Favier1-2/+3
Fixes https://github.com/NixOS/nixpkgs/issues/175045
2022-05-30makeWrapper,makeBinaryWrapper: implement `--append-flags`Naïm Favier2-38/+60
2022-05-22makeBinaryWrapper: fix codesign on aarch64-darwinNaïm Favier1-2/+1
Reverts 8b79ef2c on aarch64-darwin, no-op on other platforms.
2022-05-12makeBinaryWrapper: add commentNaïm Favier1-3/+1
2022-05-12makeBinaryWrapper: add extractCmdNaïm Favier2-3/+10
A small shell script that can be used to extract a binary wrapper's makeCWrapper call from its embedded docstring, without depending on makeBinaryWrapper.
2022-05-10makeWrapper: implement --inherit-argv0Naïm Favier2-13/+14
For symmetry/interoperability with makeBinaryWrapper. Implemented as --argv0 '$0'
2022-05-10makeBinaryWrapper: remove cc from depsNaïm Favier1-1/+4
Fixes https://github.com/NixOS/nixpkgs/issues/172249
2022-05-10wrapGAppsHook: rename argument to makeWrapperNaïm Favier1-2/+2
...and pass it makeBinaryWrapper in all-packages.nix
2022-05-10makeWrapper,makeBinaryWrapper: introduce explicitly named functionsNaïm Favier2-4/+8
Because both versions might end up in a derivation's build inputs, it might be useful to be able to explicitly select which function to use.
2022-05-10makeBinaryWrapper: move into its own folderNaïm Favier2-1/+21
The derivation is complex enough to warrant moving out of all-packages.nix
2022-05-06makeBinaryWrapper: really unset NIX_CFLAGSNaïm Favier1-2/+1
https://github.com/NixOS/nixpkgs/commit/f8cc8ff5755528d9a73671481ba3d6fb00f4e8d5 fails to unset the variables in the environment due to a Bash quirk, so set them to the empty string instead.
2022-05-06makeBinaryWrapper: add -Wno-overlength-stringsNaïm Favier1-0/+1
The generated C code contains large string literals that are longer than the maximum length specified by the standard. However, GCC has no trouble dealing with those strings, so we can just add -Wno-overlength-strings. https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Woverlength-strings
2022-04-26makeBinaryWrapper: unset NIX_CFLAGSNaïm Favier1-0/+2
Prevent the wrapper from being affected by the derivation's CFLAGS, which may not even apply to GCC.
2022-04-26wrapGAppsHook: use makeBinaryWrapperNaïm Favier2-16/+17
Reduces the likelihood of having apps wrapped twice by a shell script, which causes problems with argv0.
2022-04-22Merge pull request #165111 from toonn/darwin-bundle-outputBinLassulus1-4/+4
make-darwin-bundle: Use output bin
2022-04-20Merge pull request #165112 from toonn/darwin-bundle-Exec-field-codesDomen Kožar1-2/+22
desktopToDarwinBundle: Patch Exec field codes
2022-04-18Merge pull request #168932 from hercules-ci/init-postgresqlTestHookRobert Hensing3-0/+115
`postgresqlTestHook`: init
2022-04-16postgresqlTestHook: initRobert Hensing3-0/+115
2022-04-16Merge remote-tracking branch 'origin/master' into staging-nextMartin Weinelt1-3/+4
2022-04-15autoPatchelfHook: fix precise dependency ignoranceLin Yinfeng1-3/+4
This commit fixes precise dependency ignorance by converting the environment variable `autoPatchelfIgnoreMissingDeps` into a bash array `ignoreMissingDepsArray`, passing `"${ignoreMissingDepsArray[@]}"` instead of `"${autoPatchelfIgnoreMissingDeps[@]}"` to the python script. The original implementation does not work when `autoPatchelfIgnoreMissingDeps` contains multiple dependency names. Because it mistakenly passes `"${autoPatchelfIgnoreMissingDeps[@]}"` to the python script. According to the Nix manual (https://nixos.org/manual/nix/stable/expressions/derivations.html), lists of strings are concatenated into whitespace-separated strings, then passed to the builder as environment variables. So, if `autoPatchelfIgnoreMissingDeps = [ "dep1" "dep2" "dep3" ]`, `"${autoPatchelfIgnoreMissingDeps[@]}"` will be expanded to a single argument `"dep1 dep2 dep3"`, which is not the intended behavior, because the python script takes the long argument as a dependency name. With this commit, `"${ignoreMissingDepsArray[@]}"` will be expanded to three arguments `"dep1" "dep2" "dep3"` arguments as expected, fixing the issue.
2022-04-14Merge branch 'staging-next' into stagingVladimír Čunát2-18/+31
Minor conflicts; I hope I didn't mess up: pkgs/development/tools/misc/binutils/default.nix pkgs/games/openjk/default.nix
2022-04-12Merge pull request #167397 from samuela/samuela/autopatchelfSamuel Ainsworth2-18/+31
autoPatchelfHook: more precise dependency ignorance
2022-04-11autoPatchelfHook: more precise dependency ignoranceSamuel Ainsworth2-18/+31
2022-04-07Merge remote-tracking branch 'origin/staging-next' into stagingzowoq1-4/+5
Conflicts: pkgs/development/compilers/go/2-dev.nix
2022-04-07copyDesktopItems: Use variable for repeated pathtoonn1-6/+5
Co-authored-by: K900 <me@0upti.me>
2022-04-07copyDesktopItems: Use bin outputtoonn1-4/+6
Desktop files are only useful when accompanied by the binaries they specify. So it makes more sense to put them next to the binaries rather than `$out` which only usually contains the binaries.
2022-03-31desktopToDarwinBundle: Implement %F and %U Exec field codestoonn1-1/+1
Similar to the implementation of the `%f` and `%u` field codes. In this case the amount of arguments passed poses no problem but the position could, at least in theory. This finishes the implementation of all the non-deprecated field codes. As a part of that, repetitions of field codes are left alone. Originally all field codes were removed. Now we replace only the first occurence. This is correct for at least `%f`, `%u`, `%F` and `%U` because at most one of them is permitted. Shortcomings: 1. We replace `%[cfFikuU]` patterns one at a time. This means if the right field code appears as part of the rest of the `Exec` field or in a field code that was substituted earlier. 2. If any field code is repeated, only the first occurence is substituted.
2022-03-31desktopToDarwinBundle: Implement %f and %u Exec field codestoonn1-1/+2
`%f` and `%u` are used to signal the program only accepts a single file or URI argument. I do not believe there's a way to signal this information to macOS but it is possible the program really won't work if multiple files are passed and it's possible the relative position of `%i`, `%c` or `%k` matters. So we replace `%f` or `%u` with `$1`. That way we only pass one file in the (possibly significant) position of the field code.
2022-03-31desktopToDarwinBundle: Implement %i Exec field codetoonn1-1/+3
2022-03-31desktopToDarwinBundle: Implement %c Exec field codetoonn1-1/+2
2022-03-31desktopToDarwinBundle: Implement %k Exec field codetoonn1-5/+12
2022-03-31desktopToDarwinBundle: Change empty directory testtoonn1-1/+1
`ls -1 "$iconsdir/"*` listed the source directory for me when the glob had no matches. Switching to `-A` circumvents this problem and has the added advantage that it cannot run into argument list length limits.
2022-03-30desktopToDarwinBundle: Add X-macOS-Exec and log editing Exectoonn1-2/+10
Co-authored-by: milahu <milahu@gmail.com>
2022-03-30desktopToDarwinBundle: Complete field code removaltoonn1-1/+2
Checked the desktop entry spec, there's other field codes than `%[fFuU]` and those can in fact occur more than once, hence dropping '$' and adding `/g`.
2022-03-30desktopToDarwinBundle: Fixup Exectoonn1-1/+1
The "Exec" key in desktop items sometimes has one of the `%f`, `%F`, `%u` and `%U` suffixes, which specify whether the command takes a file, multiple files or a generalized URL or URLs. Darwin application bundles do no understand this syntax so we do the next best thing, which is simply dropping it.
2022-03-25Merge staging-next into staginggithub-actions[bot]1-11/+37
2022-03-24Merge pull request #163623 from ilya-fedin/fix-mate-utils-inkscapeJosé Romildo Malaquias1-4/+0
nixos/wrap-gapps-hook: don't add data directories of icon dependencies into XDG_DATA_DIRS
2022-03-21desktopToDarwinBundle: Fall back to scaling availabletoonn1-1/+32
Sometimes scalable icons or icons within the thresholds from the desired resolutions aren't available. In this case it's still nicer to end up with a blocky scaled icon rather than the generic default.
2022-03-21desktopToDarwinBundle: Include TOC in generated ICNS filetoonn1-1/+1
In order to compose a `.icns` file containing multiple icon sizes I had to pass `--toc` to `icnsutil`. This did not seem to have a negative effect on `.icns` containing only a single icon size.
2022-03-21desktopToDarwinBundle: Simplify double negationtoonn1-1/+1
2022-03-21desktopToDarwinBundle: Drop 48x48 sizetoonn1-8/+3
On macOS 10.13 the 48x48 icon size is not supported. It results in a corrupted image being displayed. I suspect the image data is being truncated to what it expects for 32x32 or maybe data is read for 128x128, which would be a buffer overflow.
2022-03-21make-darwin-bundle: Use actual bin outputtoonn1-4/+4
The script and the hook assume `/bin` is in `$out` but that's not always true for a multi-output derivation.
2022-03-18makeWrapper: add `--chdir`Naïm Favier1-0/+5
For symmetry with `makeBinaryWrapper`.
2022-03-11nixos/wrap-gapps-hook: don't add data directories of icon dependencies into ↵Ilya Fedin1-4/+0
XDG_DATA_DIRS As discussed in https://github.com/NixOS/nixpkgs/issues/163590, it's not really required and has a side effect of adding refeferences to packages from nativeBuildInputs that aren't really required
2022-03-02Merge master into staging-nextgithub-actions[bot]1-16/+141
2022-03-01desktopToDarwinBundle: use Bash arithmeticRandy Eckenrode1-9/+9
Co-authored-by: Uri Baghin <uri@canva.com>
2022-03-01desktopToDarwinBundle: support 48x48 iconsRandy Eckenrode1-1/+10
2022-02-23desktopToDarwinBundle: fix squircle iconsRandy Eckenrode1-16/+132
- Convert icons to a single .icns file; and - Provide an opt-out via X-macOS-Squircle in the desktop item to override the squircle behavior when the source icons look bad when converted automatically.
2022-02-12makeWrapper: Don't glob in prefix/suffixtalyz1-1/+17
Disable file globbing in --prefix/--suffix, since bash will otherwise try to find filenames matching the the value to be prefixed/suffixed if it contains characters considered wildcards, such as `?` and `*`. We want the value as is, except we also want to split it on on the separator; hence we can't quote it.