Skip to content

Commit

Permalink
fix(build): add hack to rewrite static linking
Browse files Browse the repository at this point in the history
  • Loading branch information
G4Vi committed Aug 9, 2024
1 parent 6dab4ce commit 64f4e61
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Alien-libextism/Changes
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
10 changes: 10 additions & 0 deletions Alien-libextism/alienfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/;
}
};
2 changes: 1 addition & 1 deletion Alien-libextism/lib/Alien/libextism.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 64f4e61

Please sign in to comment.