Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Revision history for {{$dist->name}}

{{$NEXT}}
- Fixes for Solaris (gh#442)
- Added checklib_args2 method to Alien::Build::Wrapper (gh#440)

2.87 2026-09-11 20:31:38 -0600
- Alien::Base::Wrapper->mm_args2 no longer overwrites a caller-specified
Expand Down
5 changes: 4 additions & 1 deletion lib/Alien/Build/Plugin/Build/Copy.pm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ sub init
$build->system(qq{xcopy . "$stage" /E});
});
}
elsif($^O eq 'darwin')
elsif($^O eq 'darwin' || $^O eq 'solaris')
{
# On recent macOS -pPR is the same as -aR
# on older Mac OS X (10.5 at least) -a is not supported but -pPR is.
Expand All @@ -91,6 +91,9 @@ sub init
# differences between -pPR and -aR on coreutils, that may or may not be
# important enough to care about.

# Solaris /usr/bin/cp and /usr/xpg4/bin/cp don't support -a at all,
# but do support -p, -P and -R.

$meta->register_hook(build => [
'cp -pPR * "%{.install.stage}"',
]);
Expand Down
2 changes: 1 addition & 1 deletion lib/Alien/Build/Plugin/Core/Setup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ sub _cpu_arch {
| \b i386 \b # freebsd-i386
| \b i486 \b # i486-linux
| \b i686 \b # i686-cygwin
| \b i86pc.*64 \b # i86pc-solaris-thread-multi-64
| \b i86pc \b # i86pc-solaris, i86pc-solaris-thread-multi-64
/ix ) {
$arch = { name => 'x86' };
} elsif( $Config{archname} =~ m/
Expand Down
28 changes: 21 additions & 7 deletions lib/Alien/Build/Plugin/PkgConfig/CommandLine.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use strict;
use warnings;
use 5.008004;
use Alien::Build::Plugin;
use Capture::Tiny qw( capture_merged );
use Carp ();

# ABSTRACT: Probe system and determine library or tool properties using the pkg-config command line interface
Expand Down Expand Up @@ -44,18 +45,31 @@ has '+pkg_name' => sub {
# NOT used, for compat with other PkgConfig plugins
has register_prereqs => 1;

sub _supports_static {
my($bin) = @_;
# Some very old pkg-config implementations (e.g. the one still
# found on some Solaris installs) predate the --static flag
# entirely, and this plugin relies on it to gather the
# {libs,cflags}_static properties.
my $help = capture_merged { system $bin, '--help' };
return $help =~ /--static\b/ ? 1 : 0;
}

sub _bin_name {

# We prefer pkgconf to pkg-config because it seems to be the future.

require File::Which;
File::Which::which($ENV{PKG_CONFIG})
? $ENV{PKG_CONFIG}
: File::Which::which('pkgconf')
? 'pkgconf'
: File::Which::which('pkg-config')
? 'pkg-config'
: undef;

foreach my $bin ($ENV{PKG_CONFIG}, 'pkgconf', 'pkg-config')
{
next unless $bin;
next unless File::Which::which($bin);
next unless _supports_static($bin);
return $bin;
}

undef;
};

has bin_name => \&_bin_name;
Expand Down
9 changes: 9 additions & 0 deletions t/alien_build_plugin_pkgconfig_commandline.t
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ subtest 'available' => sub {
],
);

# these tests are about the which()-based negotiation logic, not
# about whether the (fake, non-existent) binaries actually support
# --static, so pretend they all do.
my $mock_static = mock 'Alien::Build::Plugin::PkgConfig::CommandLine' => (
override => [
_supports_static => sub { 1 },
],
);

subtest 'no command line' => sub {

%which = ();
Expand Down
9 changes: 9 additions & 0 deletions t/alien_build_plugin_pkgconfig_negotiate__pick.t
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ subtest 'CommandLine' => sub {
],
);

# these tests are about the which()-based negotiation logic, not
# about whether the (fake, non-existent) binaries actually support
# --static, so pretend they all do.
my $mock_static = mock 'Alien::Build::Plugin::PkgConfig::CommandLine' => (
override => [
_supports_static => sub { 1 },
],
);

my $mock2 = mock 'Alien::Build::Plugin::PkgConfig::Negotiate';

if($^O =~ /^(solaris|MSWin32)$/) {
Expand Down
Loading