[MacPorts] #42828: glew: pkg-config .pc files contain path to destroot
MacPorts
noreply at macports.org
Fri Mar 14 00:07:59 PDT 2014
#42828: glew: pkg-config .pc files contain path to destroot
--------------------------+-------------------
Reporter: ryandesign@… | Owner: jmr@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.2.1
Keywords: | Port: glew
--------------------------+-------------------
The pkg-config .pc files that the glew port installs contain the path to
the destroot:
{{{
$ port -v installed glew
The following ports are currently installed:
glew @1.10.0_0+universal (active) platform='darwin 13' archs='i386
x86_64'
$ port -q contents glew | xargs grep destroot
/opt/local/lib/pkgconfig/glew.pc:prefix=/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_glew/glew/work/destroot/opt/local
/opt/local/lib/pkgconfig/glew.pc:exec_prefix=/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_glew/glew/work/destroot/opt/local/bin
/opt/local/lib/pkgconfig/glew.pc:libdir=/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_glew/glew/work/destroot/opt/local/lib
/opt/local/lib/pkgconfig/glew.pc:includedir=/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_glew/glew/work/destroot/opt/local/include/GL
/opt/local/lib/pkgconfig/glewmx.pc:prefix=/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_glew/glew/work/destroot/opt/local
/opt/local/lib/pkgconfig/glewmx.pc:exec_prefix=/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_glew/glew/work/destroot/opt/local/bin
/opt/local/lib/pkgconfig/glewmx.pc:libdir=/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_glew/glew/work/destroot/opt/local/lib
/opt/local/lib/pkgconfig/glewmx.pc:includedir=/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_glew/glew/work/destroot/opt/local/include/GL
}}}
This was originally [https://lists.macosforge.org/pipermail/macports-
users/2014-March/034779.html reported on the mailing list] while Trac was
down.
It seems the .pc files get created correctly during the build phase:
{{{
sed \
-e "s|@prefix@|/opt/local|g" \
-e "s|@libdir@|/opt/local/lib|g" \
-e "s|@exec_prefix@|/opt/local/bin|g" \
-e "s|@includedir@|/opt/local/include/GL|g" \
-e "s|@version@|1.10.0|g" \
-e "s|@cflags@||g" \
-e "s|@libname@|GLEW|g" \
< glew.pc.in > glew.pc
}}}
{{{
sed \
-e "s|@prefix@|/opt/local|g" \
-e "s|@libdir@|/opt/local/lib|g" \
-e "s|@exec_prefix@|/opt/local/bin|g" \
-e "s|@includedir@|/opt/local/include/GL|g" \
-e "s|@version@|1.10.0|g" \
-e "s|@cflags@|-DGLEW_MX|g" \
-e "s|@libname@|GLEWmx|g" \
< glew.pc.in > glewmx.pc
}}}
But then get overwritten with an incorrect version at destroot time:
{{{
sed \
-e
"s|@prefix@|/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_glew/glew/work/destroot/opt/local|g"
\
-e
"s|@libdir@|/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_glew/glew/work/destroot/opt/local/lib|g"
\
-e
"s|@exec_prefix@|/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_glew/glew/work/destroot/opt/local/bin|g"
\
-e
"s|@includedir@|/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_glew/glew/work/destroot/opt/local/include/GL|g"
\
-e "s|@version@|1.10.0|g" \
-e "s|@cflags@||g" \
-e "s|@libname@|GLEW|g" \
< glew.pc.in > glew.pc
}}}
{{{
sed \
-e
"s|@prefix@|/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_glew/glew/work/destroot/opt/local|g"
\
-e
"s|@libdir@|/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_glew/glew/work/destroot/opt/local/lib|g"
\
-e
"s|@exec_prefix@|/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_glew/glew/work/destroot/opt/local/bin|g"
\
-e
"s|@includedir@|/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_glew/glew/work/destroot/opt/local/include/GL|g"
\
-e "s|@version@|1.10.0|g" \
-e "s|@cflags@|-DGLEW_MX|g" \
-e "s|@libname@|GLEWmx|g" \
< glew.pc.in > glewmx.pc
}}}
This appears to be because the Makefile deliberately declares the .pc
files as ".PHONY" because, according to a comment in the Makefile,
"GLEW_DEST can vary". The Makefile does not support `DESTDIR`, so the
Portfile sets `GLEW_DEST=${prefix}` at build time and
`GLEW_DEST=${destroot}${prefix}` at destroot time.
A solution might be to always set `GLEW_DEST=${prefix}` and apply
[https://github.com/nigels-com/glew/pull/1 this patch] which provides
proper `DESTDIR` support, which has already been merged upstream.
--
Ticket URL: <https://trac.macports.org/ticket/42828>
MacPorts <http://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list