Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 682864 - =/usr should include ${EPREFIX} in net-misc/nx/nx-3.5.99.17.ebuild
Summary: =/usr should include ${EPREFIX} in net-misc/nx/nx-3.5.99.17.ebuild
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords: EBUILD
Depends on:
Blocks:
 
Reported: 2019-04-08 08:52 UTC by Firas
Modified: 2021-01-20 07:42 UTC (History)
1 user (show)

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


Attachments
build.log (build.log.bz2,53.40 KB, application/x-bzip)
2019-04-08 09:17 UTC, Firas
Details
build.log (build2.log.bz2,53.55 KB, application/x-bzip)
2019-04-08 13:17 UTC, Firas
Details
build.log (build3.log.bz2,34.70 KB, application/x-bzip)
2019-04-08 13:22 UTC, Firas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Firas 2019-04-08 08:52:33 UTC
Tried to install x2goserver but encountered the following error with net-misc/nx-3.5.99.17 during the install phase.

Suggestions from xdej #gentoo-prefix channel:

* replacing "emake DESTDIR="${D}" PREFIX="/usr" NXLIBDIR="/usr/$(get_libdir)/${PN}" SHLIBDIR="/usr/$(get_libdir)" USRLIBDIR="/usr/$(get_libdir)/${PN}/X11" install" by emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" NXLIBDIR="${EPREFIX}/usr/$(get_libdir)/${PN}" SHLIBDIR="${EPREFIX}/usr/$(get_libdir)" USRLIBDIR="${EPREFIX}/usr/$(get_libdir)/${PN}/X11" install" might let things work.

* replacing "emake -j1 -C nx-X11 World USRLIBDIR="/usr/$(get_libdir)/${PN}/X11" SHLIBDIR="/usr/$(get_libdir)"" by "emake -j1 -C nx-X11 World USRLIBDIR="$EPREFIX/usr/$(get_libdir)/${PN}/X11" SHLIBDIR="$EPREFIX/usr/$(get_libdir)"" might be necessary also
Comment 1 Firas 2019-04-08 09:17:14 UTC
Created attachment 572220 [details]
build.log
Comment 2 Firas 2019-04-08 13:15:26 UTC
After I made the suggested changes as follow:

---
	emake -C nx-X11 BuildDependsOnly
	# Parallel make issue resurfaced, upstream working on autotools switch
	emake -j1 -C nx-X11 World \
		USRLIBDIR="/usr/$(get_libdir)/${PN}/X11" \
		SHLIBDIR="/usr/$(get_libdir)"

	emake -C nxproxy
}

src_install() {
	emake \
		DESTDIR="${D}" \
		PREFIX="${EPREFIX}/usr" \
		NXLIBDIR="${EPREFIX}/usr/$(get_libdir)/${PN}" \
		SHLIBDIR="${EPREFIX}/usr/$(get_libdir)" \
		USRLIBDIR="${EPREFIX}/usr/$(get_libdir)/${PN}/X11" \
		install

	# Already provided by mesa & related packages
	rm -r "${ED}"/usr/include/GL || die

	# Get rid of libtool files and static libs.
	find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
}
---








The ebuild failed again due to :

QA Notice: the following files are outside of the prefix:

/etc
/etc/nxagent
/etc/nxagent/keystrokes.cfg
Comment 3 Firas 2019-04-08 13:17:28 UTC
Created attachment 572228 [details]
build.log
Comment 4 Firas 2019-04-08 13:20:58 UTC
Then xdej suggested the following editing: 

```
	emake -j1 -C nx-X11 World \
		USRLIBDIR="${EPREFIX}/usr/$(get_libdir)/${PN}/X11" \
		SHLIBDIR="${EPREFIX}/usr/$(get_libdir)" \
		ETCDIR_NX="${EPREFIX}/etc/nxagent"

	emake -C nxproxy
}

src_install() {
	emake \
		DESTDIR="${D}" \
		PREFIX="${EPREFIX}/usr" \
		NXLIBDIR="${EPREFIX}/usr/$(get_libdir)/${PN}" \
		SHLIBDIR="${EPREFIX}/usr/$(get_libdir)" \
		USRLIBDIR="${EPREFIX}/usr/$(get_libdir)/${PN}/X11" \
		ETCDIR_NX="${EPREFIX}/etc/nxagent" \
		install

	# Already provided by mesa & related packages
	rm -r "${ED}"/usr/include/GL || die

	# Get rid of libtool files and static libs.
	find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
}


```

But I am now receving a emake fail error
Comment 5 Firas 2019-04-08 13:22:52 UTC
Created attachment 572230 [details]
build.log
Comment 6 Firas 2019-04-08 18:51:16 UTC
The bug is reproducible. 

After I ran the edited ebuild file as in comment 4 for another time, the emerge command was successful.
Comment 7 Fabian Groffen gentoo-dev 2021-01-18 18:57:41 UTC
@voyageur: see comment #4, would you be ok with incorporating those changes to the ebuild?
Comment 8 Bernard Cafarelli gentoo-dev 2021-01-18 21:07:04 UTC
The change is mostly prepending ${EPREFIX} to paths starting directly with /usr so it looks safe enough to go in (at least for non-prefix systems)
Comment 9 Fabian Groffen gentoo-dev 2021-01-19 07:23:22 UTC
well, it is setting extra paths, that's the risky business from my point of view :)
Comment 10 Bernard Cafarelli gentoo-dev 2021-01-19 08:46:41 UTC
Oh right there is ETCDIR_NX now which is new ("diff in my head" technique did not spot it): let me test this one
Comment 11 Bernard Cafarelli gentoo-dev 2021-01-19 21:31:55 UTC
 OK so ETCDIR_NX default is indeed /etc/nxagent and adding these ${EPREFIX} does not change installed result (tested working with x2go). So good to go in for me!

Build error looks strange though, almost parallel make issue but there already is a -j1 (it has been around in the ebuild for some ime, old buggy build system)
Comment 12 Larry the Git Cow gentoo-dev 2021-01-20 07:42:43 UTC
The bug has been closed via the following commit(s):

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

commit 80f508cf33b67c0443d35679e0953e7007dda66f
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2021-01-20 07:41:57 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2021-01-20 07:42:40 +0000

    net-misc/nx: fix install for Prefix, by Firas, bug #682864
    
    Closes: https://bugs.gentoo.org/682864
    Package-Manager: Portage-3.0.12, Repoman-3.0.2
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 net-misc/nx/nx-3.5.99.25.ebuild | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)