Skip to content

Commit

Permalink
Conditionalize for :standalone-ide
Browse files Browse the repository at this point in the history
This is almost just like the conditionalization for :mac-app-store.
The main difference is that it uses a different bundle ID.
  • Loading branch information
xrme authored and R. Matthew Emerson committed May 23, 2021
1 parent 6c1a945 commit 84b8133
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cocoa-ide/app-delegate.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
(#/registerDefaults: domain dict)
(#/release dict)
(update-cocoa-defaults)
#-mac-app-store
#-(or mac-app-store standalone-ide)
(when *standalone-cocoa-ide*
(init-ccl-directory-for-ide))))

Expand Down
12 changes: 7 additions & 5 deletions cocoa-ide/cocoa-application.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
(eval-when (:compile-toplevel :load-toplevel :execute)
(pushnew :cocotron *features*))

#+mac-app-store
#+(or mac-app-store standalone-ide)
(defvar *cocoa-ide-path* "ccl:Clozure CL.app;")
#-mac-app-store
#-(or mac-app-store standalone-ide)
(defvar *cocoa-ide-path*
(let* ((bits (nth-value 1 (host-platform))))
(format nil "ccl:Clozure CL~a.app;" bits)))
Expand All @@ -36,14 +36,16 @@
(declare (ignore os))
#+mac-app-store
(format nil "store.ccl-~a~a" (string-downcase cpu) bits)
#-mac-app-store
#+standalone-ide
(format nil "ccl-~a~a" (string-downcase cpu) bits)
#-(or mac-app-store standalone-ide)
(format nil "Clozure CL-~a~a" (string-downcase cpu) bits)))

(defvar *cocoa-ide-frameworks* #+cocotron '("ccl:cocotron;Foundation.framework;" "ccl:cocotron;AppKit.framework;" "ccl:cocotron;CoreData.framework;") #-cocotron nil)
(defvar *cocoa-ide-libraries* #+cocotron '("ccl:cocotron;Foundation>.1>.0.dll" "ccl:cocotron;AppKit>.1>.0.dll" "ccl:cocotron;CoreData>.1>.0.dll") #-cocotron nil)

(defvar *cocoa-ide-force-compile* #+mac-app-store t
#-mac-app-store nil)
(defvar *cocoa-ide-force-compile* #+(or mac-app-store standalone-ide) t
#-(or mac-app-store standalone-ide) nil)
(load "ccl:cocoa-ide;defsystem.lisp")
(load-ide *cocoa-ide-force-compile*)

Expand Down
6 changes: 3 additions & 3 deletions cocoa-ide/defsystem.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@
"preferences"
"processes-window"
"apropos-window"
#-mac-app-store
#-(or mac-app-store standalone-ide)
"xapropos"
"hemlock-commands"
"file-dialogs"
"menus"
"app-delegate"
#-mac-app-store
#-(or mac-app-store standalone-ide)
"ide-self-update"
,(if (use-pre-lion-search-files)
"search-files-pre-lion"
"search-files")
"start"
#-mac-app-store
#-(or mac-app-store standalone-ide)
"xinspector"
))

Expand Down
15 changes: 11 additions & 4 deletions cocoa-ide/ide-bundle.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,17 @@
(subseq name 0 (- len 4))
name)))
(bundle-id (concatenate 'string bundle-prefix "." (or bundle-suffix bundle-name)))
(bundle-version (multiple-value-bind (os bits cpu)
(ccl::host-platform)
(declare (ignore os))
(format nil "~d (~a~d)" *openmcl-svn-revision* cpu bits)))
#-mac-app-store
(bundle-version (format nil "~d.~d~@[.~a~]" *openmcl-major-version*
*openmcl-minor-version* *openmcl-revision*))
;; The Mac App Store requires that CFBundleVersion must be
;; greater than the last one. When we used Subversion, it
;; was convenient to use the revision number as the bundle
;; version number. There's no such analog on git, so we're
;; in a pickle, and about all we can do is make this a number
;; that we must increment manually.
#+mac-app-store
(bundle-version "111800") ;1.11.8
(needles `(("OPENMCL-KERNEL" . ,kernel-name)
("OPENMCL-ICONS" . #+mac-app-store "store.icns"
#-mac-app-store "openmcl-icon.icns")
Expand Down
4 changes: 2 additions & 2 deletions cocoa-ide/menus.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
(#/addItemWithTitle:action:keyEquivalent: menu #@"Definitions..." (objc:@selector #/showListDefinitions:) #@"")
menu))

#-mac-app-store
#-(or mac-app-store standalone-ide)
(defun @experiments-menu ()
(let ((menu (#/initWithTitle: (#/alloc ns:ns-menu) #@"Experiments")))
(#/addItemWithTitle:action:keyEquivalent: menu #@"xapropos" (objc:@selector #/showXaproposWindow:) #@"")
Expand Down Expand Up @@ -159,7 +159,7 @@
(add-menu #@"Edit" (#/autorelease (@edit-menu)))
(add-menu #@"Lisp" (#/autorelease (@lisp-menu)))
(add-menu #@"Tools" (#/autorelease (@tools-menu)))
#-mac-app-store
#-(or mac-app-store standalone-ide)
(add-menu #@"Experiments" (#/autorelease (@experiments-menu)))
(let ((window-menu (@window-menu)))
(add-menu #@"Window" window-menu)
Expand Down
27 changes: 27 additions & 0 deletions scripts/make-standalone-app
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

# Clozure CL.app has already been built with :standalone-app # on *features*

ccl=~/ccl
app="$ccl/Clozure CL.app"
target="$app/Contents/Resources/ccl"

mkdir "$target"
( cd "$ccl/lisp-kernel/darwinx8664" && make clean )
( cd "$ccl/lisp-kernel/darwinx8632" && make clean )
( cd "$ccl/cocoa-ide/altconsole" && make clean && rm -rf AltConsole.app )

for i in cocoa-ide compiler darwin-x86-headers64 doc examples level-0 level-1 lib library lisp-kernel objc-bridge scripts tools xdump; do
cp -Rp "$ccl/$i" "$target"
# we want the fasls for tools/, mainly because asdf.lisp is slow
# to load from source
if test "$i" != tools; then
find "$target/$i" -type f -name "*.*fsl" -exec rm -rf {} \;
fi
done

find "$app" -type d -name .svn -exec rm -rf {} \;

codesign -s "3rd Party Mac Developer Application: Clozure Associates, LLC" "$app/Contents/Resources/AltConsole.app"
codesign -s "3rd Party Mac Developer Application: Clozure Associates, LLC" "$app"

0 comments on commit 84b8133

Please sign in to comment.