Skip to content

Commit

Permalink
closes #7: Tim Cook sucks and Apple sucks and macOS sucks and Macs su…
Browse files Browse the repository at this point in the history
…ck and Catalina was a nice island until Apple decided to use the name for their latest piece of crap
  • Loading branch information
classilla committed Aug 27, 2019
1 parent a2d9d80 commit e1c4ee5
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 59 deletions.
50 changes: 29 additions & 21 deletions Info.plist
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>onyx-inst</string>
<key>CFBundleGetInfoString</key>
<string>OverbiteNX Onyx for macOS</string>
<key>CFBundleIdentifier</key>
<string>com.floodgap.onyx</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>onyx-inst</string>
<key>CFBundleIdentifier</key>
<string>com.floodgap.onyx</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Onyx</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.9.2.0</string>
<key>CFBundleVersion</key>
<string>902.0.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.9</string>
<key>CFBundleShortVersionString</key>
<string>0.9.2.1</string>
<key>CFBundleVersion</key>
<string>902.1.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.9</string>
<key>LSUIElement</key>
<false/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSHumanReadableCopyright</key>
<string>© 2019 Cameron Kaiser</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

43 changes: 33 additions & 10 deletions Makefile.macos
Original file line number Diff line number Diff line change
@@ -1,31 +1,54 @@
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

# This Makefile requires Makefile.generic to have already run, since it
# 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

onyx:
$(MAKE) -f Makefile.generic

clean:
$(RM) -rf mac Onyx.dmg
$(RM) -rf $(WHERE) Onyx.dmg
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`.

Expand Down
60 changes: 34 additions & 26 deletions mac-onyx-inst
Original file line number Diff line number Diff line change
@@ -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 <<EOF >"$JSON_DIR/onyx.json"
{
"name": "onyx",
"description": "OverbiteNX Gopher system component",
Expand All @@ -23,19 +39,11 @@ if (open(K, ">", "${JSON_DIR}/onyx.json")) {
"allowed_extensions": [ "[email protected]" ]
}
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

0 comments on commit e1c4ee5

Please sign in to comment.