summary refs log tree commit diff
path: root/pkgs/build-support/setup-hooks/desktop-to-darwin-bundle.sh
AgeCommit message (Collapse)AuthorFilesLines
2022-04-22Merge pull request #165111 from toonn/darwin-bundle-outputBinLassulus1-4/+4
make-darwin-bundle: Use output bin
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-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-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-10build-support: make-darwin-bundle: newMatthew Leach1-0/+48
Add a new module that allows darwin-style application bundles to be created