Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 347295 - Please review/incorporate Prefix changes for dev-libs/kpathsea
Summary: Please review/incorporate Prefix changes for dev-libs/kpathsea
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal
Assignee: Alexis Ballier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: prefix-gx86
  Show dependency tree
 
Reported: 2010-11-30 15:41 UTC by Fabian Groffen
Modified: 2011-02-27 09:11 UTC (History)
2 users (show)

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


Attachments
prefix-config-paths (kpathsea-6.0.0_p20100722-prefix-config-paths.patch,894 bytes, patch)
2010-11-30 15:43 UTC, Fabian Groffen
Details | Diff
no-symlink-expand (kpathsea-6.0.0_p20100722-no-symlink-expand.patch,677 bytes, patch)
2010-11-30 15:48 UTC, Fabian Groffen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2010-11-30 15:41:48 UTC
kpathsea needs two patches, and a couple of changes in the ebuild.  One of the two patches can be incorporated in the texmf.d tarball of Gentoo, the other is necessary for certain scenarios in Prefix.  The patches follow.

The changes to the ebuild are straightforward, mostly adding awareness for the offset-prefix:

diff -u -r1.5 kpathsea-6.0.0_p20100722.ebuild
--- kpathsea-6.0.0_p20100722.ebuild     1 Nov 2010 22:10:25 -0000       1.5
+++ kpathsea-6.0.0_p20100722.ebuild     30 Nov 2010 15:37:59 -0000
@@ -4,7 +4,7 @@
 
 EAPI=3
 
-inherit texlive-common
+inherit texlive-common eutils
 
 TEXMFD_VERSION="1"
 
@@ -15,7 +15,7 @@
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="~amd64 ~arm ~hppa ~x86"
+KEYWORDS="~amd64 ~arm ~hppa ~x86 ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
 IUSE="doc source static-libs"
 
 DEPEND="!<app-text/texlive-core-2010
@@ -38,19 +38,25 @@
 done
 SRC_URI="${SRC_URI} ) "
 
