-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from watbulb/casked-version
Casked version (0.1b)
- Loading branch information
Showing
12 changed files
with
185 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,7 @@ | |
.DS_Store | ||
|
||
## Output files | ||
*.tar.gz | ||
*.o | ||
*.pkg | ||
|
||
## IDE/Workspace/Editor files | ||
*.swp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
The MIT License (MIT) | ||
Copyright © 2019 Dayton Pidhirney (watbulb) <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
77c03c5f1a3720e009ffb9dfe0884c954efbe46905742ddd8d6286fafbefa80f:0.1a-rc2 | ||
37c8d10fec7943a993b388843dbd1a132976bf5cc6d92a5d8df70822222e2184:0.1b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,37 @@ | ||
class Ansiterm2 < Formula | ||
desc " | ||
ANSiTerm2 is a set of configurations, triggers and patches | ||
that turn iTerm2 into a fully fledged modern BBS client, modem support included! | ||
The last hope for a working and maintainable modern BBS client for macOS. | ||
Author: Dayton Pidhirney (watbulb) | ||
" | ||
homepage "https://www.phenomprod.com/" | ||
version "0.1a-rc2" | ||
url "https://github.com/watbulb/ANSiTerm2/releases/download/0.1a-rc2/ansiterm2.tar.gz" | ||
sha256 "77c03c5f1a3720e009ffb9dfe0884c954efbe46905742ddd8d6286fafbefa80f" | ||
bottle :unneeded | ||
|
||
# lrzsz is required for zmodem transfers | ||
depends_on "lrzsz" | ||
|
||
# telnet is required for connecting to remote terminals | ||
depends_on "telnet" | ||
|
||
def install | ||
# @XXX: rather poor way to check for Cask dependency | ||
# since brew doesn't support formulas which depend | ||
# on Casks, sadly... | ||
system "/usr/local/bin/brew", "cask", "install", "iterm2" | ||
|
||
# install Amiga fonts: | ||
# @XXX: a Cask is required to write to ~/Library/Fonts | ||
# so for now we just prompt the user to install topaz | ||
# if it doesn't yet exist | ||
username = ENV["USER"] | ||
fontprompt = false | ||
if not(File.exist?("/Users/#{username}/Library/Fonts/TopazPlus_a1200_v1.0.ttf")) | ||
system "open", "font/TopazPlus_a1200_v1.0.ttf" | ||
fontprompt = true | ||
end | ||
|
||
# replace the dynamic_profile username in the ANSiTerm2 profile | ||
profile = "profile/sh.potato.ansiterm2.plist" | ||
IO.write(profile, File.open(profile) do |f| | ||
f.read.gsub("replacement_user", username) | ||
end) | ||
|
||
# install ANSiTerm2 to formula share | ||
share.mkpath | ||
share.install "docs" | ||
share.install "font" | ||
share.install "trigger" | ||
share.install "profile" | ||
|
||
# prompt for font installation and iTerm2 configuration documentation | ||
if(fontprompt) | ||
puts | ||
puts "A FontBook window should have appeared!" | ||
puts "Please install the required Amiga font onto your system!" | ||
puts '(simply click "Install Font" within the FontBook window)' | ||
end | ||
|
||
puts | ||
puts "Please run the following command to 'activate' or 'update' ANSiTerm2:" | ||
puts "cp #{share}/profile/* ~/Library/Application\\ Support/iTerm2/DynamicProfiles/" | ||
puts | ||
puts "ANSiTerm2 can be activated once iTerm2 is opened by pressing CTRL+CMD+0" | ||
puts | ||
cask 'ansiterm2' do | ||
version '0.1b' | ||
sha256 'deede8f364fa94119ee6bbd2953198bac90e3153c402e39a446f23baf620c425' | ||
|
||
url "https://github.com/watbulb/ANSiTerm2/releases/download/#{version}/ansiterm2.pkg" | ||
appcast 'https://github.com/watbulb/ANSiTerm2/releases.atom' | ||
name 'ANSiTerm2' | ||
homepage 'https://github.com/watbulb/ANSiTerm2' | ||
|
||
# mavericks or above is required for iTerm2 | ||
depends_on macos: '>= :mavericks' | ||
|
||
# ANSiTerm2 depends on the following for client modem functionality | ||
depends_on formula: 'telnet' | ||
depends_on formula: 'lrzsz' | ||
|
||
# Some users install iTerm2 from it's website, so it won't show in installed Casks | ||
if not(Dir.exist?("/Applications/iTerm.app")) | ||
depends_on cask: 'iterm2' | ||
end | ||
end | ||
|
||
# install secure signed (Apple Developer) package installer | ||
# note: this doesn't even need root, which makes it even more secure :) | ||
installer script: { | ||
executable: '/usr/sbin/installer', | ||
args: ['-pkg', 'ansiterm2.pkg', '-target', 'CurrentUserHomeDirectory'] | ||
} | ||
|
||
# remove pacakge by product-ids | ||
# note: unfortunately since brew doesn't support uninstalling HOME based | ||
# packages, we have to rely on removing them manually, this is why brew is shit. | ||
uninstall delete: [ | ||
'~/Library/Application Support/iTerm2/DynamicProfiles/sh.potato.ansiterm2.plist', | ||
'~/.config/ansiterm2' | ||
] | ||
|
||
# vim: ts=4 sw=4 et | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<installer-gui-script minSpecVersion="1"> | ||
<pkg-ref id="sh.potato.ansiterm2.pkg"> | ||
<bundle-version/> | ||
</pkg-ref> | ||
<options customize="never" require-scripts="false"/> | ||
<domains enable_localSystem="false" enable_anywhere="false" enable_currentUserHome="true"/> | ||
<choices-outline> | ||
<line choice="default"> | ||
<line choice="sh.potato.ansiterm2.pkg"/> | ||
</line> | ||
</choices-outline> | ||
<choice id="default"/> | ||
<choice id="sh.potato.ansiterm2.pkg" visible="true"> | ||
<pkg-ref id="sh.potato.ansiterm2.pkg"/> | ||
</choice> | ||
<pkg-ref id="sh.potato.ansiterm2.pkg" auth="none" version="0.1b" onConclusion="none" installKBytes="381">#stage1_ansiterm2.pkg</pkg-ref> | ||
<title>ANSiTerm2</title> | ||
</installer-gui-script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>home</key> | ||
<true/> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
# implode on error | ||
set -e | ||
|
||
# symlink the dynamic profile to the user config folder | ||
rm ~/Library/Application\ Support/iTerm2/DynamicProfiles/sh.potato.ansiterm2.plist | ||
ln -s ~/.config/ansiterm2/profile/sh.potato.ansiterm2.plist ~/Library/Application\ Support/iTerm2/DynamicProfiles/sh.potato.ansiterm2.plist | ||
|
||
# replace the dummy usernames in the profile with the real one | ||
sed -i '' -e "s/replacement_user/${USER}/g" ~/.config/ansiterm2/profile/sh.potato.ansiterm2.plist | ||
|
||
exit 0 # all went well :) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters