Repository navigation
vala-panel-appmenu: init at 25.04 - #374302
PerchunPak wants to merge 2 commits into
Conversation
|
@mxwee could you test this please? |
This comment was marked as outdated.
This comment was marked as outdated.
|
Tested with hyprpanel, all |
|
Tried doing something like nixpkgs/pkgs/by-name/xa/xapp/package.nix Line 97 in 77b1381 and the code only become messier. It also fails to build, and I don't want to debug it. |
I cant possibly test it right now I'm not using nixOS at this moment |
wait, it doesn't work... |
|
Not sure what was the problem, but it does work now |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
82ff3c7 to
b35410a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
dtomvan
left a comment
There was a problem hiding this comment.
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
x86_64-linux
✅ 2 packages built:
- astal.tray
- vala-panel-appmenu
aarch64-linux
✅ 2 packages built:
- astal.tray
- vala-panel-appmenu
b35410a to
2fb81f0
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
924360d to
31529f4
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
1 similar comment
|
There was a problem hiding this comment.
This does not look right. Should not it rather be:
| + mate_applet_datadir = get_option('datadir') / 'applications' | |
| + mate_applet_datadir = get_option('datadir') / 'mate-panel' / 'applets' |
Same for the other paths.
There was a problem hiding this comment.
Is mate-panel somehow specific to mate, or is it just an arbitrary name?
I did not test anything except GTK module
There was a problem hiding this comment.
I would expect it to be the location where mate-panel looks for applets.
There was a problem hiding this comment.
The paths are still wrong. Look at the original path in the diff.
There was a problem hiding this comment.
Finally got some time to look at this
You are right! I just got confused from where you took mate-panel/applets
There was a problem hiding this comment.
By the way, you can override pkg-config variables with environment variables:
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I am a little bit confused, should I apply your suggestion or we can ignore this?
There was a problem hiding this comment.
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).
31529f4 to
f174c4f
Compare
2c3d803 to
82f5159
Compare
|
|
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
left a comment
There was a problem hiding this comment.
Diff LGTM. I haven't tested it though.
82f5159 to
037a93a
Compare
|
| ++ 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 | ||
| ]; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
| license = lib.licenses.lgpl3; | |
| license = lib.licenses.lgpl3Plus; |
| ]; | ||
|
|
||
| buildInputs = | ||
| [ |
There was a problem hiding this comment.
There is appmenu-glib-translator dependency, which should probably be unvendored (built as a separate package):
Though looking at the OpenMandriva package, this is the upstream:
| (lib.mesonEnable "jayatana" enableJayatana) | ||
| (lib.mesonEnable "appmenu-gtk-module" true) | ||
| (lib.mesonOption "appmenu-gtk-module:gtk" "3") |
There was a problem hiding this comment.
These and the registrar appear to be independent packages, not sure why they are included in as subprojects:
If we need them, they should become separate packages:
https://gitlab.com/vala-panel-project/vala-panel-appmenu/-/blob/f05d28d805a22a7564895aa178772361c44b6b7a/subprojects/registrar/meson.build
https://gitlab.com/vala-panel-project/vala-panel-appmenu/-/blob/f05d28d805a22a7564895aa178772361c44b6b7a/subprojects/jayatana/meson.build
| 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; | ||
| }; | ||
| }) | ||
| ); | ||
| }; |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
| output: 'appmenu-budgie.plugin', | ||
| kwargs: desktop_kwargs, | ||
| - install_dir: budgie_applet_libdir | ||
| + install_dir: get_option('datadir') / 'budgie-desktop' / 'plugins' / 'budgie-appmenu-plugin' |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
Should not be needed as long we select GTK 3 module to install.
| buildInputs = [ json-glib ]; | ||
| buildInputs = [ | ||
| json-glib | ||
| vala-panel-appmenu |
There was a problem hiding this comment.
Actually, looking at the upstream definition, this just needs appmenu-glib-translator so most of the package above is unncecessary.
|
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 |
037a93a to
9f4c1af
Compare
9f4c1af to
037a93a
Compare
|
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 In the last force push, I just reverted my rebase on master (which I did like 10 minutes before) |
https://gitlab.com/vala-panel-project/vala-panel-appmenu: Global Menu for Vala Panel/XFCE/Budgie/Mate
This is required for
astal.traynixpkgs/pkgs/development/libraries/astal/modules/tray.nix
Line 9 in ffeebf0
Closes #337630
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.