From 720ecf51046ace1ae9e830578848e2ae7b0d5376 Mon Sep 17 00:00:00 2001
From: "Robert P. Goldman" <rpgoldman@gmail.com>
Date: Wed, 12 Feb 2014 11:50:25 -0600
Subject: [PATCH] Incorporated Mark Evenson's check for ABCL bundle support on
 Mac OS X.

Proposed fix for https://bugs.launchpad.net/asdf/+bug/1207073
---
 bundle.lisp             | 3 ++-
 header.lisp             | 7 +++++++
 test/test-bundle.script | 8 +++++++-
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/bundle.lisp b/bundle.lisp
index 7dbb9c5c..038716e3 100644
--- a/bundle.lisp
+++ b/bundle.lisp
@@ -483,7 +483,8 @@ itself.")) ;; operation on a system and its dependencies
     (apply #'operate 'binary-op system args)))
 
 #+(and (not asdf-use-unsafe-mac-bundle-op)
-       (or (and ecl darwin) (and abcl darwin)))
+       (or (and ecl darwin)
+           (and abcl darwin (not abcl-bundle-op-supported))))
 (defmethod perform :before ((o basic-fasl-op) (c component))
   (unless (featurep :asdf-use-unsafe-mac-bundle-op)
     (cerror "Continue after modifying *FEATURES*."
diff --git a/header.lisp b/header.lisp
index 321386d8..75c296ae 100644
--- a/header.lisp
+++ b/header.lisp
@@ -53,6 +53,13 @@
 (eval-when (:load-toplevel :compile-toplevel :execute)
   (setf ext:*gc-verbose* nil))
 
+;;; pre 1.3.0 ABCL versions do not support the bundle-op on Mac OS X
+#+abcl
+(eval-when (:load-toplevel :compile-toplevel :execute)
+  (unless (and (member :darwin *features*)
+               (second (third (sys::arglist 'directory))))
+    (push :abcl-bundle-op-supported *features*)))
+
 ;; Punt on hard package upgrade: from ASDF1 always, and even from ASDF2 on most implementations.
 (eval-when (:load-toplevel :compile-toplevel :execute)
   (unless (member :asdf3 *features*)
diff --git a/test/test-bundle.script b/test/test-bundle.script
index 751aad2c..fa9cc083 100644
--- a/test/test-bundle.script
+++ b/test/test-bundle.script
@@ -10,9 +10,15 @@
 (asdf:clear-system :test-asdf/bundle-2)
 (when (find-package :test-package) (delete-package :test-package))
 
-#+(and darwin (or abcl ecl))
+#+(and darwin ecl)
 (leave-test "Bundle test doesn't work on Mac on this lisp." 0)
 
+(when (and (member :abcl *features*)
+           (os-macosx-p)
+           ;; bundles don't work on pre-1.3.0
+           (second (third (sys::arglist 'directory))))
+  (leave-test "Bundle test doesn't work on Mac on this version of ABCL." 0))
+
 #+(or (and ecl ecl-bytecmp) gcl)
 (leave-test "bundles not on this implementation" 0)
 
-- 
GitLab