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

mlterm: Add support for many build configuration variables #226218

Merged
merged 5 commits into from
Apr 21, 2023

Conversation

doronbehar
Copy link
Contributor

Motivation for this change

I wanted to be able to decoratively and elegantly enable or disable features, specifically wayland features.

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/)
  • 22.05 Release Notes (or backporting 21.11 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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@doronbehar doronbehar force-pushed the pkg/mlterm-wayland branch 2 times, most recently from 88b595b to 498853d Compare April 15, 2023 00:30
@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label Apr 15, 2023
@ofborg ofborg bot requested a review from Atemu April 15, 2023 00:32
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 labels Apr 15, 2023
pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
nativeBuildInputs = [
pkg-config
autoconf
] ++ addIfHas "mlconfig" toolsChoices [
Copy link
Member

Choose a reason for hiding this comment

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

Something tells me this is not the best way to do this.
It looks like searching a hash table.

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 prefer individual boolean flags rather than list flags. Lists don't compose very well with overrides.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd prefer individual boolean flags rather than list flags. Lists don't compose very well with overrides.

Composing overrides indeed that would have been ideal, but these lists are not that long, and users using them should anyway read the source code, and choose the list they want to be compiled.

Something tells me this is not the best way to do this. It looks like searching a hash table.

I'm open to suggestions. Unless you'd both insist that it's better to use boolean flags.

Copy link
Member

Choose a reason for hiding this comment

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

Discussion on a third alternative which you already implemented: #226218 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

I suggest inline this, using lib.elem x list

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suggest inline this, using lib.elem x list

That was I missing, thanks!

Copy link
Member

@Atemu Atemu left a comment

Choose a reason for hiding this comment

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

Result of nixpkgs-review pr 226218 run on aarch64-darwin 1

2 packages failed to build:
  • mlterm
  • mlterm-wayland

For Darwin support, we need to disable Xorg and enable the quartz GUI toolkit.


Despite all my nitpickings and change requests, I am absolutely in support of this PR; this is great!

pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
libX11
gtk
vte
] ++ lib.optionals (imagelibChoice == "gdk-pixbuf") [
Copy link
Member

Choose a reason for hiding this comment

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

Nit: If you use optionals that often, just inherit it from lib once and stop the lib. spam.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nit: If you use optionals that often, just inherit it from lib once and stop the lib. spam.

I don't mind this spam that much personally, I copy paste these lines anyway, and it will save me only 4 letters. Will do it if you insist.

Copy link
Member

Choose a reason for hiding this comment

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

I won't insist, it just goes against the DRY principle.

pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
libX11
gtk
vte
] ++ lib.optionals (imagelibChoice == "gdk-pixbuf") [
Copy link
Member

Choose a reason for hiding this comment

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

I won't insist, it just goes against the DRY principle.

pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
@ofborg ofborg bot requested a review from Atemu April 17, 2023 16:29
@doronbehar
Copy link
Contributor Author

mlterm now builds on Darwin as well, according to ofborg.

Copy link
Member

@Atemu Atemu left a comment

Choose a reason for hiding this comment

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

Diff looks very good now. Some minor things, then it's ready I think.

Result of nixpkgs-review pr 226218 run on aarch64-darwin 1

1 package built:
  • mlterm (mlterm-wayland)

pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
@ofborg ofborg bot requested a review from Atemu April 18, 2023 13:53
@doronbehar
Copy link
Contributor Author

I have a branch with most commits squashed, ready to be pushed here.

Copy link
Member

@Atemu Atemu left a comment

Choose a reason for hiding this comment

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

Result of nixpkgs-review pr 226218 run on aarch64-darwin 1

1 package built:
  • mlterm (mlterm-wayland)

@github-actions github-actions bot added 6.topic: emacs Text editor 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: haskell 6.topic: kernel The Linux kernel 6.topic: LXQt The Lightweight Qt Desktop Environment 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: ocaml 6.topic: python 6.topic: rust 6.topic: TeX Issues regarding texlive and TeX in general 6.topic: vscode labels Apr 18, 2023
@github-actions github-actions bot removed 6.topic: python 6.topic: rust 6.topic: haskell 6.topic: TeX Issues regarding texlive and TeX in general 8.has: documentation 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: vscode 6.topic: LXQt The Lightweight Qt Desktop Environment labels Apr 18, 2023
@doronbehar
Copy link
Contributor Author

Could you also lower case the commit message?

Which one? I pushed the rebased branch, with fewer commit messages.

Copy link
Member

@Atemu Atemu left a comment

Choose a reason for hiding this comment

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

All the ones that are upper case ;)

I'd squash the desktopItem related commits.

pkgs/top-level/all-packages.nix Show resolved Hide resolved
@ofborg ofborg bot added the ofborg-internal-error Ofborg encountered an error label Apr 18, 2023
@ofborg ofborg bot requested a review from Atemu April 18, 2023 18:41
@doronbehar doronbehar removed the ofborg-internal-error Ofborg encountered an error label Apr 18, 2023
Copy link
Member

@Atemu Atemu left a comment

Choose a reason for hiding this comment

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

This is GTG I think.

Any last objections?

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.

LGTM overall

pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
pkgs/applications/terminal-emulators/mlterm/default.nix Outdated Show resolved Hide resolved
@doronbehar
Copy link
Contributor Author

With your permission, I'll merge this when CI is green, in the next few hours.

@ofborg ofborg bot requested a review from Atemu April 21, 2023 10:25
@Atemu
Copy link
Member

Atemu commented Apr 21, 2023

We don't need to wait on aarch64-darwin CI, it's dog slow and I already tested it.

@Atemu Atemu merged commit dbc1a5e into NixOS:master Apr 21, 2023
@doronbehar
Copy link
Contributor Author

I will note here that something went wrong with the compilation of the libexec/mlterm/mlconfig tool - no matter what is the value of --with-tools it doesn't get compiled... Seems like an upstream issue to me. Will have a look at it later.

@doronbehar
Copy link
Contributor Author

Fix in #232706

@doronbehar doronbehar deleted the pkg/mlterm-wayland branch June 8, 2024 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants