Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 670722 - media-sound/lmms-9999: sandbox violation
Summary: media-sound/lmms-9999: sandbox violation
Status: IN_PROGRESS
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Alexis Ballier
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-11-09 01:36 UTC by Samuel Bauer
Modified: 2021-04-15 09:37 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
lmms-9999.ebuild (lmms-9999.ebuild,2.39 KB, text/plain)
2018-11-09 01:36 UTC, Samuel Bauer
Details
lmms-9999.patch (lmms-9999.patch,638 bytes, patch)
2018-11-09 17:00 UTC, Samuel Bauer
Details | Diff
lmms-9999.patch (lmms-9999.patch,617 bytes, patch)
2018-11-13 12:46 UTC, Samuel Bauer
Details | Diff
Add 'cmake-utils_src_install' command to the previous patch (lmms-9999-cmake-install.patch,746 bytes, patch)
2018-12-02 14:57 UTC, Viktor Lazarev
Details | Diff
lmms-9999.patch (lmms-9999.patch,1.04 KB, patch)
2021-04-12 08:49 UTC, Samuel Bauer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Bauer 2018-11-09 01:36:10 UTC
Created attachment 554582 [details]
lmms-9999.ebuild

Path for /usr/share/bash-completion/completions/lmms is hardcoded in  cmake/modules/BashCompletion.cmake.

As a quickfix, I just disabled anything in cmake/modules/BashCompletion.cmake, and intalled the target file via doins.
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2018-11-09 14:04:51 UTC
Can you please attach a unified diff (diff -u) of the ebuild rather than the full ebuild? This would make it much simpler for us to track your changes.
Comment 2 Samuel Bauer 2018-11-09 17:00:58 UTC
Created attachment 554667 [details, diff]
lmms-9999.patch

Sorry I always forget submitting diffs instead of full ebuilds.
Comment 3 Andreas Sturmlechner gentoo-dev 2018-11-13 10:37:32 UTC
Thanks for your patch Samuel. Non-maintainer nitpick:

This ebuild inherits cmake-utils, thus when overriding src_prepare it must call cmake-utils_src_prepare. Run that as the first thing in src_prepare, and you can drop eapply_user.
Comment 4 Samuel Bauer 2018-11-13 12:46:12 UTC
Created attachment 555008 [details, diff]
lmms-9999.patch
Comment 5 Viktor Lazarev 2018-12-02 14:03:26 UTC
I have the same issue with LMMS. And with the latest patch it installs only:
--- /usr/
--- /usr/share/
--- /usr/share/doc/
>>> /usr/share/doc/lmms-9999/
>>> /usr/share/doc/lmms-9999/README.md.bz2
>>> /usr/share/doc/lmms-9999/AUTHORS.bz2
--- /usr/share/bash-completion/
--- /usr/share/bash-completion/completions/
>>> /usr/share/bash-completion/completions/lmms
Comment 6 Viktor Lazarev 2018-12-02 14:57:43 UTC
Created attachment 556948 [details, diff]
Add 'cmake-utils_src_install' command to the previous patch

In this patch I added 'cmake-utils_src_install' command, so now it installs correctly
Comment 7 opal hart 2021-04-12 02:55:45 UTC
Isn't it better to use bash-completion-r1.eclass for this?
Comment 8 Samuel Bauer 2021-04-12 08:49:55 UTC
Created attachment 699360 [details, diff]
lmms-9999.patch

Use bash-completion-r1 eclass, I didn't know this eclass, that's why it wasn't used

Remove pkg_preinst() pkg_postinst() pkg_postrm():
  all calls to xdg.eclass functions are automatised

Update the patch to use cmake eclass instead of cmake-utils.

Thanks all for suggestions
Comment 9 opal hart 2021-04-13 11:52:45 UTC
LGTM, just a note that this seems to affect lmms-1.2.2 as well and same ebuild patch can apply to both.

I've built this locally with the patch and it works for me.
Comment 10 Samuel Bauer 2021-04-14 07:56:26 UTC
From my side I didn't encounter sandbox violation with 1.2.2.
But if the patch fixes it for both, it's costless to patch both.
Comment 11 Larry the Git Cow gentoo-dev 2021-04-14 08:24:36 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb733a28123a671d54a63883dfc694ae30c0798d

commit eb733a28123a671d54a63883dfc694ae30c0798d
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2021-04-14 08:21:01 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2021-04-14 08:24:30 +0000

    media-sound/lmms: Reliably set bash-completion dir via eclass
    
    Thanks-to: Samuel Bauer <samuel.bauer@yahoo.fr>
    Bug: https://bugs.gentoo.org/670722
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 media-sound/lmms/lmms-9999.ebuild | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Comment 12 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2021-04-14 08:30:18 UTC
Please test the latest live ebuild and report back your findings.
I went a different route than patching the cmake module as it provides a way to override bash-completion path.

Please see also

  https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=205badc11fe29bc12ee3a206ff25f83d874c3b3f

So thanks for your contributions and sorry it took so long to fix this.
Comment 13 Samuel Bauer 2021-04-15 09:37:11 UTC
If cmake exposes something it is better.
From what I remember, at the time I opened the bug, I didn't find options in the cmake options.
I see freebsd guys also opened a bug about this last summer, maybe that gave a boost to lmms team, and leaded to add an option for the completion directory.

I think everything should be in order, but didn't compile as currently I stick to stable lmms.