diff --git a/archivers/xar/Portfile b/archivers/xar/Portfile
index 918e4a29cd8..c8253469217 100644
--- a/archivers/xar/Portfile
+++ b/archivers/xar/Portfile
@@ -4,17 +4,12 @@ PortSystem          1.0
 PortGroup           clang_dependency 1.0
 PortGroup           github 1.0
 
-platform darwin {
-    if {${os.major} <= 22} {
-        set apple_version   498
-    } else {
-        set apple_version   501
-    }
-}
-
-github.setup        apple-oss-distributions xar ${apple_version} xar-
-version             1.8.0.${apple_version}
-revision            0
+github.setup        apple-oss-distributions xar 501 xar-
+version             1.8.0.${github.version}
+revision            1
+checksums           rmd160  9a30fb4730de5bb8d70ff2692d7276d7f586ef50 \
+                    sha256  6a9257017243c78d37e3788717259e53ffd33d93c740c12754e8527943fe892d \
+                    size    224936
 
 categories          archivers sysutils
 license             BSD
@@ -22,30 +17,10 @@ description         xar is the eXtensible ARchiver
 long_description    {*}${description}
 maintainers         {mps @Schamschula} openmaintainer
 
-distname            ${name}-${apple_version}
-
 worksrcdir          ${distname}/xar
 
-platform darwin {
-    if {${os.major} <= 22} {
-        checksums   rmd160  0471deb9e01c91658feb4ea120772f7478f5c350 \
-                    sha256  34f2e97c6786d2994af30fd72447ff1ac53f4052391a1030424da291f26c44f4 \
-                    size    224456
-
-        # see: https://trac.macports.org/ticket/64837
-        patchfiles  patch-src-xar_internal.h.old.diff
-    } else {
-        checksums   rmd160  9a30fb4730de5bb8d70ff2692d7276d7f586ef50 \
-                    sha256  6a9257017243c78d37e3788717259e53ffd33d93c740c12754e8527943fe892d \
-                    size    224936
-
-        # see: https://trac.macports.org/ticket/64837
-        patchfiles  patch-src-xar_internal.h.diff
-    }
-}
-
-depends_build       port:pkgconfig \
-                    port:automake
+depends_build       port:automake \
+                    path:bin/pkg-config:pkgconfig
 
 depends_lib         path:lib/libssl.dylib:openssl \
                     port:bzip2 \
@@ -71,6 +46,9 @@ patchfiles-append   patch-stdout.diff
 # see: https://trac.macports.org/ticket/64826
 patchfiles-append   patch-include-xar.h.in.diff
 
+# see: https://trac.macports.org/ticket/64837
+patchfiles          patch-src-xar_internal.h.diff
+
 # see: https://trac.macports.org/ticket/65128
 patchfiles-append   patch-lib-filetree.c.diff
 
@@ -85,3 +63,7 @@ post-patch {
 }
 
 use_autoconf        yes
+
+# https://trac.macports.org/ticket/71162
+configure.cppflags-append \
+                    -DXARSIG_BUILDING_WITH_XAR
diff --git a/archivers/xar/files/patch-lib-filetree.c.diff b/archivers/xar/files/patch-lib-filetree.c.diff
index 6c528b8feae..7eee71d849c 100644
--- a/archivers/xar/files/patch-lib-filetree.c.diff
+++ b/archivers/xar/files/patch-lib-filetree.c.diff
@@ -1,6 +1,6 @@
---- lib/filetree.c.orig	2022-05-03 23:39:20.000000000 -0500
-+++ lib/filetree.c	2022-05-08 06:01:32.000000000 -0500
-@@ -740,7 +740,8 @@
+--- lib/filetree.c.orig	2024-09-24 15:39:21.000000000 -0500
++++ lib/filetree.c	2024-10-23 20:06:12.000000000 -0500
+@@ -752,7 +752,8 @@
  	size_t fspath1_size = 0, fspath2_size = 0;
  	size_t ns1_size = 0, ns2_size = 0;
  	const struct __xar_file_t * child1 = NULL, * child2 = NULL;
diff --git a/archivers/xar/files/patch-stdout.diff b/archivers/xar/files/patch-stdout.diff
index ec211bed758..37f92f96e31 100644
--- a/archivers/xar/files/patch-stdout.diff
+++ b/archivers/xar/files/patch-stdout.diff
@@ -106,11 +106,8 @@ https://github.com/mackyle/xar/commit/ddea2e4b53b6b2cfdd0d13c6beaac0978330c2a2 2
  
 --- src/xar.c.orig	2022-03-10 05:12:27.000000000 -0600
 +++ src/xar.c	2022-03-10 05:39:41.000000000 -0600
-@@ -53,8 +53,10 @@
- #include "config.h"
- #include "../lib/filetree.h"
+@@ -55,6 +55,7 @@
  #include "util.h"
-+#include "xar.h"
  #define SYMBOLIC 1
  #define NUMERIC  2
 +#define XAR_OPT_EXTRACTSTDOUT  "extract-stdout" /* Extract data to stdout instead of file (true/false) */
