diff mbox series

Fix src/ pkg-config API XML paths

Message ID a3097f61587e95b679cd4029982bcb5c5e6ee161.1575900167.git.crobinso@redhat.com
State New
Headers show
Series Fix src/ pkg-config API XML paths | expand

Commit Message

Cole Robinson Dec. 9, 2019, 2:02 p.m. UTC
The .pc files in src/ are intended for use with the ./run script,
to ease building bindings against an uninstalled libvirt build.
The pointer to the API XML files is incorrect though, it needs to
point into the build tree.

This fixes use of the run script for building libvirt-python, ex:

  /path/to/libvirt.git/run ./setup.py build

Signed-off-by: Cole Robinson <crobinso@redhat.com>

---
 src/libvirt-lxc.pc.in  | 2 +-
 src/libvirt-qemu.pc.in | 2 +-
 src/libvirt.pc.in      | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Comments

Daniel P. Berrangé Dec. 9, 2019, 2:08 p.m. UTC | #1
On Mon, Dec 09, 2019 at 09:02:56AM -0500, Cole Robinson wrote:
> The .pc files in src/ are intended for use with the ./run script,
> to ease building bindings against an uninstalled libvirt build.
> The pointer to the API XML files is incorrect though, it needs to
> point into the build tree.
> 
> This fixes use of the run script for building libvirt-python, ex:
> 
>   /path/to/libvirt.git/run ./setup.py build
> 
> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> ---
>  src/libvirt-lxc.pc.in  | 2 +-
>  src/libvirt-qemu.pc.in | 2 +-
>  src/libvirt.pc.in      | 6 +++---
>  3 files changed, 5 insertions(+), 5 deletions(-)

Sigh, I must have been blind when doing

ommit 54fff1856b9c9854fc3f649a52103e30a116c896
Author: Daniel P. Berrangé <berrange@redhat.com>
Date:   Mon Dec 2 13:18:01 2019 +0000

    src: fix pkg-config path for API XML files
    

/me wonders why we have a 'datarootdir' parameter in the .pc
files at all ? Wonder if this was a typo and meant to be
'datadir', or were the variable all meant to reference
'datarootdir' instead of 'datadir'

eg libvirt_lxc_api=${datarootdir}/docs/libvirt-lxc-api.xml


> 
> diff --git a/src/libvirt-lxc.pc.in b/src/libvirt-lxc.pc.in
> index 27e3de4244..9243bcf903 100644
> --- a/src/libvirt-lxc.pc.in
> +++ b/src/libvirt-lxc.pc.in
> @@ -9,7 +9,7 @@ includedir=@abs_top_builddir@/include
>  source_includedir=@abs_top_srcdir@/include
>  datarootdir=@abs_top_builddir@
>  
> -libvirt_lxc_api=@datadir@/docs/libvirt-lxc-api.xml
> +libvirt_lxc_api=@abs_top_builddir@/docs/libvirt-lxc-api.xml
>  
>  Name: libvirt
>  Version: @VERSION@
> diff --git a/src/libvirt-qemu.pc.in b/src/libvirt-qemu.pc.in
> index 3eb9ad4bc1..a4f9e65c03 100644
> --- a/src/libvirt-qemu.pc.in
> +++ b/src/libvirt-qemu.pc.in
> @@ -9,7 +9,7 @@ includedir=@abs_top_builddir@/include
>  source_includedir=@abs_top_srcdir@/include
>  datarootdir=@abs_top_builddir@
>  
> -libvirt_qemu_api=@datadir@/docs/libvirt-qemu-api.xml
> +libvirt_qemu_api=@abs_top_builddir@/docs/libvirt-qemu-api.xml
>  
>  Name: libvirt
>  Version: @VERSION@
> diff --git a/src/libvirt.pc.in b/src/libvirt.pc.in
> index 6ff1ce6272..a16e455210 100644
> --- a/src/libvirt.pc.in
> +++ b/src/libvirt.pc.in
> @@ -9,12 +9,12 @@ includedir=@abs_top_builddir@/include
>  source_includedir=@abs_top_srcdir@/include
>  datarootdir=@abs_top_builddir@
>  
> -libvirt_api=@datadir@/docs/libvirt-api.xml
> +libvirt_api=@abs_top_builddir@/docs/libvirt-api.xml
>  
>  # For compat with older versions - also present
>  # in libvirt-qemu.pc / libvirt-lxc.pc
> -libvirt_qemu_api=@datadir@/docs/libvirt-qemu-api.xml
> -libvirt_lxc_api=@datadir@/docs/libvirt-lxc-api.xml
> +libvirt_qemu_api=@abs_top_builddir@/docs/libvirt-qemu-api.xml
> +libvirt_lxc_api=@abs_top_builddir@/docs/libvirt-lxc-api.xml
>  
>  Name: libvirt
>  Version: @VERSION@
> -- 
> 2.23.0
> 
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list

