diff mbox series

mesa3d-headers: fix logic to generate the dri.pc file

Message ID 20180810214632.21735-1-thomas.petazzoni@bootlin.com
State Accepted
Headers show
Series mesa3d-headers: fix logic to generate the dri.pc file | expand

Commit Message

Thomas Petazzoni Aug. 10, 2018, 9:46 p.m. UTC
As noted by Arnout in [1], the logic in mesa3d-headers.mk generates a
bogus dri.pc file, which looks like this:

prefix=/usr
exec_prefix=/usr
libdir=/lib
includedir=/include
dridriverdir=/dri

Indeed, the ${...} are expanded as shell variables when the sed
command is executed, while the intention is that those ${...} should
go in the .pc file. By escaping those using $${...}, we get the
expected .pc file:

prefix=/usr
exec_prefix=/usr
libdir=${exec_prefix}/lib
includedir=${prefix}/include
dridriverdir=${libdir}/dri

This was detected by the not yet committed check-package improvement
from Ricardo that detects bogus ${...} usage to reference make
variables.

[1] http://lists.busybox.net/pipermail/buildroot/2018-July/225402.html

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/mesa3d-headers/mesa3d-headers.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Yann E. MORIN Aug. 11, 2018, 8:33 a.m. UTC | #1
Thomas, All,

On 2018-08-10 23:46 +0200, Thomas Petazzoni spake thusly:
> As noted by Arnout in [1], the logic in mesa3d-headers.mk generates a
> bogus dri.pc file, which looks like this:
> 
> prefix=/usr
> exec_prefix=/usr
> libdir=/lib
> includedir=/include
> dridriverdir=/dri
> 
> Indeed, the ${...} are expanded as shell variables when the sed
> command is executed, while the intention is that those ${...} should
> go in the .pc file. By escaping those using $${...}, we get the
> expected .pc file:
> 
> prefix=/usr
> exec_prefix=/usr
> libdir=${exec_prefix}/lib
> includedir=${prefix}/include
> dridriverdir=${libdir}/dri
> 
> This was detected by the not yet committed check-package improvement
> from Ricardo that detects bogus ${...} usage to reference make
> variables.
> 
> [1] http://lists.busybox.net/pipermail/buildroot/2018-July/225402.html
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  package/mesa3d-headers/mesa3d-headers.mk | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/package/mesa3d-headers/mesa3d-headers.mk b/package/mesa3d-headers/mesa3d-headers.mk
> index de8a9dc7cf..fc88f0ed60 100644
> --- a/package/mesa3d-headers/mesa3d-headers.mk
> +++ b/package/mesa3d-headers/mesa3d-headers.mk
> @@ -35,9 +35,9 @@ ifeq ($(BR2_PACKAGE_XORG7),y)
>  # contains -i.
>  define MESA3D_HEADERS_BUILD_DRI_PC
>  	sed -e 's:@\(exec_\)\?prefix@:/usr:' \
> -	    -e 's:@libdir@:${exec_prefix}/lib:' \
> -	    -e 's:@includedir@:${prefix}/include:' \
> -	    -e 's:@DRI_DRIVER_INSTALL_DIR@:${libdir}/dri:' \
> +	    -e 's:@libdir@:$${exec_prefix}/lib:' \
> +	    -e 's:@includedir@:$${prefix}/include:' \
> +	    -e 's:@DRI_DRIVER_INSTALL_DIR@:$${libdir}/dri:' \
>  	    -e 's:@VERSION@:$(MESA3D_HEADERS_VERSION):' \
>  	    -e 's:@DRI_PC_REQ_PRIV@::' \
>  	    $(@D)/src/mesa/drivers/dri/dri.pc.in \
> -- 
> 2.14.4
>
Thomas Petazzoni Aug. 11, 2018, 10:37 a.m. UTC | #2
Hello,

On Fri, 10 Aug 2018 23:46:32 +0200, Thomas Petazzoni wrote:
> As noted by Arnout in [1], the logic in mesa3d-headers.mk generates a
> bogus dri.pc file, which looks like this:
> 
> prefix=/usr
> exec_prefix=/usr
> libdir=/lib
> includedir=/include
> dridriverdir=/dri
> 
> Indeed, the ${...} are expanded as shell variables when the sed
> command is executed, while the intention is that those ${...} should
> go in the .pc file. By escaping those using $${...}, we get the
> expected .pc file:
> 
> prefix=/usr
> exec_prefix=/usr
> libdir=${exec_prefix}/lib
> includedir=${prefix}/include
> dridriverdir=${libdir}/dri
> 
> This was detected by the not yet committed check-package improvement
> from Ricardo that detects bogus ${...} usage to reference make
> variables.
> 
> [1] http://lists.busybox.net/pipermail/buildroot/2018-July/225402.html
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  package/mesa3d-headers/mesa3d-headers.mk | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Applied to master, thanks.

Thomas
Peter Korsgaard Aug. 24, 2018, 8:20 a.m. UTC | #3
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:

 > As noted by Arnout in [1], the logic in mesa3d-headers.mk generates a
 > bogus dri.pc file, which looks like this:

 > prefix=/usr
 > exec_prefix=/usr
 > libdir=/lib
 > includedir=/include
 > dridriverdir=/dri

 > Indeed, the ${...} are expanded as shell variables when the sed
 > command is executed, while the intention is that those ${...} should
 > go in the .pc file. By escaping those using $${...}, we get the
 > expected .pc file:

 > prefix=/usr
 > exec_prefix=/usr
 > libdir=${exec_prefix}/lib
 > includedir=${prefix}/include
 > dridriverdir=${libdir}/dri

 > This was detected by the not yet committed check-package improvement
 > from Ricardo that detects bogus ${...} usage to reference make
 > variables.

 > [1] http://lists.busybox.net/pipermail/buildroot/2018-July/225402.html

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Committed to 2018.02.x and 2018.05.x, thanks.
diff mbox series

Patch

diff --git a/package/mesa3d-headers/mesa3d-headers.mk b/package/mesa3d-headers/mesa3d-headers.mk
index de8a9dc7cf..fc88f0ed60 100644
--- a/package/mesa3d-headers/mesa3d-headers.mk
+++ b/package/mesa3d-headers/mesa3d-headers.mk
@@ -35,9 +35,9 @@  ifeq ($(BR2_PACKAGE_XORG7),y)
 # contains -i.
 define MESA3D_HEADERS_BUILD_DRI_PC
 	sed -e 's:@\(exec_\)\?prefix@:/usr:' \
-	    -e 's:@libdir@:${exec_prefix}/lib:' \
-	    -e 's:@includedir@:${prefix}/include:' \
-	    -e 's:@DRI_DRIVER_INSTALL_DIR@:${libdir}/dri:' \
+	    -e 's:@libdir@:$${exec_prefix}/lib:' \
+	    -e 's:@includedir@:$${prefix}/include:' \
+	    -e 's:@DRI_DRIVER_INSTALL_DIR@:$${libdir}/dri:' \
 	    -e 's:@VERSION@:$(MESA3D_HEADERS_VERSION):' \
 	    -e 's:@DRI_PC_REQ_PRIV@::' \
 	    $(@D)/src/mesa/drivers/dri/dri.pc.in \