diff options
author | Eric Wong <e@80x24.org> | 2023-12-13 00:50:12 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-12-13 09:01:50 +0000 |
commit | 769deabdc7db27026f555576e87eac7ca1f19afd (patch) | |
tree | 3b8442c435856c3077450e96f2c188054610bec8 | |
parent | e3444977887f7615cef271341f29f3a87a36eac9 (diff) | |
download | public-inbox-769deabdc7db27026f555576e87eac7ca1f19afd.tar.gz |
We don't actually need Inline::C support to build a standalone executable implemented in C++.
-rw-r--r-- | lib/PublicInbox/XapHelperCxx.pm | 11 | ||||
-rw-r--r-- | t/xap_helper.t | 6 |
2 files changed, 10 insertions, 7 deletions
diff --git a/lib/PublicInbox/XapHelperCxx.pm b/lib/PublicInbox/XapHelperCxx.pm index 17f988ee..8e95ff42 100644 --- a/lib/PublicInbox/XapHelperCxx.pm +++ b/lib/PublicInbox/XapHelperCxx.pm @@ -16,8 +16,9 @@ use autodie; my $cxx = which($ENV{CXX} // 'c++'); my $dir = substr("$cxx-$Config{archname}", 1); # drop leading '/' $dir =~ tr!/!-!; -$ENV{PERL_INLINE_DIRECTORY} // die('BUG: PERL_INLINE_DIRECTORY unset'); -substr($dir, 0, 0) = "$ENV{PERL_INLINE_DIRECTORY}/"; +my $idir = ($ENV{XDG_CACHE_HOME} // + (($ENV{HOME} // die('HOME unset')).'/.cache')).'/public-inbox/jaot'; +substr($dir, 0, 0) = "$idir/"; my $bin = "$dir/xap_helper"; my ($srcpfx) = (__FILE__ =~ m!\A(.+/)[^/]+\z!); my @srcs = map { $srcpfx.$_ } qw(xh_mset.h xh_cidx.h xap_helper.h); @@ -54,9 +55,9 @@ sub needs_rebuild () { } sub build () { - if (!-d $dir && !CORE::mkdir($dir)) { - my $err = $!; - die "mkdir($dir): $err" if !-d $dir; + if (!-d $dir) { + require File::Path; + File::Path::make_path($dir); } require PublicInbox::CodeSearch; require PublicInbox::Lock; diff --git a/t/xap_helper.t b/t/xap_helper.t index be010c75..0f474608 100644 --- a/t/xap_helper.t +++ b/t/xap_helper.t @@ -149,8 +149,10 @@ unless ($ENV{TEST_XH_CXX_ONLY}) { no_pollerfd($ar->{pid}); } SKIP: { - require PublicInbox::XapHelperCxx; - my $cmd = eval { PublicInbox::XapHelperCxx::cmd() }; + my $cmd = eval { + require PublicInbox::XapHelperCxx; + PublicInbox::XapHelperCxx::cmd(); + }; skip "XapHelperCxx build: $@", 1 if $@; @NO_CXX = $ENV{TEST_XH_CXX_ONLY} ? (0) : (0, 1); |