Skip to content

vala-panel-appmenu: init at 25.04 - #374302

Closed
PerchunPak wants to merge 2 commits into
NixOS:masterfrom
PerchunPak:vala-panel-appmenu-init
Closed

PerchunPak wants to merge 2 commits into
NixOS:masterfrom
PerchunPak:vala-panel-appmenu-init

Conversation

@PerchunPak

Copy link
Copy Markdown
Member

https://gitlab.com/vala-panel-project/vala-panel-appmenu: Global Menu for Vala Panel/XFCE/Budgie/Mate

This is required for astal.tray

meta.broken = true; # https://github.com/NixOS/nixpkgs/issues/337630

Closes #337630

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

Add a 👍 reaction to pull requests you find important.

@PerchunPak

PerchunPak commented Jan 16, 2025 •

Copy link
Copy Markdown
Member Author

@mxwee could you test this please?

@github-actions github-actions Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jan 16, 2025
@PerchunPak

This comment was marked as outdated.

@PerchunPak

Copy link
Copy Markdown
Member Author

Tested with hyprpanel, all passthru.tests build on x86_64-linux and aarch64-linux

@PerchunPak

Copy link
Copy Markdown
Member Author

Tried doing something like

env.PKG_CONFIG_GTK__3_0_LIBDIR = "${placeholder "out"}/lib";

and the code only become messier. It also fails to build, and I don't want to debug it.

@mxwee

mxwee commented Jan 18, 2025 •

Copy link
Copy Markdown

@mxwee could you test this please?

I cant possibly test it right now I'm not using nixOS at this moment

@PerchunPak

Copy link
Copy Markdown
Member Author

Tested with hyprpanel, all passthru.tests build on x86_64-linux and aarch64-linux

wait, it doesn't work...

@PerchunPak
PerchunPak marked this pull request as draft January 20, 2025 13:54
@PerchunPak

Copy link
Copy Markdown
Member Author

Not sure what was the problem, but it does work now

@PerchunPak
PerchunPak marked this pull request as ready for review January 22, 2025 11:56
@PerchunPak PerchunPak mentioned this pull request Feb 7, 2025
3 of 13 tasks
@nixos-discourse

Copy link
Copy Markdown

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/5282

@nixos-discourse

Copy link
Copy Markdown

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/5375

@PerchunPak
PerchunPak force-pushed the vala-panel-appmenu-init branch 2 times, most recently from 82ff3c7 to b35410a Compare April 29, 2025 20:16
@PerchunPak

This comment was marked as outdated.

@PerchunPak

This comment was marked as outdated.

@PerchunPak PerchunPak changed the title vala-panel-appmenu: init at 24.05 vala-panel-appmenu: init at 25.04 Apr 29, 2025

@dtomvan dtomvan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like what you did with the enable flags, but one of them is just broken for now. Why include it? And some other nits.

nixpkgs-review result for #374302

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 374302

Logs: https://github.com/dtomvan/nixpkgs-review-gha/actions/runs/14776131383


x86_64-linux

✅ 2 packages built:
  • astal.tray
  • vala-panel-appmenu

aarch64-linux

✅ 2 packages built:
  • astal.tray
  • vala-panel-appmenu

@PerchunPak
PerchunPak force-pushed the vala-panel-appmenu-init branch from b35410a to 2fb81f0 Compare May 1, 2025 13:49
@PerchunPak

This comment was marked as outdated.

@PerchunPak

This comment was marked as outdated.

@JohnRTitor
JohnRTitor requested review from GaetanLepage and jtojnar May 1, 2025 16:56
@PerchunPak
PerchunPak force-pushed the vala-panel-appmenu-init branch 2 times, most recently from 924360d to 31529f4 Compare May 1, 2025 20:04
PerchunPak added a commit to PerchunPak/nixos-dotfiles that referenced this pull request May 1, 2025
@PerchunPak

This comment was marked as outdated.

@PerchunPak

This comment was marked as outdated.

1 similar comment
@GaetanLepage

Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 374302


x86_64-linux

