From 803d8ff0d5e82dce47ab52b6a53594887843a42c Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 16 Apr 2017 15:46:51 -0600 Subject: [PATCH] fix launcher creation for `gracket[-text]` on Mac OS The repair in 71a43f34c8 fixed the creation of some launchers, but it broke GUI launchers with a relative reference on Mac OS. --- racket/collects/launcher/launcher.rkt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/racket/collects/launcher/launcher.rkt b/racket/collects/launcher/launcher.rkt index c85a15a59d..d3acda779c 100644 --- a/racket/collects/launcher/launcher.rkt +++ b/racket/collects/launcher/launcher.rkt @@ -425,9 +425,10 @@ (if (eq? kind 'mred) (find-gui-bin-dir) (find-console-bin-dir)))] + [as-relative? (let ([a (assq 'relative? aux)]) + (and a (cdr a)))] [dir-finder - (if (let ([a (assq 'relative? aux)]) - (and a (cdr a))) + (if as-relative? (make-relative-path-header dest bindir use-librktdir?) (make-absolute-path-header bindir))] [exec (format @@ -470,7 +471,11 @@ (when use-librktdir? (display "# {{{ librktdir\n") (display "librktdir=\"$bindir/") - (display (find-relative-path bindir + (display (find-relative-path (if as-relative? + (simplify-path + (let-values ([(base name dir?) (split-path (path->complete-path dest))]) + base)) + bindir) (simplify-path (find-lib-dir)))) (display "\"\n")