diff --git a/Info.plist b/Info.plist
index 7e43062..34c2287 100644
--- a/Info.plist
+++ b/Info.plist
@@ -1,27 +1,35 @@
-
+
- CFBundleDevelopmentRegion
- English
- CFBundleExecutable
- onyx-inst
- CFBundleGetInfoString
- OverbiteNX Onyx for macOS
- CFBundleIdentifier
- com.floodgap.onyx
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
+ CFBundleDevelopmentRegion
+ en
+ CFBundleExecutable
+ onyx-inst
+ CFBundleIdentifier
+ com.floodgap.onyx
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
Onyx
- CFBundlePackageType
- APPL
- CFBundleShortVersionString
- 0.9.2.0
- CFBundleVersion
- 902.0.0
- LSMinimumSystemVersion
- 10.9
+ CFBundleShortVersionString
+ 0.9.2.1
+ CFBundleVersion
+ 902.1.0
+ LSMinimumSystemVersion
+ 10.9
+ LSUIElement
+
+ NSAppTransportSecurity
+
+ NSAllowsArbitraryLoads
+
+
+ NSHumanReadableCopyright
+ © 2019 Cameron Kaiser
+ NSMainNibFile
+ MainMenu
+ NSPrincipalClass
+ NSApplication
-
diff --git a/Makefile.macos b/Makefile.macos
index d2b739e..6f13ce6 100644
--- a/Makefile.macos
+++ b/Makefile.macos
@@ -1,10 +1,15 @@
-CP=/bin/cp
+MV=/bin/mv
RM=/bin/rm
MKDIR=/bin/mkdir
DITTO=/usr/bin/ditto
+PLUTIL=/usr/bin/plutil
HDIUTIL=/usr/bin/hdiutil
-WHEREDIR=mac
-WHERE=$(WHEREDIR)/Onyx.app/Contents
+PLATYPUS=/usr/local/bin/platypus
+
+WHERE=mac
+APP=$(WHERE)/Onyx.app
+APPCON=$(APP)/Contents
+APPOBJ=$(APPCON)/MacOS
.PHONY: default clean
@@ -12,15 +17,33 @@ WHERE=$(WHEREDIR)/Onyx.app/Contents
# just packages that binary.
Onyx.dmg: onyx clean
- $(MKDIR) -p $(WHERE)/MacOS
- $(CP) Info.plist $(WHERE)
- $(CP) mac-onyx-inst $(WHERE)/MacOS/onyx-inst
- $(CP) onyx $(WHERE)/MacOS
- $(DITTO) "Mac Read Me.rtf" $(WHEREDIR)
+ $(MKDIR) -p $(WHERE)
+ $(PLATYPUS) -a Onyx \
+ -I com.floodgap.onyx \
+ -i '' \
+ -c mac-onyx-inst \
+ -o "Progress Bar" \
+ -p /bin/sh \
+ -V 0.9.2.1 \
+ -u "Cameron Kaiser" \
+ -y $(APP)
+ #
+ # Manually fix the bundle so that everything is in the same
+ # places as prior versions for backwards compatibility. This means
+ # using a custom Info.plist and moving a few things around.
+ #
+ $(MV) $(APPOBJ)/Onyx $(APPOBJ)/onyx-inst
+ $(DITTO) Info.plist $(APPCON)
+ $(PLUTIL) -convert binary1 $(APPCON)/Info.plist
+ $(DITTO) onyx $(APP)/Contents/MacOS
+ #
+ # Build disk image.
+ #
+ $(DITTO) "Mac Read Me.rtf" $(WHERE)
$(HDIUTIL) create -sectors 6000 \
-fs HFS+ -fsargs "-c c=64,a=16,e=16" \
-volname "Overbite Onyx for macOS" \
- -srcfolder $(WHEREDIR) \
+ -srcfolder $(WHERE) \
-format UDBZ \
Onyx.dmg
@@ -28,4 +51,4 @@ onyx:
$(MAKE) -f Makefile.generic
clean:
- $(RM) -rf mac Onyx.dmg
+ $(RM) -rf $(WHERE) Onyx.dmg
diff --git a/README.md b/README.md
index e4b1d18..fbec600 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ OverbiteNX comes in two pieces: OverbiteNX itself, which is a standard WebExtens
OverbiteNX and Onyx are provided to you under the [Floodgap Free Software License](https://www.floodgap.com/software/ffsl/). You use this software package at your own risk. It is otherwise unsupported, and no warranty is expressed or implied regarding merchantability or fitness for a particular purpose.
-OverbiteNX and Onyx are copyright (C) 2017-8 Cameron Kaiser.
+OverbiteNX and Onyx are copyright (C) 2017-2019 Cameron Kaiser.
All rights reserved.
## OverbiteNX is currently in beta testing
@@ -29,7 +29,7 @@ If you notice any untoward behaviour, the current beta test generates copious de
1. Onyx is written in portable C that should compile on nearly any POSIX-compliant system. There are some Win32-specific sections due to irregularities with Winsock. `gcc` and `clang` are both supported compilers.
-2. If you have a Mac, and both Xcode and [MXE with NSIS](http://mxe.cc/) are installed, then you can just type `make` and the macOS DMG and Windows installer (and .xpi for Firefox, eventually) will be automatically built. If the Windows build blows up, make sure the path in `Makefile.mxe` is correctly pointing to your MXE binaries, and that you installed NSIS (which includes `makensis`). Note that the Mac application is unsigned. If you just want to build the Mac version by itself, do `make -f Makefile.macos` instead.
+2. If you have a Mac, and both Xcode and [MXE with NSIS](http://mxe.cc/) are installed, then you can just type `make` and the macOS DMG and Windows installer (and .xpi for Firefox, eventually) will be automatically built. If the Windows build blows up, make sure the path in `Makefile.mxe` is correctly pointing to your MXE binaries, and that you installed NSIS (which includes `makensis`). Note that the Mac application is unsigned. If you just want to build the Mac version by itself, do `make -f Makefile.macos` instead. The Mac version requires both a recent version of Xcode and [Platypus](https://sveinbjorn.org/platypus) to build.
3. If you are building on Linux/*BSD/etc. or a Mozilla tier-3 system, make sure you have both `make` and a C compiler installed (either `gcc` or `clang` is acceptable, though you may need to symlink your `clang` to `gcc` depending on your system's configuration), and build Onyx with `make -f Makefile.generic`. Once this is done, copy the resulting `onyx` binary to your desired location. Copy `EXAMPLE_onyx.json` to `onyx.json` and change the path in that file to the location of your new `onyx` binary, then copy `onyx.json` to [where the native manifest should be on your system](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_manifests#Manifest_location). If you have MXE installed, you should also be able to build the Windows version (again, verify the path to your MXE binaries is correct) with `make -f Makefile.mxe`.
diff --git a/mac-onyx-inst b/mac-onyx-inst
index 8b99178..b2da444 100755
--- a/mac-onyx-inst
+++ b/mac-onyx-inst
@@ -1,20 +1,36 @@
-#!/usr/bin/perl
+#!/bin/sh
-# Copyright 2018 Cameron Kaiser.
+# Copyright 2019 Cameron Kaiser.
# All rights reserved.
+#
+# This script was originally written in Perl, but now is written in sh to
+# prepare for the new sucky world of Catalina where scripting languages
+# are deprecated and Tim Cook smiles his mysterious venomous smile. In
+# particular, prepare for zsh instead of bash actually being /bin/sh.
+if [ -n "$ZSH_VERSION" ]; then emulate -L ksh; fi
-$JSON_DIR = "$ENV{'HOME'}/Library/Application Support/Mozilla/NativeMessagingHosts";
+JSON_DIR="$HOME/Library/Application Support/Mozilla/NativeMessagingHosts"
+echo "Onyx Installer Tool (C)2019 Cameron Kaiser"
+echo "Installing to: $JSON_DIR"
+echo " "
-if (! -x "/Applications/Onyx.app/Contents/MacOS/onyx") {
- &dialog("Onyx.app must be in /Applications.");
-}
-if (-e "${JSON_DIR}/onyx.json") {
- &dialog("Onyx appears to be already installed for this user.");
-}
+if [ ! -x "/Applications/Onyx.app/Contents/MacOS/onyx" ]; then
+ echo "Onyx.app must be in /Applications."
+ exit 255
+fi
+if [ -e "$JSON_DIR/onyx.json" ]; then
+ echo "Onyx appears to be already installed for this user."
+ exit 254
+fi
-system("/bin/mkdir", "-p", $JSON_DIR);
-if (open(K, ">", "${JSON_DIR}/onyx.json")) {
- print K <<'EOF';
+echo "Creating destination directory."
+/bin/mkdir -p "$JSON_DIR"
+if [ ! -d "$JSON_DIR" ]; then
+ echo "Unable to create Onyx connection file."
+ exit 253
+fi
+echo "Creating connector file."
+cat <"$JSON_DIR/onyx.json"
{
"name": "onyx",
"description": "OverbiteNX Gopher system component",
@@ -23,19 +39,11 @@ if (open(K, ">", "${JSON_DIR}/onyx.json")) {
"allowed_extensions": [ "overbitenx@floodgap.com" ]
}
EOF
- close(K);
- &dialog("Onyx was successfully installed for this user.");
-} else {
- &dialog("Onyx was unable to install: $!\n");
-}
-sub dialog {
- exec("/usr/bin/osascript", "-e", <<"EOF");
+if [ -e "$JSON_DIR/onyx.json" ]; then
+ echo "Onyx was successfully installed for this user."
+ exit 0
+fi
-tell application "SystemUIServer"
-activate
-display dialog "@_" buttons ("OK") default button "OK"
-end tell
-EOF
-
-}
+echo "Onyx was unable to install its connector to Firefox."
+exit 128