aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReiner Herrmann <reiner@reiner-h.de>2019-07-31 20:49:52 +0000
committerGitHub <noreply@github.com>2019-07-31 20:49:52 +0000
commitaa5a8bd0ecc50f9f9d05abac6654c8c28074c1e2 (patch)
treed248651290b03e5d618adeab991b7856888aad74
parent4092a230b6c56e63e4a5b2a9181dde91f54ae5aa (diff)
parent4f924fca750f90f75acfd5589ac601783c9f12af (diff)
Merge pull request #2 from georgethebeatle/macosx-supportHEADtrunk
Mac OSX support
-rw-r--r--.gitignore4
-rwxr-xr-xscripts/osx_check.sh7
-rwxr-xr-xscripts/osx_post_install.sh13
-rw-r--r--scripts/resources/Info.plist44
-rw-r--r--setup.py10
5 files changed, 78 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e69c1e8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+build/
+dist/
+loopertrx.egg-info/
+
diff --git a/scripts/osx_check.sh b/scripts/osx_check.sh
new file mode 100755
index 0000000..09f5d92
--- /dev/null
+++ b/scripts/osx_check.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+signed_kext_status=$(csrutil status)
+if [[ $signed_kext_status = *"enabled"* ]]; then
+ echo "**MAC OSX ERROR** Unsigned kernex extentions not allowed! To allow them restart in recovery OS by restarting and holding Cmd+R, open a shell and run 'csrutil disable'"
+ exit 1
+fi
diff --git a/scripts/osx_post_install.sh b/scripts/osx_post_install.sh
new file mode 100755
index 0000000..bd62e85
--- /dev/null
+++ b/scripts/osx_post_install.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+KEXT_PATH="/System/Library/Extensions/AmmoonLooperUsb.kext/Contents/"
+
+${SCRIPT_DIR}/osx_check.sh
+
+mkdir -p "${KEXT_PATH}"
+cp "${SCRIPT_DIR}"/resources/Info.plist "${KEXT_PATH}"
+
+kextload /System/Library/Extensions/AmmoonLooperUsb.kext
+touch /System/Library/Extensions
+
diff --git a/scripts/resources/Info.plist b/scripts/resources/Info.plist
new file mode 100644
index 0000000..4443673
--- /dev/null
+++ b/scripts/resources/Info.plist
@@ -0,0 +1,44 @@
+<?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>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Ammoon AP-09 Nano Looper</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.ammoon.looper</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>Ammoon AP-09 Nano Looper</string>
+ <key>CFBundlePackageType</key>
+ <string>KEXT</string>
+ <key>CFBundleSignature</key>
+ <string>not-signed</string>
+ <key>CFBundleVersion</key>
+ <string>1.0.0</string>
+ <key>IOKitPersonalities</key>
+ <dict>
+ <key>Device Driver</key>
+ <dict>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.iokit.IOUSBMassStorageDriver</string>
+ <key>IOClass</key>
+ <string>IOService</string>
+ <key>IOProviderClass</key>
+ <string>IOUSBInterface</string>
+ <key>idProduct</key>
+ <integer>22314</integer>
+ <key>idVendor</key>
+ <integer>1155</integer>
+ <key>bConfigurationValue</key>
+ <integer>1</integer>
+ <key>bInterfaceNumber</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <key>OSBundleRequired</key>
+ <string>Local-Root</string>
+</dict>
+</plist>
diff --git a/setup.py b/setup.py
index 95ae7f4..36c5628 100644
--- a/setup.py
+++ b/setup.py
@@ -1,3 +1,4 @@
+import os, subprocess
from setuptools import setup, find_packages
setup(
@@ -11,3 +12,12 @@ setup(
author_email="reiner@reiner-h.de",
license="GPLv2+",
)
+
+if(os.uname().sysname == "Darwin"):
+ project_dir = os.path.dirname(os.path.realpath(__file__))
+ mac_setup_script = os.path.join(project_dir, "scripts", "osx_check.sh")
+ subprocess.check_call(mac_setup_script)
+ print("################################################")
+ print("OSX Installation Notice")
+ print("################################################")
+ print("In order to fully complete the installation, run 'sudo scripts/osx_post_install.sh'")