# ex:ts=8 sw=4:
-# $OpenBSD: PackingElement.pm,v 1.248 2018/01/01 14:02:37 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.249 2018/01/24 16:52:44 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
sub keyword() { "libset" }
__PACKAGE__->register_with_factory;
+sub new
+{
+ my ($class, $args) = @_;
+ if ($args =~ m/(.*)\:(.*)/) {
+ return bless {name => $1, libs => [split(/\,/, $2)]}, $class;
+ } else {
+ die "Bad args for libset: $args";
+ }
+}
+
+sub stringize
+{
+ my $self = shift;
+ return $self->{name}.':'.join(',', @{$self->{libs}});
+}
+
package OpenBSD::PackingElement::PkgPath;
our @ISA=qw(OpenBSD::PackingElement::Meta);
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgCreate.pm,v 1.130 2018/01/05 13:39:55 espie Exp $
+# $OpenBSD: PkgCreate.pm,v 1.131 2018/01/24 16:52:45 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
}
$state->{system_version} += $d;
},
+ 'w' => sub {
+ my $w = shift;
+ $state->{libset}{$w} = 1;
+ },
'W' => sub {
my $w = shift;
$state->{wantlib}{$w} = 1;
},
};
$state->{no_exports} = 1;
- $state->SUPER::handle_options('p:f:d:M:U:A:B:P:V:W:qQS',
+ $state->SUPER::handle_options('p:f:d:M:U:A:B:P:V:w:W:qQS',
'[-nQqvSx] [-A arches] [-B pkg-destdir] [-D name[=value]]',
'[-L localbase] [-M displayfile] [-P pkg-dependency]',
- '[-U undisplayfile] [-V n] [-W wantedlib]',
+ '[-U undisplayfile] [-V n] [-W wantedlib] [-w libset]',
'[-d desc -D COMMENT=value -f packinglist -p prefix]',
'pkg-name');
my $okay = 1;
my $lib_finder = OpenBSD::lookup::library->new($solver);
my $h = $solver->{set}->{new}[0];
- for my $lib (@{$h->{plist}->{wantlib}}) {
+ for my $lib (@{$h->{plist}{wantlib}}) {
$solver->{localbase} = $h->{plist}->localbase;
next if $lib_finder->lookup($solver,
$solver->{to_register}->{$h}, $state,
for my $w (sort keys %{$state->{wantlib}}) {
OpenBSD::PackingElement::Wantlib->add($plist, $w);
}
+ for my $w (sort keys %{$state->{libset}}) {
+ OpenBSD::PackingElement::Libset->add($plist, $w);
+ }
if (defined $state->opt('A')) {
OpenBSD::PackingElement::Arch->add($plist, $state->opt('A'));