diff --git a/Alien-libextism/Changes b/Alien-libextism/Changes index eb3ddf4..94cdeb8 100644 --- a/Alien-libextism/Changes +++ b/Alien-libextism/Changes @@ -1,4 +1,6 @@ Revision history for Alien-libextism +v0.1.1 2024-08-09 + Add hack to rewrite static linking v0.1.0 2024-06-05 First version, released on an unsuspecting world. diff --git a/Alien-libextism/alienfile b/Alien-libextism/alienfile index 4704e37..4c122b4 100644 --- a/Alien-libextism/alienfile +++ b/Alien-libextism/alienfile @@ -20,3 +20,13 @@ gather [ [ 'pkg-config --cflags --static extism-static', \'%{.runtime.cflags_static}' ], [ 'pkg-config --libs --static extism-static', \'%{.runtime.libs_static}' ], ]; + +# Hack rewrite static linking to avoid referring to filename +# ExtUtils::MakeMaker strips /path/to/libextism.a from LIBS +after 'gather' => sub { + my ($hash) = @_; + if ($hash->{runtime_prop}{libs_static} =~ /libextism\.a/) { + my $libextismdir = $hash->{install_prop}{prefix}.'/lib'; + $hash->{runtime_prop}{libs_static} =~ s/[^ ]+libextism\.a/-L$libextismdir -lextism/; + } +}; diff --git a/Alien-libextism/lib/Alien/libextism.pm b/Alien-libextism/lib/Alien/libextism.pm index e6ff5dc..dd3dd86 100644 --- a/Alien-libextism/lib/Alien/libextism.pm +++ b/Alien-libextism/lib/Alien/libextism.pm @@ -5,7 +5,7 @@ use strict; use warnings; use parent qw( Alien::Base ); use version 0.77; -our $VERSION = qv(v0.1.0); +our $VERSION = qv(v0.1.1); 1;