Index | Thread | Search

From:
Jeremie Courreges-Anglas <jca@wxcvbn.org>
Subject:
Re: pkg-config relocatable .pc support
To:
George Koehler <kernigh@gmail.com>
Cc:
tech@openbsd.org, Antoine Jacoutot <ajacoutot@bsdfrog.org>
Date:
Wed, 15 Jan 2025 13:03:59 +0100

Download raw body.

Thread
On Mon, Jan 13, 2025 at 04:50:04PM -0500, George Koehler wrote:
> On Mon, 13 Jan 2025 19:41:43 +0100
> Jeremie Courreges-Anglas <jca@wxcvbn.org> wrote:
> 
> > Thanks for checking, updated diff below.
> 
> ok gkoehler@
> I haven't built any ports.

Committed after a bulk build with relocatable patches dropped in
ports/x11/gnome/librsvg and ports/x11/mono-gtk2.  Antoine: I'd wait a
few days before dropping said patches from the ports tree.

> > Index: OpenBSD/PkgConfig.pm
> > ===================================================================
> > RCS file: /cvs/src/usr.bin/pkg-config/OpenBSD/PkgConfig.pm,v
> > diff -u -p -r1.12 PkgConfig.pm
> > --- OpenBSD/PkgConfig.pm	11 Feb 2024 03:57:10 -0000	1.12
> > +++ OpenBSD/PkgConfig.pm	13 Jan 2025 18:30:49 -0000
> > @@ -19,6 +19,7 @@ use v5.36;
> >  
> >  # interface to the *.pc file format of pkg-config.
> >  package OpenBSD::PkgConfig;
> > +use File::Basename;
> >  
> >  # specific properties may have specific needs.
> >  
> > @@ -106,6 +107,8 @@ sub read_fh($class, $fh, $name = '')
> >  {
> >  	my $cfg = $class->new;
> >  
> > +	$cfg->add_variable('pcfiledir', dirname($name));
> > +
> >  	while (<$fh>) {
> >  		chomp;
> >  		# continuation lines
> > @@ -145,6 +148,8 @@ sub read_file($class, $filename)
> >  sub write_fh($self, $fh)
> >  {
> >  	foreach my $variable (@{$self->{vlist}}) {
> > +		# writing out pcfiledir makes no sense
> > +		next if $variable eq 'pcfiledir';
> >  		say $fh "$variable=", $self->{variables}{$variable};
> >  	}
> >  	print $fh "\n\n";
> > 
> > 
> > -- 
> > jca

-- 
jca