Regards,
Daniel
Cole Robinson Dec. 10, 2019, 12:26 a.m. UTC | #2
On 12/9/19 9:08 AM, Daniel P. Berrangé wrote:
> On Mon, Dec 09, 2019 at 09:02:56AM -0500, Cole Robinson wrote:
>> The .pc files in src/ are intended for use with the ./run script,
>> to ease building bindings against an uninstalled libvirt build.
>> The pointer to the API XML files is incorrect though, it needs to
>> point into the build tree.
>>
>> This fixes use of the run script for building libvirt-python, ex:
>>
>>   /path/to/libvirt.git/run ./setup.py build
>>
>> Signed-off-by: Cole Robinson <crobinso@redhat.com>
>> ---
>>  src/libvirt-lxc.pc.in  | 2 +-
>>  src/libvirt-qemu.pc.in | 2 +-
>>  src/libvirt.pc.in      | 6 +++---
>>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> Sigh, I must have been blind when doing
> 
> ommit 54fff1856b9c9854fc3f649a52103e30a116c896
> Author: Daniel P. Berrangé <berrange@redhat.com>
> Date:   Mon Dec 2 13:18:01 2019 +0000
> 
>     src: fix pkg-config path for API XML files
>     
> 
> /me wonders why we have a 'datarootdir' parameter in the .pc
> files at all ? Wonder if this was a typo and meant to be
> 'datadir', or were the variable all meant to reference
> 'datarootdir' instead of 'datadir'
> 
> eg libvirt_lxc_api=${datarootdir}/docs/libvirt-lxc-api.xml
> 

Sure I can do that. Or push this and send a follow up patch removing the
unused variables, unless we expect apps could be consuming them in some
way? Your call

Thanks,
Cole

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Daniel P. Berrangé Dec. 10, 2019, 9:59 a.m. UTC | #3
On Mon, Dec 09, 2019 at 09:02:56AM -0500, Cole Robinson wrote:
> The .pc files in src/ are intended for use with the ./run script,
> to ease building bindings against an uninstalled libvirt build.
> The pointer to the API XML files is incorrect though, it needs to
> point into the build tree.
> 
> This fixes use of the run script for building libvirt-python, ex:
> 
>   /path/to/libvirt.git/run ./setup.py build
> 
> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> ---
>  src/libvirt-lxc.pc.in  | 2 +-
>  src/libvirt-qemu.pc.in | 2 +-
>  src/libvirt.pc.in      | 6 +++---
>  3 files changed, 5 insertions(+), 5 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
Daniel P. Berrangé Dec. 10, 2019, 9:59 a.m. UTC | #4
On Mon, Dec 09, 2019 at 07:26:13PM -0500, Cole Robinson wrote:
> On 12/9/19 9:08 AM, Daniel P. Berrangé wrote:
> > On Mon, Dec 09, 2019 at 09:02:56AM -0500, Cole Robinson wrote:
> >> The .pc files in src/ are intended for use with the ./run script,
> >> to ease building bindings against an uninstalled libvirt build.
> >> The pointer to the API XML files is incorrect though, it needs to
> >> point into the build tree.
> >>
> >> This fixes use of the run script for building libvirt-python, ex:
> >>
> >>   /path/to/libvirt.git/run ./setup.py build
> >>
> >> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> >> ---
> >>  src/libvirt-lxc.pc.in  | 2 +-
> >>  src/libvirt-qemu.pc.in | 2 +-
> >>  src/libvirt.pc.in      | 6 +++---
> >>  3 files changed, 5 insertions(+), 5 deletions(-)
> > 
> > Sigh, I must have been blind when doing
> > 
> > ommit 54fff1856b9c9854fc3f649a52103e30a116c896
> > Author: Daniel P. Berrangé <berrange@redhat.com>
> > Date:   Mon Dec 2 13:18:01 2019 +0000
> > 
> >     src: fix pkg-config path for API XML files
> >     
> > 
> > /me wonders why we have a 'datarootdir' parameter in the .pc
> > files at all ? Wonder if this was a typo and meant to be
> > 'datadir', or were the variable all meant to reference
> > 'datarootdir' instead of 'datadir'
> > 
> > eg libvirt_lxc_api=${datarootdir}/docs/libvirt-lxc-api.xml
> > 
> 
> Sure I can do that. Or push this and send a follow up patch removing the
> unused variables, unless we expect apps could be consuming them in some
> way? Your call

Just push this immediate fix to start with.

Regards,
Daniel
diff mbox series

Patch

diff --git a/src/libvirt-lxc.pc.in b/src/libvirt-lxc.pc.in
index 27e3de4244..9243bcf903 100644
--- a/src/libvirt-lxc.pc.in
+++ b/src/libvirt-lxc.pc.in
@@ -9,7 +9,7 @@  includedir=@abs_top_builddir@/include
 source_includedir=@abs_top_srcdir@/include
 datarootdir=@abs_top_builddir@
 
-libvirt_lxc_api=@datadir@/docs/libvirt-lxc-api.xml
+libvirt_lxc_api=@abs_top_builddir@/docs/libvirt-lxc-api.xml
 
 Name: libvirt
 Version: @VERSION@
diff --git a/src/libvirt-qemu.pc.in b/src/libvirt-qemu.pc.in
index 3eb9ad4bc1..a4f9e65c03 100644
--- a/src/libvirt-qemu.pc.in
+++ b/src/libvirt-qemu.pc.in
@@ -9,7 +9,7 @@  includedir=@abs_top_builddir@/include
 source_includedir=@abs_top_srcdir@/include
 datarootdir=@abs_top_builddir@
 
-libvirt_qemu_api=@datadir@/docs/libvirt-qemu-api.xml
+libvirt_qemu_api=@abs_top_builddir@/docs/libvirt-qemu-api.xml
 
 Name: libvirt
 Version: @VERSION@
diff --git a/src/libvirt.pc.in b/src/libvirt.pc.in
index 6ff1ce6272..a16e455210 100644
--- a/src/libvirt.pc.in
+++ b/src/libvirt.pc.in
@@ -9,12 +9,12 @@  includedir=@abs_top_builddir@/include
 source_includedir=@abs_top_srcdir@/include
 datarootdir=@abs_top_builddir@
 
-libvirt_api=@datadir@/docs/libvirt-api.xml
+libvirt_api=@abs_top_builddir@/docs/libvirt-api.xml
 
 # For compat with older versions - also present
 # in libvirt-qemu.pc / libvirt-lxc.pc
-libvirt_qemu_api=@datadir@/docs/libvirt-qemu-api.xml
-libvirt_lxc_api=@datadir@/docs/libvirt-lxc-api.xml
+libvirt_qemu_api=@abs_top_builddir@/docs/libvirt-qemu-api.xml
+libvirt_lxc_api=@abs_top_builddir@/docs/libvirt-lxc-api.xml
 
 Name: libvirt
 Version: @VERSION@