about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-12-13 00:50:12 +0000
committerEric Wong <e@80x24.org>2023-12-13 09:01:50 +0000
commit769deabdc7db27026f555576e87eac7ca1f19afd (patch)
tree3b8442c435856c3077450e96f2c188054610bec8 /lib
parente3444977887f7615cef271341f29f3a87a36eac9 (diff)
downloadpublic-inbox-769deabdc7db27026f555576e87eac7ca1f19afd.tar.gz
We don't actually need Inline::C support to build a standalone
executable implemented in C++.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/XapHelperCxx.pm11
1 files changed, 6 insertions, 5 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;