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

zutty: init at 0.14 #257156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

zutty: init at 0.14 #257156

wants to merge 1 commit into from

Conversation

quag
Copy link
Contributor

@quag quag commented Sep 24, 2023

Description of changes

https://tomscii.sig7.se/zutty/
https://github.com/tomscii/zutty

Issue: Hard coding fontpath to ucs-fonts

Note: I've set the fonts directory to be ucs-fonts--the fonts that Zutty was designed for. Zutty does not support searching for fonts using fontconfig and the author has rejected suggestions to support nix/guix or fontconfig instead scanning a hard coded fonts path, or relying on Xresources or command line options. An alternative approach would be to have override-able options for setting the font package and font name. I welcome other suggestions or advice.

From the zutty's author:

The author of Zutty prefers the so-called misc-fixed fonts. These are upgraded, extended versions of the bitmap fonts originally designed for the X Window System, created in the '80s in an era of much inferior computer displays. Their availability is universal; you probably have them installed already. These fonts are highly optimized for readability at low resolutions.
https://tomscii.sig7.se/zutty/doc/USAGE.html#Recommended%20fonts

I see a downside in adding a dependency on fontconfig.
The problem is due to the idiosyncrasy of nix/guix -- hardly any other platform resembling unix is going to have this issue.
https://github.com/tomscii/zutty/issues/28#issuecomment-840747494

Closing because Zutty already has appropriate facilities allowing the user to set up where it should look for fonts.
https://github.com/tomscii/zutty/issues/66#issuecomment-1033503585

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@AndersonTorres
Copy link
Member

Squash commits.

@quag
Copy link
Contributor Author

quag commented Sep 25, 2023

Squash commits.

Squashed! Thanks.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/2707

Copy link
Member

@AndersonTorres AndersonTorres left a comment

Choose a reason for hiding this comment

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

Move the default.nix file to by-name/zu/zutty/package.nix

pkgs/applications/terminal-emulators/zutty/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/zutty/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/zutty/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/zutty/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/zutty/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/zutty/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/zutty/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
@quag
Copy link
Contributor Author

quag commented Oct 2, 2023

Made the suggested changes. Thanks for teaching me about the new by-name/zu/zutty/package.nix approach.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/2724

pkgs/by-name/zu/zutty/package.nix Outdated Show resolved Hide resolved
Comment on lines +23 to +26
postPatch = ''
substituteInPlace src/options.h \
--replace /usr/share/fonts ${ucs-fonts}/share/fonts
'';
Copy link
Member

Choose a reason for hiding this comment

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

I'd probably add a isNixOS ? true and set the path to /run/current-system/sw/share/X11/fonts accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we set the font path to /run/current-system/sw/share/X11/fonts, isn't there a risk that the ucs-fonts won't be installed, and zutty will fail to start as it can't find it's default font (9x18)?

I'm really not sure the right way to package zutty here. Perhaps make it so you can configure both the default font and the font path?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants