Step 1: (Alternate) Manual Installation for OSX/Linux
There is no one-click installer for OSX at this time. These steps have been tested to work on OSX 10.10; if you’re on Linux, I’m sure you can figure out how to adjust these steps accordingly.
- Head into System Preferences->Security & Privacy->Unlock and select: ‘Allow apps from: Anywhere’; When you’re done with this process you can set that back to its previous setting. Similarly, you need to disable “System Integrity Protection” in order to get past the
unsafe use of relative path libftdi1.2.dynlib in /Library/Python/2.7/site-packages/pinproc.so with restricted binary
–Instructions to disable System Integrity Protection (which isn’t necessarily a great thing to do: apple SIP instructions except you are doing to use thedisable
argument instead ofenable
. - Install XCode from the Mac App Store (note: you need to launch it once after installing it, in order to complete the installation–it can then be closed)
- Download libusb-1.0.20 Create a new folder in your user folder called
proc
and unzip this into that new folder. FYI:~
is short for the current user’s home folder, we we call this target folder “~/proc” from here on out.
Open a terminal window and change to the ~/proc/libusb-1.0.20
folder and run:
./configure
sudo make
sudo make install
(Note: on Linux, the preceding requires libudev, which is available for ubuntu in the apt packages libudev1
and libudev-dev
)
- Download libusb-compat Unzip to /proc and change to that folder (`~/proc/libusb-compat-0.1.5/`)
./configure LIBUSB_1_0_CFLAGS=-I/usr/local/include/libusb-1.0 LIBUSB_1_0_LIBS="-L/usr/local/lib -lusb-1.0"
make
sudo make install
-
download cmake 2.8.12.2 universal dmg install the cmake package by double clicking the pkg file Choose the default
/usr/bin
location and choose to install the command line tools (On ubuntu 16.04sudo apt-get install cmake
appears to install a usable cmake for our purposes)On OSX, newer installs of CMake include instructions to install the command line tools. This is done from terminal as:sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install
-
Download libftdi1-1.1
unzip into ~/proc folder change to the newly created libftdi folder with cd
mkdir bin
cd bin
cmake ..
sudo make install
- download yaml-cpp 0.2.6 unzip and copy to ~/proc change to that newly created yaml-cpp folder with
cd
mkdir bin
cd bin
cmake ..
sudo make install
- download libpinproc via git clone, as described below (linux users can use `sudo apt-get install git`; OSX users can navigate to the github url and download the ZIP.
cd ~/proc
mkdir libpinproc
git clone -b dev https://github.com/preble/libpinproc libpinproc
cd libpinproc
mkdir bin
cd bin
cmake -DBUILD_SHARED_LIBS=ON ..
(take note that the cmake line ends with ..
)
Change the include lines in the file proc/libpinproc/CMakeLists.txt
to the following:
include_directories(${PINPROC_SOURCE_DIR}/include ${EXTRA_INC} /usr/local/include ${FTDI_INC} /usr/local/include/libftdi1 /usr/local/include/libusb-1.0)
Add the following line with the others below it: set(lib_ftdi_usb usb-1.0 ftdi1)
I also comment out the build of pinproctest
. It’s finicky to build and not strictly necessary. This changes lines in that file to reflect the following: #add_executable(pinproctest # examples/pinproctest/pinproctest.cpp # examples/pinproctest/drivers.cpp # examples/pinproctest/dmd.cpp # examples/pinproctest/switches.cpp # examples/pinproctest/alphanumeric.cpp #) target_link_libraries(#pinproctest
Save the file
make
sudo make install
- download pypinproc (dev branch) via git clone, as described below:
(Linux note: Ubuntu 16.04 has Python 2.7 installed by default; I needed to apt-get install python-dev
in order for the following to work)
cd ~/proc
mkdir pypinproc
git clone -b dev https://github.com/preble/pypinproc pypinproc
cd pypinproc
python setup.py build
sudo python setup.py install
- download pyYAML 3.12 unzip and copy that folder to ~/proc change to that new pyYaml folder (
cd ~/proc/PyYAML-3.12
)
sudo python setup.py install
- Download pygame. Pick the “Lion apple supplied python” pygame-1.9.2pre-py2.7-macosx10.7.mpkg.zip Install the package(Linux: `sudo apt-get install python-pygame`)
- Download & install xquartz for mac (Linux users:skip)
- Install Python Pillow or Python Imaging Library (PIL):
13. For OSX (Pillow):
sudo pip install Pillow
13. For Linux (PIL 1.1.7 or Pillow, instructions are for PIP):
Download PIL 1.1.7:(PIL) 1.1.7 source kit unzip and copy to ~/proc take a note of the folder name so you can cd to it
sudo apt-get install python-dev libjpeg-dev libfreetype6-dev zlib1g-dev
sudo ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/
sudo ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib/
sudo ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib/
cd ~/proc/Imaging-1.1.7
sudo python setup.py install
- PyProcGameHD-SkeletonGame (dev branch, for the latest)
cd ~/proc
mkdir skeletongame
git clone https://github.com/mjocean/PyProcGameHD-SkeletonGame -b dev skeletongame
cd skeletongame
sudo python setup.py develop
This will install PyProcGame and SkeletonGame in ‘develop’ mode, such that when you import pyprocgame from any python script, it will use these files, from the current location (~/proc/skeletongame
).
Install the PyProcGame_HD_ SDL2 dependencies.
- Download and install SDL + PySDL2 0.9**.5** for your platform:
- PySDL2 0.9.5
cd ~proc/PySDL2-0.9.5/ sudo python setup.py install
- PyOSC PyOSC 0.3.5b
- Install the appropriate versions of the SDL2 and the SDL2_TTF libraries:
- sdl2
- sdl2_ttf
- for many linux distros, SDL2 is installed via: `sudo apt-get install libsdl2-2.0-0 libsdl2-image-2.0-0 libsdl2-ttf-2.0-0`
- Either set the PYSDL2_DLL_PATH (as per the instructions, here or add a
PYSDL2_DLL_PATH
in the game’sconfig.yaml
. - Optional: For MP4 support install OpenCV and libffmpeg linux:https://github.com/BVLC/caffe/wiki/OpenCV-3.1-Installation-Guide-on-Ubuntu-16.04
- PySDL2 0.9.5
to test, in python run:
import pinproc
import procgame
import pygame
print pinproc.EventTypeBurstSwitchOpen
The first three lines should return the prompt with no feedback. The last should print 6
. This is how you know it worked.
import procgame.game
import procgame.game.skeletongame
This also updates the “procgame” command line tool, and the updated version works with the color file formats. From the command line running
procgame
Will show a list of available arguments/commands. For example, procgame dmdimage <file.dmd> <file.png>
will convert a standard .dmd
file into a single or series of png files.
Last but not least, if you want to use the GUI switch tester tool, you can get it from GitHub, here: OscSwitchMatrixGUI, which will require wxPython to be installed. –note, if you are in my class, I have posted a zip which includes the playfield image and the tool to Canvas, but you need to install wxPython before you can run it.
Many thanks to Brian Madden for his original work to record the PyProcGame install steps on OSX from his guide, here.