✅ 2 packages built:
  • astal.tray
  • vala-panel-appmenu

aarch64-linux

✅ 2 packages built:
  • astal.tray
  • vala-panel-appmenu

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This does not look right. Should not it rather be:

Suggested change
+ mate_applet_datadir = get_option('datadir') / 'applications'
+ mate_applet_datadir = get_option('datadir') / 'mate-panel' / 'applets'

Same for the other paths.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is mate-panel somehow specific to mate, or is it just an arbitrary name?

I did not test anything except GTK module

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would expect it to be the location where mate-panel looks for applets.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The paths are still wrong. Look at the original path in the diff.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Finally got some time to look at this

You are right! I just got confused from where you took mate-panel/applets

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It tries to write into another package’s tree because the above line essentially calls pkg-config vala-panel --variable applets_data, which will look into vala-panel.pc and see that project’s datadir. It works on other distros because they install everything to /usr but since Nix ditched FHS, we are not so lucky.

Ideally, the project would use pkgconfig_define argument to override the datadir to its own as described in https://www.bassi.io/articles/2018/03/15/pkg-config-and-paths/ but patching it or overriding it in Nixpkgs will be necessary until then.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I am a little bit confused, should I apply your suggestion or we can ignore this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am suggesting that the preferred solution would be opening a merge request against https://gitlab.com/vala-panel-project/vala-panel-appmenu to use pkgconfig_define since then we would not need anything special in Nixpkgs. See https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/6b06341b1465270d784bd68bdc82156b687b8930 for an example.

But if you do not feel like it, the current patch should be fine (after fixing the paths).

@PerchunPak
PerchunPak force-pushed the vala-panel-appmenu-init branch from 31529f4 to f174c4f Compare May 2, 2025 09:26
@FliegendeWurst FliegendeWurst added the 8.has: package (new) This PR adds a new package label May 11, 2025
@PerchunPak
PerchunPak force-pushed the vala-panel-appmenu-init branch 2 times, most recently from 2c3d803 to 82f5159 Compare May 15, 2025 05:53
@PerchunPak

Copy link
Copy Markdown
Member Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 374302


x86_64-linux

✅ 2 packages built:
  • astal.tray
  • vala-panel-appmenu

aarch64-linux

✅ 2 packages built:
  • astal.tray
  • vala-panel-appmenu

@PerchunPak

Copy link
Copy Markdown
Member Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 374302 --package vala-panel-appmenu.passthru.tests


x86_64-linux

✅ 16 packages built:
  • vala-panel-appmenu.passthru.tests.false-false-false-false-
  • vala-panel-appmenu.passthru.tests.false-false-false-true-
  • vala-panel-appmenu.passthru.tests.false-false-true-false-
  • vala-panel-appmenu.passthru.tests.false-false-true-true-
  • vala-panel-appmenu.passthru.tests.false-true-false-false-
  • vala-panel-appmenu.passthru.tests.false-true-false-true-
  • vala-panel-appmenu.passthru.tests.false-true-true-false-
  • vala-panel-appmenu.passthru.tests.false-true-true-true-
  • vala-panel-appmenu.passthru.tests.true-false-false-false-
  • vala-panel-appmenu.passthru.tests.true-false-false-true-
  • vala-panel-appmenu.passthru.tests.true-false-true-false-
  • vala-panel-appmenu.passthru.tests.true-false-true-true-
  • vala-panel-appmenu.passthru.tests.true-true-false-false-
  • vala-panel-appmenu.passthru.tests.true-true-false-true-
  • vala-panel-appmenu.passthru.tests.true-true-true-false-
  • vala-panel-appmenu.passthru.tests.true-true-true-true-

aarch64-linux

