From 448b70f271fd783b8cace3511288883d1a632072 Mon Sep 17 00:00:00 2001 From: Georgi Sabev Date: Sun, 18 Mar 2018 10:50:44 +0200 Subject: Add .gitignore file --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitignore 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/ + -- cgit v1.2.3 From 4f924fca750f90f75acfd5589ac601783c9f12af Mon Sep 17 00:00:00 2001 From: Georgi Sabev Date: Sun, 18 Mar 2018 11:00:12 +0200 Subject: Add helper scripts for Mac OSX --- scripts/osx_check.sh | 7 +++++++ scripts/osx_post_install.sh | 13 +++++++++++++ scripts/resources/Info.plist | 44 ++++++++++++++++++++++++++++++++++++++++++++ setup.py | 10 ++++++++++ 4 files changed, 74 insertions(+) create mode 100755 scripts/osx_check.sh create mode 100755 scripts/osx_post_install.sh create mode 100644 scripts/resources/Info.plist 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 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleGetInfoString + Ammoon AP-09 Nano Looper + CFBundleIdentifier + com.ammoon.looper + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Ammoon AP-09 Nano Looper + CFBundlePackageType + KEXT + CFBundleSignature + not-signed + CFBundleVersion + 1.0.0 + IOKitPersonalities + + Device Driver + + CFBundleIdentifier + com.apple.iokit.IOUSBMassStorageDriver + IOClass + IOService + IOProviderClass + IOUSBInterface + idProduct + 22314 + idVendor + 1155 + bConfigurationValue + 1 + bInterfaceNumber + 0 + + + OSBundleRequired + Local-Root + + 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'") -- cgit v1.2.3