Skip to content

Commit 64f4e61

Browse files
committed
fix(build): add hack to rewrite static linking
1 parent 6dab4ce commit 64f4e61

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

Alien-libextism/Changes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
Revision history for Alien-libextism
2+
v0.1.1 2024-08-09
3+
Add hack to rewrite static linking
24

35
v0.1.0 2024-06-05
46
First version, released on an unsuspecting world.

Alien-libextism/alienfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,13 @@ gather [
2020
[ 'pkg-config --cflags --static extism-static', \'%{.runtime.cflags_static}' ],
2121
[ 'pkg-config --libs --static extism-static', \'%{.runtime.libs_static}' ],
2222
];
23+
24+
# Hack rewrite static linking to avoid referring to filename
25+
# ExtUtils::MakeMaker strips /path/to/libextism.a from LIBS
26+
after 'gather' => sub {
27+
my ($hash) = @_;
28+
if ($hash->{runtime_prop}{libs_static} =~ /libextism\.a/) {
29+
my $libextismdir = $hash->{install_prop}{prefix}.'/lib';
30+
$hash->{runtime_prop}{libs_static} =~ s/[^ ]+libextism\.a/-L$libextismdir -lextism/;
31+
}
32+
};

Alien-libextism/lib/Alien/libextism.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use strict;
55
use warnings;
66
use parent qw( Alien::Base );
77
use version 0.77;
8-
our $VERSION = qv(v0.1.0);
8+
our $VERSION = qv(v0.1.1);
99

1010
1;
1111

0 commit comments

Comments
 (0)