✅ 16 packages built:
  • vala-panel-appmenu.passthru.tests.false-false-false-false-
  • vala-panel-appmenu.passthru.tests.false-false-false-true-
  • vala-panel-appmenu.passthru.tests.false-false-true-false-
  • vala-panel-appmenu.passthru.tests.false-false-true-true-
  • vala-panel-appmenu.passthru.tests.false-true-false-false-
  • vala-panel-appmenu.passthru.tests.false-true-false-true-
  • vala-panel-appmenu.passthru.tests.false-true-true-false-
  • vala-panel-appmenu.passthru.tests.false-true-true-true-
  • vala-panel-appmenu.passthru.tests.true-false-false-false-
  • vala-panel-appmenu.passthru.tests.true-false-false-true-
  • vala-panel-appmenu.passthru.tests.true-false-true-false-
  • vala-panel-appmenu.passthru.tests.true-false-true-true-
  • vala-panel-appmenu.passthru.tests.true-true-false-false-
  • vala-panel-appmenu.passthru.tests.true-true-false-true-
  • vala-panel-appmenu.passthru.tests.true-true-true-false-
  • vala-panel-appmenu.passthru.tests.true-true-true-true-

@JohnRTitor

Copy link
Copy Markdown
Member
  • vala-panel-appmenu.passthru.tests.false-false-false-false-
  • vala-panel-appmenu.passthru.tests.false-false-false-true-
  • vala-panel-appmenu.passthru.tests.false-false-true-false-
  • vala-panel-appmenu.passthru.tests.false-false-true-true-
  • vala-panel-appmenu.passthru.tests.false-true-false-false-
  • vala-panel-appmenu.passthru.tests.false-true-false-true-
  • vala-panel-appmenu.passthru.tests.false-true-true-false-
  • vala-panel-appmenu.passthru.tests.false-true-true-true-
  • vala-panel-appmenu.passthru.tests.true-false-false-false-
  • vala-panel-appmenu.passthru.tests.true-false-false-true-
  • vala-panel-appmenu.passthru.tests.true-false-true-false-
  • vala-panel-appmenu.passthru.tests.true-false-true-true-
  • vala-panel-appmenu.passthru.tests.true-true-false-false-
  • vala-panel-appmenu.passthru.tests.true-true-false-true-
  • vala-panel-appmenu.passthru.tests.true-true-true-false-
  • vala-panel-appmenu.passthru.tests.true-true-true-true-

this is confusing as hell

@PerchunPak

Copy link
Copy Markdown
Member Author

this is confusing as hell

Yes, but I don't want to invest hours into making internal stuff less confusing, especially if you just read the source code, it is clear

@GaetanLepage GaetanLepage left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Diff LGTM. I haven't tested it though.

@PerchunPak
PerchunPak force-pushed the vala-panel-appmenu-init branch from 82f5159 to 037a93a Compare May 15, 2025 17:22
@GaetanLepage

Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 374302


x86_64-linux

✅ 2 packages built:
  • astal.tray
  • vala-panel-appmenu

aarch64-linux

✅ 2 packages built:
  • astal.tray
  • vala-panel-appmenu

Comment on lines +63 to +72
++ lib.optionals enableXfce [
xfce.xfce4-panel
xfce.xfconf
]
++ lib.optional enableBudgie budgie-desktop
++ lib.optional enableMate mate.mate-panel-with-applets
++ lib.optionals enableJayatana [
jdk
stripJavaArchivesHook
];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These should likely go to buildInputs.

meta = {
description = "Global Menu for Vala Panel/XFCE/Budgie/Mate";
homepage = "https://gitlab.com/vala-panel-project/vala-panel-appmenu";
license = lib.licenses.lgpl3;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

];