+src_prepare() {
+       epatch "${FILESDIR}"/${P}-no-symlink-expand.patch
+       cd "${WORKDIR}" || die
+       epatch "${FILESDIR}"/${P}-prefix-config-paths.patch
+}
+
 src_configure() {
        econf \
                $(use_enable static-libs static)
 }
 
 src_install() {
-       emake DESTDIR="${D}" web2cdir="/usr/share/texmf/web2c" install || die
+       emake DESTDIR="${D}" web2cdir="${EPREFIX}/usr/share/texmf/web2c" install || die
        find "${D}" -name '*.la' -delete
 
        dodir /usr/share # just in case
-       cp -pR "${WORKDIR}"/texmf "${D}/usr/share/" || die "failed to install texmf trees"
+       cp -pR "${WORKDIR}"/texmf "${ED}/usr/share/" || die "failed to install texmf trees"
        if use source ; then
-               cp -pR "${WORKDIR}"/tlpkg "${D}/usr/share/" || die "failed to install tlpkg files"
+               cp -pR "${WORKDIR}"/tlpkg "${ED}/usr/share/" || die "failed to install tlpkg files"
        fi
 
        # The default configuration expects it to be world writable, bug #266680
@@ -64,14 +70,14 @@
        # Remove default texmf.cnf to ship our own, greatly based on texlive dvd's
        # texmf.cnf
        # It will also be generated from /etc/texmf/texmf.d files by texmf-update
-       rm -f "${D}${TEXMF_PATH}/web2c/texmf.cnf"
+       rm -f "${ED}${TEXMF_PATH}/web2c/texmf.cnf"
 
        insinto /etc/texmf/texmf.d
        doins "${WORKDIR}/texmf.d/"*.cnf || die "failed to install texmf.d configuration files"
 
        # Remove fmtutil.cnf, it will be regenerated from /etc/texmf/fmtutil.d files
        # by texmf-update
-       rm -f "${D}${TEXMF_PATH}/web2c/fmtutil.cnf"
+       rm -f "${ED}${TEXMF_PATH}/web2c/fmtutil.cnf"
 
        dosym /etc/texmf/web2c/fmtutil.cnf ${TEXMF_PATH}/web2c/fmtutil.cnf
        dosym /etc/texmf/web2c/texmf.cnf ${TEXMF_PATH}/web2c/texmf.cnf
Comment 1 Fabian Groffen gentoo-dev 2010-11-30 15:43:41 UTC
Created attachment 255953 [details, diff]
prefix-config-paths

This patch uses $SELFAUTOPARENT to have TRFONTS refer to the offset prefix.  It should be safe to apply for all, AFAICT.
Comment 2 Fabian Groffen gentoo-dev 2010-11-30 15:48:32 UTC
Created attachment 255955 [details, diff]
no-symlink-expand

In Prefix we can have offsets that contain a symlink.  There are various reasons why this happens, apart from cosmetical issues.  This patch changes kpsewhich not to always unconditionally unfold symlinks for everything it returns, but only when what would be returned would not be an absolute path.

We typically need this to overcome installation problems by tools that call kpsewhich to determine where in the filesystem to install something.  Since the absolute path will not match the original offset path (with symlink), a QA error will be thrown by Portage that files are installed outside of the offset prefix.

I think this patch is safe for everyone, as it hasn't caused any trouble to us since texlive-2008.
Comment 3 Alexis Ballier gentoo-dev 2010-11-30 22:27:33 UTC
(In reply to comment #0)
> +src_prepare() {
> +       epatch "${FILESDIR}"/${P}-no-symlink-expand.patch
> +       cd "${WORKDIR}" || die
> +       epatch "${FILESDIR}"/${P}-prefix-config-paths.patch
> +}

please make a correct patch and remove that cd $WORKDIR, other ebuild changes are ok



(In reply to comment #1)
> Created an attachment (id=255953) [details]
> prefix-config-paths
> 
> This patch uses $SELFAUTOPARENT to have TRFONTS refer to the offset prefix.  It
> should be safe to apply for all, AFAICT.
> 

 % Used by DMP (ditroff-to-mpx), called by makempx -troff.
-TRFONTS = /usr{/local,}/share/groff/{current/font,site-font}/devps
+TRFONTS = $SELFAUTOPARENT/usr{/local,}/share/groff/{current/font,site-font}/devps
 MPSUPPORT = .;$TEXMF/metapost/support
 
 % For xdvi to find mime.types and .mailcap, if they do not exist in
--- texmf/web2c/texmf.cnf
+++ texmf/web2c/texmf.cnf
@@ -368,7 +368,7 @@
 PDFTEXCONFIG = .;$TEXMF/pdftex/{$progname,}//
 
 % Used by DMP (ditroff-to-mpx), called by makempx -troff.
-TRFONTS = /usr{/local,}/share/groff/{current/font,site-font}/devps
+TRFONTS = $SELFAUTOPARENT/usr{/local,}/share/groff/{current/font,site-font}/devps
 MPSUPPORT = .;$TEXMF/metapost/support


please use $SELFAUTODIR and rip out that /usr
once fixed, please commit the changes to:
gentoo/src/patchsets/texlive/2010/texmf.d

that's where the files are stored, once this is done I'll roll out a new texmfd tarball

(In reply to comment #2)
> Created an attachment (id=255955) [details]
> no-symlink-expand
> 
> In Prefix we can have offsets that contain a symlink.  There are various
> reasons why this happens, apart from cosmetical issues.  This patch changes
> kpsewhich not to always unconditionally unfold symlinks for everything it
> returns, but only when what would be returned would not be an absolute path.
> 
> We typically need this to overcome installation problems by tools that call
> kpsewhich to determine where in the filesystem to install something.  Since the
> absolute path will not match the original offset path (with symlink), a QA
> error will be thrown by Portage that files are installed outside of the offset
> prefix.
> 
> I think this patch is safe for everyone, as it hasn't caused any trouble to us
> since texlive-2008.
> 

did you try to send this upstream?
Comment 4 Fabian Groffen gentoo-dev 2010-12-01 17:28:49 UTC
(In reply to comment #3)
> (In reply to comment #0)
> > +src_prepare() {
> > +       epatch "${FILESDIR}"/${P}-no-symlink-expand.patch
> > +       cd "${WORKDIR}" || die
> > +       epatch "${FILESDIR}"/${P}-prefix-config-paths.patch
> > +}
> 
> please make a correct patch and remove that cd $WORKDIR, other ebuild changes
> are ok

I presume you mean: fix the patchball sources instead

>  % Used by DMP (ditroff-to-mpx), called by makempx -troff.
> -TRFONTS = /usr{/local,}/share/groff/{current/font,site-font}/devps
> +TRFONTS =
> $SELFAUTOPARENT/usr{/local,}/share/groff/{current/font,site-font}/devps
>  MPSUPPORT = .;$TEXMF/metapost/support
> 
> 
> please use $SELFAUTODIR and rip out that /usr
> once fixed, please commit the changes to:
> gentoo/src/patchsets/texlive/2010/texmf.d

I just did:

/var/cvsroot/gentoo/src/patchsets/texlive/2010/texmf.d/10standardpaths.cnf,v  <--  texmf.d/10standardpaths.cnf
new revision: 1.3; previous revision: 1.2

> (In reply to comment #2)
> > Created an attachment (id=255955) [details] [details]
> > no-symlink-expand
> 
> did you try to send this upstream?

No, because it's highly Prefix specific.  I can try though, but I see no reason why upstream would want to apply it.
Comment 5 Alexis Ballier gentoo-dev 2010-12-02 16:22:33 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #0)
> > > +src_prepare() {
> > > +       epatch "${FILESDIR}"/${P}-no-symlink-expand.patch
> > > +       cd "${WORKDIR}" || die
> > > +       epatch "${FILESDIR}"/${P}-prefix-config-paths.patch
> > > +}
> > 
> > please make a correct patch and remove that cd $WORKDIR, other ebuild changes
> > are ok
> 
> I presume you mean: fix the patchball sources instead

well, at first I didnt because I realized later but yes :)

> 
> >  % Used by DMP (ditroff-to-mpx), called by makempx -troff.
> > -TRFONTS = /usr{/local,}/share/groff/{current/font,site-font}/devps
> > +TRFONTS =
> > $SELFAUTOPARENT/usr{/local,}/share/groff/{current/font,site-font}/devps
> >  MPSUPPORT = .;$TEXMF/metapost/support
> > 
> > 
> > please use $SELFAUTODIR and rip out that /usr
> > once fixed, please commit the changes to:
> > gentoo/src/patchsets/texlive/2010/texmf.d
> 
> I just did:
> 
> /var/cvsroot/gentoo/src/patchsets/texlive/2010/texmf.d/10standardpaths.cnf,v 
> <--  texmf.d/10standardpaths.cnf
> new revision: 1.3; previous revision: 1.2

thanks, the texmf.d tarball should be updated now.

> > (In reply to comment #2)
> > > Created an attachment (id=255955) [details] [details] [details]
> > > no-symlink-expand
> > 
> > did you try to send this upstream?
> 
> No, because it's highly Prefix specific.  I can try though, but I see no reason
> why upstream would want to apply it.
> 

Why would that be prefix specific ? People can mess up with symlinks everywhere :)

What I don't get is: do you have examples of packages _relying_ on kpsewhich to guess where to install their files ? IMHO that is these packages that should be fixed, values returned by kpsewhich can be altered by env variables, which can't be good for guessing where to install files...
Comment 6 Alexis Ballier gentoo-dev 2010-12-15 21:50:01 UTC
(In reply to comment #5)
> > > (In reply to comment #2)
> > > > Created an attachment (id=255955) [details] [details] [details] [details]
> > > > no-symlink-expand
> > > 
> > > did you try to send this upstream?
> > 
> > No, because it's highly Prefix specific.  I can try though, but I see no reason
> > why upstream would want to apply it.
> > 
> 
> Why would that be prefix specific ? People can mess up with symlinks everywhere
> :)
> 
> What I don't get is: do you have examples of packages _relying_ on kpsewhich to
> guess where to install their files ? IMHO that is these packages that should be
> fixed, values returned by kpsewhich can be altered by env variables, which
> can't be good for guessing where to install files...
> 

ping?

by the way, if it can ease your workflow, feel free to apply the EROOT/EPREFIX changes (ie: anything but the parts related to the patches)
Comment 7 Fabian Groffen gentoo-dev 2010-12-16 09:10:42 UTC
(In reply to comment #6)
> > Why would that be prefix specific ? People can mess up with symlinks everywhere
> > :)
> > 
> > What I don't get is: do you have examples of packages _relying_ on kpsewhich to
> > guess where to install their files ? IMHO that is these packages that should be
> > fixed, values returned by kpsewhich can be altered by env variables, which
> > can't be good for guessing where to install files...

No, unfortunately I don't recall any more which package(s) it was.  But there exists at least one package that does so.  It will be latex related, pretty much core-ish, or one of the few extra packages I needed to build my thesis.

> by the way, if it can ease your workflow, feel free to apply the EROOT/EPREFIX
> changes (ie: anything but the parts related to the patches)

In general it's an all-or-nothing thing for us, but thanks anyway.
Comment 8 calculuspenguin 2010-12-20 21:52:31 UTC
In trying to install latex-beamer (dev-tex/latex-beamer-3.10-r1) on my prefix system (OSX 10.5, x86-macos), I came across needing to install kpathsea.  It is a dependency of app-text/texlive-core-2010.

$ emerge -pv latex-beamer

These are the packages that would be merged, in order:

Calculating dependencies... done!

!!! All ebuilds that could satisfy "dev-libs/kpathsea" have been masked.
!!! One of the following masked packages is required to complete your request:
- dev-libs/kpathsea-6.0.0_p20100722::gentoo_prefix (masked by: missing keyword)

(dependency required by "app-text/texlive-core-2010" [ebuild])
(dependency required by "dev-texlive/texlive-latexrecommended-2009" [ebuild])
(dependency required by "dev-tex/pgf-2.10" [ebuild])
(dependency required by "dev-tex/latex-beamer-3.10-r1" [ebuild])
(dependency required by "latex-beamer" [argument])
For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.
Comment 9 Alexis Ballier gentoo-dev 2011-02-26 21:06:37 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > > Why would that be prefix specific ? People can mess up with symlinks everywhere
> > > :)
> > > 
> > > What I don't get is: do you have examples of packages _relying_ on kpsewhich to
> > > guess where to install their files ? IMHO that is these packages that should be
> > > fixed, values returned by kpsewhich can be altered by env variables, which
> > > can't be good for guessing where to install files...
> 
> No, unfortunately I don't recall any more which package(s) it was.  But there
> exists at least one package that does so.  It will be latex related, pretty
> much core-ish, or one of the few extra packages I needed to build my thesis.
> 

well, as I had said, I don't consider the patch correct but rather the offending ebuilds to be fixed, if you don't recall which one it is I'd suggest dropping the patch and letting me know if something fails.

> > by the way, if it can ease your workflow, feel free to apply the EROOT/EPREFIX
> > changes (ie: anything but the parts related to the patches)
> 
> In general it's an all-or-nothing thing for us, but thanks anyway.
> 

same again: apply these changes, drop the patch, be happy :)
Comment 10 Fabian Groffen gentoo-dev 2011-02-26 21:15:56 UTC
fair enough
Comment 11 Fabian Groffen gentoo-dev 2011-02-27 09:11:08 UTC
committed, without the no-symlinks-expand patch