-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
google-fonts: fix on macOS #49085
google-fonts: fix on macOS #49085
Conversation
@GrahamcOfBorg build google-fonts |
Success on aarch64-linux (full log) Attempted: google-fonts Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: google-fonts Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: google-fonts Partial log (click to expand)
|
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec { | |||
dest=$out/share/fonts/truetype | |||
mkdir -p $dest | |||
find . -name "*.ttf" -exec cp -v {} $dest \; | |||
chmod -x $dest/*.ttf | |||
(cd $dest; chmod -x *.ttf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might better to use xargs
and the install
command which can also set the executable bit directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're golfing, lines 40-42 seem equivalent to something like
find . -name '*.ttf' -exec install -Dt $dest '{}' +
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though xargs
may be more portable ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have a lot of small file xargs
is also faster because install
only spawned a few times instead executing it for every file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
install --target directory FILE...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that with GNU find, +
builds command lines similarly to xargs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not know about this.
9affb1f
to
9cc3aaa
Compare
Updated to use @joachifm's suggestion. I had to pass |
@GrahamcOfBorg build google-fonts |
Success on aarch64-linux (full log) Attempted: google-fonts Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: google-fonts Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: google-fonts Partial log (click to expand)
|
Things done:
Small change to the way
chmod -x
is invoked so that the argument list will not be too long for macOS.macOS has a lower limit on the argument list size and
nix-build '<nixpkgs>' -A google-fonts
fails because the argument list passed tochmod
is too long.nix-build --option build-use-chroot true
or nix.useChroot on NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)More
Fixes issue #
cc @
Please note, that points are not mandatory, but rather desired.