Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 416945 - media-sound/mpd-0.16.5 works in MacOSX with patch
Summary: media-sound/mpd-0.16.5 works in MacOSX with patch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All OS X
: Normal normal (vote)
Assignee: Christoph Mende (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-21 17:00 UTC by Matthew Alexander LaChance
Modified: 2012-05-22 17:19 UTC (History)
3 users (show)

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


Attachments
This patch produces a working ebuild (mpd.patch,3.69 KB, patch)
2012-05-21 17:03 UTC, Matthew Alexander LaChance
Details | Diff
Better patch (uses +prefix, not -createuser) (mpd.patch,3.67 KB, patch)
2012-05-21 17:22 UTC, Matthew Alexander LaChance
Details | Diff
Unified patch; no prefix in IUSE (mpd.patch,1.99 KB, patch)
2012-05-21 17:43 UTC, Matthew Alexander LaChance
Details | Diff
Patch for mpd-0.16.8 (mpd.patch,1.41 KB, patch)
2012-05-21 18:06 UTC, Matthew Alexander LaChance
Details | Diff
Minimal patch for mpd-0.16.8 (mpd.patch,919 bytes, patch)
2012-05-22 12:15 UTC, Matthew Alexander LaChance
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Alexander LaChance 2012-05-21 17:00:56 UTC
Basically the only problem with mpd was that it created a user (which you can't do if you aren't root). So I added a use flag (createuser) that controls whether or not it will try to create a user.

In the end, the following is in my package.use for mpd:

    media-sound/mpd -createuser -network -wavpack

Reproducible: Always
Comment 1 Matthew Alexander LaChance 2012-05-21 17:03:02 UTC
Created attachment 312549 [details, diff]
This patch produces a working ebuild

This doesn't disable user creation on its own -- you have to actually add `-createuser` to your use flags for mpd. It does take the liberty of adding `~x64-macos`.
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-05-21 17:05:32 UTC
The preferred way is to just do:

use prefix || enewuser
Comment 3 Matthew Alexander LaChance 2012-05-21 17:22:21 UTC
Created attachment 312555 [details, diff]
Better patch (uses +prefix, not -createuser)

Thanks yeah that is a way better idea. Updated and tested!
Comment 4 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-05-21 17:32:16 UTC
Oh, you don't need to add prefix to IUSE. Also, please attach unified diffs for wase of reading (diff -u)
Comment 5 Matthew Alexander LaChance 2012-05-21 17:43:10 UTC
Created attachment 312569 [details, diff]
Unified patch; no prefix in IUSE

Haha okay! Done and tested (still works). Can you tell this is my first time.
Comment 6 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-05-21 17:50:29 UTC
Alright. That looks good, except this:

-	virtual/pkgconfig"
+	dev-util/pkgconfig"

that would be an unintended change from using an old revision (v1.9).

Also, can you test the latest version? 0.16.8? We only should be caring about the latest version.
Comment 7 Matthew Alexander LaChance 2012-05-21 18:06:58 UTC
Created attachment 312571 [details, diff]
Patch for mpd-0.16.8

Happy to. I was using 0.16.5 because it had amd64 instead of ~amd64, but 0.16.8 works just fine as well. Here's the working patch for that.
Comment 8 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-05-21 18:20:26 UTC
Good, thanks for testing the latest.

My last question is what error did you actually hit with enewuser? We have special code for Gentoo Prefix in user.eclass that defines enewuser()

<snip>
    # in Gentoo Prefix, we may be unprivileged, such that we can't handle this
    rootuid=$(python -c 'from portage.const import rootuid; print rootuid')
    if [[ ${rootuid} != 0 ]] ; then
        ewarn "'enewuser()'  disabled in Gentoo Prefix with non-root user (by design)"
        ewarn "    User: '$euser' not created"
        return 0
    fi
</snip>
Comment 9 Matthew Alexander LaChance 2012-05-21 18:39:01 UTC
(In reply to comment #8)
> My last question is what error did you actually hit with enewuser? We have
> special code for Gentoo Prefix in user.eclass that defines enewuser()

The problem is the dodir command -- it tries to create directories belonging to mpd:audio, which have not been created. This will work okay if I only add `use prefix ||` to the dodir line, but that felt like an incomplete modification to me, so I added it to each line involving user creation.

The only other edit is the line where sed needs to run on ${ED} instead of on ${D}.
Comment 10 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-05-21 18:52:59 UTC
Ah, ok. That is because dodir calls this:

install -d ${DIROPTIONS} "${@/#/${ED}/}"

and diropts just sets DIROPTIONS.

Even though you think the modification was incomplete, the goal is minimal diffs which is why we short circuit enewuser - don't have to edit it in multiple ebuilds.
Comment 11 Matthew Alexander LaChance 2012-05-22 12:15:04 UTC
Created attachment 312677 [details, diff]
Minimal patch for mpd-0.16.8

Ah, I understand. Here is a bare-minimum patch (tested and working).
Comment 12 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-05-22 12:27:24 UTC
Patch looks good.

maintainers, please apply or let me know. thanks.
Comment 13 Christoph Mende (RETIRED) gentoo-dev 2012-05-22 15:45:10 UTC
+  22 May 2012; Christoph Mende <angelos@gentoo.org> mpd-0.16.8.ebuild:
+  Apply prefix patch for bug #416945, thanks to Matthew Alexander LaChance