Skip to content
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

Merged
merged 1 commit into from Oct 29, 2018
Merged

Conversation

hamishmack
Copy link
Contributor

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 to chmod is too long.

  • Tested using sandboxing (nix-build --option build-use-chroot true or nix.useChroot on NixOS)
  • Built on platform(s)
    • NixOS
    • OS X
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.
More

Fixes issue #

cc @


Please note, that points are not mandatory, but rather desired.

@Mic92 Mic92 changed the title Fix google-fonts on macOS google-fonts: fix on macOS Oct 25, 2018
@Mic92
Copy link
Member

Mic92 commented Oct 25, 2018

@GrahamcOfBorg build google-fonts

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: google-fonts

Partial log (click to expand)

'./ofl/abyssinicasil/AbyssinicaSIL-Regular.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/AbyssinicaSIL-Regular.ttf'
'./ofl/abrilfatface/AbrilFatface-Regular.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/AbrilFatface-Regular.ttf'
'./ofl/abhayalibre/AbhayaLibre-SemiBold.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/AbhayaLibre-SemiBold.ttf'
'./ofl/abhayalibre/AbhayaLibre-Regular.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/AbhayaLibre-Regular.ttf'
'./ofl/abhayalibre/AbhayaLibre-Medium.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/AbhayaLibre-Medium.ttf'
'./ofl/abhayalibre/AbhayaLibre-ExtraBold.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/AbhayaLibre-ExtraBold.ttf'
'./ofl/abhayalibre/AbhayaLibre-Bold.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/AbhayaLibre-Bold.ttf'
'./ofl/abel/Abel-Regular.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/Abel-Regular.ttf'
'./ofl/abeezee/ABeeZee-Regular.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/ABeeZee-Regular.ttf'
'./ofl/abeezee/ABeeZee-Italic.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/ABeeZee-Italic.ttf'

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: google-fonts

Partial log (click to expand)

'./apache/jsmathcmmi10/jsMath-cmmi10.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/jsMath-cmmi10.ttf'
'./apache/fontdinerswanky/FontdinerSwanky-Regular.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/FontdinerSwanky-Regular.ttf'
'./apache/homemadeapple/HomemadeApple-Regular.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/HomemadeApple-Regular.ttf'
'./apache/redressed/Redressed-Regular.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/Redressed-Regular.ttf'
'./apache/cousine/Cousine-Regular.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/Cousine-Regular.ttf'
'./apache/cousine/Cousine-BoldItalic.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/Cousine-BoldItalic.ttf'
'./apache/cousine/Cousine-Bold.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/Cousine-Bold.ttf'
'./apache/cousine/Cousine-Italic.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/Cousine-Italic.ttf'
'./apache/rancho/Rancho-Regular.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/Rancho-Regular.ttf'
/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: google-fonts

Partial log (click to expand)

'./ufl/ubuntu/Ubuntu-LightItalic.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/Ubuntu-LightItalic.ttf'
'./ufl/ubuntu/Ubuntu-Medium.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/Ubuntu-Medium.ttf'
'./ufl/ubuntu/Ubuntu-MediumItalic.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/Ubuntu-MediumItalic.ttf'
'./ufl/ubuntu/Ubuntu-Regular.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/Ubuntu-Regular.ttf'
'./ufl/ubuntucondensed/UbuntuCondensed-Regular.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/UbuntuCondensed-Regular.ttf'
'./ufl/ubuntumono/UbuntuMono-Bold.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/UbuntuMono-Bold.ttf'
'./ufl/ubuntumono/UbuntuMono-BoldItalic.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/UbuntuMono-BoldItalic.ttf'
'./ufl/ubuntumono/UbuntuMono-Italic.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/UbuntuMono-Italic.ttf'
'./ufl/ubuntumono/UbuntuMono-Regular.ttf' -> '/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13/share/fonts/truetype/UbuntuMono-Regular.ttf'
/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13

@@ -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)
Copy link
Member

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.

Copy link
Contributor

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 '{}' +

Copy link
Contributor

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 ...

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

install --target directory FILE...

Copy link
Contributor

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.

Copy link
Member

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.

@hamishmack
Copy link
Contributor Author

Updated to use @joachifm's suggestion. I had to pass -m 444 to install to remove executable bit from the files.

@joachifm
Copy link
Contributor

@GrahamcOfBorg build google-fonts

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: google-fonts

Partial log (click to expand)

removed 'ofl/siamreap/METADATA.pb'
removed 'ofl/siamreap/DESCRIPTION.en_us.html'
removed directory 'ofl/siamreap'
removed 'ofl/terminaldosislight/TerminalDosis-Light.ttf'
removed 'ofl/terminaldosislight/OFL.txt'
removed 'ofl/terminaldosislight/METADATA.pb'
removed 'ofl/terminaldosislight/DESCRIPTION.en_us.html'
removed directory 'ofl/terminaldosislight'
installing
/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: google-fonts

Partial log (click to expand)

removed 'ofl/siamreap/OFL.txt'
removed 'ofl/siamreap/Siemreap.ttf'
removed directory 'ofl/siamreap'
removed 'ofl/terminaldosislight/DESCRIPTION.en_us.html'
removed 'ofl/terminaldosislight/METADATA.pb'
removed 'ofl/terminaldosislight/OFL.txt'
removed 'ofl/terminaldosislight/TerminalDosis-Light.ttf'
removed directory 'ofl/terminaldosislight'
installing
/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: google-fonts

Partial log (click to expand)

removed 'ofl/siamreap/OFL.txt'
removed 'ofl/siamreap/Siemreap.ttf'
removed directory 'ofl/siamreap'
removed 'ofl/terminaldosislight/DESCRIPTION.en_us.html'
removed 'ofl/terminaldosislight/METADATA.pb'
removed 'ofl/terminaldosislight/TerminalDosis-Light.ttf'
removed 'ofl/terminaldosislight/OFL.txt'
removed directory 'ofl/terminaldosislight'
installing
/nix/store/fs525bmwbzjpnmnmi2lscfanlfrx2i2g-google-fonts-2018-07-13

@joachifm joachifm merged commit 3947b88 into NixOS:master Oct 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants