Hi, please review the following patch for correct directories in Prefix. Reproducible: Always
Created attachment 311723 [details, diff] openrc.patch
Created attachment 311725 [details, diff] uprefix.patch This patch is meant to be applied to the git source.
I would rather not encorporate this this way into the official openrc, because I think we can do it in a more clean fashion. We will need to add back the prefix support and make the build system aware that it is building for prefix. We should probably add something like MKPREFIX=yes to the make files and pass that on the make command line. This will be done after 0.10 is released.
Ah, I see. Last time I didn't fully understand your MKPREFIX=yes talk.
Hi, William. Back to this topic, how about the MKPREFIX=yes magic? Let me just make a draft patch.
I have been thinking about this bug, and MKPREFIX=yes isn't going to work. I think we will have to make MKPREFIX be a variable that gets set to the value of EPREFIX in the ebuild.
I definitely could be wrong in my last comment; I'm not quite familiar withhow the packages get installed in a prefix.
HI, William, (In reply to comment #7) > I definitely could be wrong in my last comment; I'm not quite familiar > withhow the packages get installed in a prefix. Hmm, let's make it to the point. ignoring the trivial ${D} -> ${ED} and ${ROOT} -> ${EROOT} transitions (I have tested this prefix aware ebuild on amd64 after all), the only significant things remaining are: 1. openrc.patch, Lines 53-58 MAKE_ARGS="${MAKE_ARGS} PREFIX=${EPREFIX}". This is quite similar to what you proposed MKPREFIX. At present, IMHO, no need to distinguish between MKPREFIX and PREFIX: It just works and PREFIX does not seem to be abused. 2. openrc.patch, Lines 70-75, it is a bug that will be triggered when openrc is freshly installed. This symlink trick in ebuild needs to be merge back to git tree. 3. UPREFIX = ${PREFIX}/usr is a resonable thing. why UPREFIX=${PREFIX} when PREFIX is defined? I'd like to hear your opinion towards these 3 points and find a better way if you think something is not clean.
(In reply to comment #8) > 1. openrc.patch, Lines 53-58 MAKE_ARGS="${MAKE_ARGS} PREFIX=${EPREFIX}". > This is quite similar to what you proposed MKPREFIX. At present, IMHO, no > need to distinguish between MKPREFIX and PREFIX: It just works and PREFIX > does not seem to be abused. There is a difference between installing somewhere other than the default prefix and a gentoo prefix install. For a gentoo prefix install, we need to add -DPREFIX to the CFLAGS, but we shouldn't automatically do this for make PREFIX=/foo/bar install. > 2. openrc.patch, Lines 70-75, it is a bug that will be triggered when openrc > is freshly installed. This symlink trick in ebuild needs to be merge back to > git tree. This is no longer a problem. The issue was fixed a while back in the git tree. > 3. UPREFIX = ${PREFIX}/usr is a resonable thing. why UPREFIX=${PREFIX} when > PREFIX is defined? This one is actually a good question. I don't want to change it without knowing the history, so let me email Roy and ask about it.
(In reply to comment #9) > > 3. UPREFIX = ${PREFIX}/usr is a resonable thing. why UPREFIX=${PREFIX} when > > PREFIX is defined? > > This one is actually a good question. I don't want to change it without > knowing the history, so let me email Roy and ask about it. autoconf --prefix= includes /usr, so perhaps that was the idea behind it?
(In reply to comment #10) > > autoconf --prefix= includes /usr, so perhaps that was the idea behind it? Fabian, I don't quite catch it. Do you mean this autoconf default? http://sunsite.ualberta.ca/Documentation/Gnu/autoconf-2.13/html_node/autoconf_19.html OpenRC's build system doesn't use autoconf after all.
@grobian, I see, it is just about the idea ;) FYI: $ grep UPREFIX -r . ./mk/sys.mk:_UPREFIX_SH= case "${PREFIX}" in "") echo /usr;; *) echo "${PREFIX}"/usr;; esac ./mk/sys.mk:_UPREFIX:= $(shell ${_UPREFIX_SH}) ./mk/sys.mk:UPREFIX= ${_UPREFIX} ./mk/sys.mk:INCDIR?= ${UPREFIX}/include ./mk/sys.mk:LIBDIR?= ${UPREFIX}/${LIBNAME} ./mk/sys.mk:MANPREFIX?= ${UPREFIX}/share ./mk/sys.mk:DOCDIR?= ${UPREFIX}/share/doc Just discussed with William on IRC. The plan is to override INCDIR LIBDIR MANPREFIX and DOCDIR explicitly and don't touch UPREFIX.
@heroxdb: It turns out that I was able to make UPREFIX smart enough to know when a Prefix Installation is happening, so we do not need to override all of the variables I thought we would. See commit 8e4169e. Do you need ${EPREFIX}/etc/runlevels/* on Prefix? If not, I may be able to skip installing that on a Prefix installation. Do you need everything in the pkg_*inst functions on prefix? Also, what about src_install? If you do not, you can test on the prefix use flag and run only what you need. Please update your patch to the openrc-9999 ebuild and attach the new patch. Thanks, William
(In reply to comment #13) > @heroxdb: > It turns out that I was able to make UPREFIX smart enough to know when a > Prefix Installation is happening, so we do not need to override all of > the variables I thought we would. See commit 8e4169e. Tested to work. > Do you need ${EPREFIX}/etc/runlevels/* on Prefix? If not, I may be able > to skip installing that on a Prefix installation. Yes, we need etc/runlevels in Prefix, too. > Do you need everything in the pkg_*inst functions on prefix? Also, what > about src_install? If you do not, you can test on the prefix use flag > and run only what you need. I don't think we need to differentiate here if pkg_*inst just work out of box and does no harm on prefix. > Please update your patch to the openrc-9999 ebuild and attach the new > patch. Okay, please review.
Created attachment 324072 [details, diff] openrc-9999.patch finally I decided to bypass pkg_*inst in prefix.
Created attachment 324446 [details, diff] openrc.patch Your patch actually exposed a couple of things in OpenRc prefix support. - We were setting the RC_SVCDIR based on the host operating system, which is not good in a prefix environment. - You should not need to set RC_SYS any longer; that is handled by MKPREFIX=yes. - PKG_PREFIX and LOCAL_PREFIX do not need to be set by the ebuild; they are handled appropriately in the Makefiles. Please test with the slightly modified patch I have attached and let me know your results. Thanks, William
Ok, on Prefix we will not use $EPREFIX/run. The commit 0a132cdca5 has an indentation error in Makefile: else ifneq (${OS},Linux) Others works just fine. Thanks for the new clean patch.
I checked everything again, and it looks like we can s/{D}/{ED}/ and s/{ROOT}/{EROOT}/ and allow the pre/postinst to run on prefix systems. I have done this as well as applied the original patch to -9999 in the tree now. Please test with openrc-9999 in the portage tree. If everything merges successfully, close this bug. Thanks, William
tested with one mod, committed and close. Thanks a lot, William.