deri pushed a commit to branch master
in repository groff.

commit e2f074b6640166a254be53c0734c168c5c1b7c4a
Author: Deri James <[email protected]>
AuthorDate: Thu Feb 5 23:48:32 2026 +0000

    Change location of the Inline::C build directory
    
    * src/devices/gropdf/gropdf.pl: Update copyright.
    Include module File::Path (part of perl since before
    version 5.8).
    Adjust location of Inline::C's cache directory according
    to XDG standards, rather than $HOME/_Inline.
    
    Thanks to Bruno Haible for the information in:-
    
    <https://lists.gnu.org/archive/html/groff/2026-01/\
    msg00140.html>
    
    Fixes <https://savannah.gnu.org/bugs/?67997>
---
 ChangeLog                    | 17 +++++++++++++++++
 src/devices/gropdf/gropdf.pl | 12 ++++++++----
 2 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ca157d341..2f93ffe08 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2026-01-20  Deri James  <[email protected]>
+
+       Change location of the Inline::C build directory
+
+       * src/devices/gropdf/gropdf.pl: Update copyright.
+       Include module File::Path (part of perl since before
+       version 5.8).
+       Adjust location of Inline::C's cache directory according
+       to XDG standards, rather than $HOME/_Inline.
+
+       Thanks to Bruno Haible for the information in:-
+
+       <https://lists.gnu.org/archive/html/groff/2026-01/\
+       msg00140.html>
+
+       Fixes <https://savannah.gnu.org/bugs/?67997>
+
 2026-02-04  G. Branden Robinson <[email protected]>
 
        Stop using `${1+"$@"}` to kludge around old broken shells.
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index b239b09ae..4b3241a5f 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -2,7 +2,7 @@
 #
 # gropdf: PDF post processor for groff
 #
-# Copyright 2011-2025 Free Software Foundation, Inc.
+# Copyright 2011-2026 Free Software Foundation, Inc.
 #
 # Written by Deri James <[email protected]>
 #
@@ -28,6 +28,7 @@ use Getopt::Long qw(:config bundling);
 use Encode qw(encode);
 use POSIX qw(mktime);
 use File::Spec;
+use File::Path;
 
 use constant
 {
@@ -245,12 +246,15 @@ else
     . " this PDF");
 }
 
-mkdir $ENV{HOME}.'/_Inline' if !-e $ENV{HOME}.'/_Inline' and 
!exists($ENV{PERL_INLINE_DIRECTORY}) and exists($ENV{HOME});
-
 $rc = eval
 {
     require Inline;
-    Inline->import (C => Config => DIRECTORY => $ENV{HOME}.'/_Inline') if 
!exists($ENV{PERL_INLINE_DIRECTORY}) and exists($ENV{HOME});
+    my $inline;
+    $inline=$ENV{XDG_CACHE_HOME} if exists($ENV{XDG_CACHE_HOME});
+    $inline=$ENV{HOME}."/.cache/gropdf" if !$inline and exists($ENV{HOME});
+    $inline=$ENV{PERL_INLINE_DIRECTORY} if exists($ENV{PERL_INLINE_DIRECTORY});
+    mkpath($inline) if $inline;
+    Inline->import (C => Config => DIRECTORY => $inline) if $inline;
     Inline->import (C =><<'EOC');
 
     static const uint32_t MAGIC1 = 52845;

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to