buildInputs =
[

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So what should I do?

Comment on lines +92 to +94
(lib.mesonEnable "jayatana" enableJayatana)
(lib.mesonEnable "appmenu-gtk-module" true)
(lib.mesonOption "appmenu-gtk-module:gtk" "3")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment on lines +101 to +126
tests =
let
combinations =
n: items:
if n == 0 then
[ [ ] ]
else
builtins.concatMap (b: map (l: [ b ] ++ l) (combinations (n - 1) items)) items;
allArgs = combinations 4 [
true
false
];
in
lib.listToAttrs (
lib.forEach allArgs (args: {
name = lib.foldl (acc: a: acc + lib.boolToString a + "-") "" args;
value = vala-panel-appmenu.override {
enableXfce = builtins.elemAt args 0;
enableBudgie = builtins.elemAt args 1;
enableValapanel = false;
enableMate = builtins.elemAt args 2;
enableJayatana = builtins.elemAt args 3;
};
})
);
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we split the registrar, jayatana, appmenu-glib-translator and appmenu-gtk-module out into separate packages, then building this package with all of these disabled should produce an empty package.

I think it should make sense to do that, and then add assert lib.assertMsg (lib.count lib.id [ enableXfce enableBudgie enableValapanel enableMate ] == 1) "Must select a single panel implementation"; to avoid this combinatorial explosion.

endif

if xfce_found
- xfce_applet_datadir = join_paths(xp.get_variable(pkgconfig:'prefix'),datadir,'xfce4','panel','plugins')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

output: 'appmenu-budgie.plugin',
kwargs: desktop_kwargs,
- install_dir: budgie_applet_libdir
+ install_dir: get_option('datadir') / 'budgie-desktop' / 'plugins' / 'budgie-appmenu-plugin'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be in libdir, not datadir https://gitlab.com/vala-panel-project/vala-panel-appmenu/-/blob/25.04/applets/meson.build?ref_type=tags#L32

As, again, there are no specific variables, the budgie_applet_libdir should be patched to use libdir variable, or just set env.PKG_CONFIG_BUDGIE_1_0_LIBDIR = "${placeholder "out"}/lib";

'appmenu-gtk-module', module_sources,
dependencies: gtk3_parser_dep,
install: true,
- install_dir: join_paths(gtk3.get_variable(pkgconfig:'libdir'),'gtk-3.0','modules')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same as above, patch or set env.PKG_CONFIG_GTK__3_0_LIBDIR = "${placeholder "out"}/lib";

dependencies: gtk2_parser_dep,
c_args: '-Wno-deprecated-declarations',
install: true,
- install_dir: join_paths(gtk2.get_variable(pkgconfig:'libdir'),'gtk-2.0','modules')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should not be needed as long we select GTK 3 module to install.

buildInputs = [ json-glib ];
buildInputs = [
json-glib
vala-panel-appmenu

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, looking at the upstream definition, this just needs appmenu-glib-translator so most of the package above is unncecessary.

https://github.com/Aylur/astal/blob/4820a3e37cc8eb81db6ed991528fb23472a8e4de/lib/tray/default.nix#L13-L30

@JohnRTitor

Copy link
Copy Markdown
Member

CC @PerchunPak

@PerchunPak

Copy link
Copy Markdown
Member Author

CC @PerchunPak

I am being stressed at full-time job, so don't really have much power to do open source work. Sorry for late responses, but eventually, I will get to this

@dtomvan dtomvan mentioned this pull request Jun 18, 2025
13 tasks
@PerchunPak
PerchunPak force-pushed the vala-panel-appmenu-init branch from 037a93a to 9f4c1af Compare June 20, 2025 11:44
@github-actions github-actions Bot added 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 12.approvals: 1 This PR was reviewed and approved by one person. labels Jun 20, 2025
@PerchunPak
PerchunPak force-pushed the vala-panel-appmenu-init branch from 9f4c1af to 037a93a Compare June 20, 2025 12:14
@PerchunPak

Copy link
Copy Markdown
Member Author

Thanks everyone for their reviews (especially @jtojnar)!

Unfortunately, packaging this has become a big burden for me, so I will instead focus on packaging only appmenu-glib-translator, which I need. If anyone else wants to continue my work, they are free to do so.

In the last force push, I just reverted my rebase on master (which I did like 10 minutes before)

@PerchunPak PerchunPak closed this Jun 20, 2025
@PerchunPak
PerchunPak deleted the vala-panel-appmenu-init branch June 20, 2025 12:18
@PerchunPak PerchunPak mentioned this pull request Jun 20, 2025
4 of 13 tasks
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: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package request: AppMenu Plugin for XFCE4 & Mate

8 participants