-
Notifications
You must be signed in to change notification settings - Fork 9
Compilation
Compilation should be working on Linux, Windows with MinGW and Mac OS X. You will need header files of Puredata, as well as libcurl, json-c, and liboauth.
The package uses the Pd library template.
You need build-essentials, header files for puredata, libjson0, libcurl4, liboauth. If you have Debian or a derivative (e.g. Ubuntu, Linux Mint), you can install the build utils and needed headers with apt-get install build-essentials puredata-dev libjson0-dev libcurl4-openssl-dev liboauth-dev. If you are not root, prefix the command with sudo.
Drop the sources in a directory and run make. You will get files with a suffix of pd_linux for each object (json-decode.pd_linux, json-encode.pd_linux, rest-json.pd_linux) and a shared file libpurest_json.so. These are needed to use the library.
Install the package devscript with apt-get install devscript.
Remove the file embed-MacOSX-dependencies.sh.
Run make dpkg-deb, you will get a deb file in the parent folder. Install this file with dpkg -i pd-purest-json_0.7.1_i386.deb (or whatever your file is called).
You need to install MinGW on your computer. Follow the instructions on http://puredata.info/docs/developer/WindowsMinGW leaving out Cygwin. If you do not plan to compile Pd-extended, you may stop after following the instructions for "MinGW extras".
Install the additional packages:
-
pthreads-w32, from the MinGW shell via
mingw-get install pthreads-w32. -
libcurl, from http://curl.haxx.se/download.html#Win32 Choose Win32 generic, libcurl
-
json-c, from http://blog.stranadurakov.com/projects/mingw-libraries/ or use the latest json-c version from github (see above) and build it yourself.
-
(TODO: how-to use liboauth)
Extract the latter zip files and put the contents in the correct MinGW folders.
If you encounter an error with two definition of boolean, delete the line typedef int boolean; from the file %MinGW%/include/json/json_object.h.
Navigate to the folder of purest_json in MinGW Shell and run make. You will get four dll files (json-decode.dll, json-encode.dll, rest-json.dll, libpurest_json.dll).
To use the library, you will also need the dll from the libcurl download, and rename libcurl.dll to libcurl-4.dll. This will not run on current releases (Pd-extended 0.42 or Pd vanilla 0.43), only on Pd-extended 0.43 auto-builds.
I do not have a Mac available, but you will need to install json-c and libcurl4-ssl (TODO: development versions of these packages as well? Have not found liboauth.) via Fink.
You will need to set up part of the Pd build environment on your computer
Run make in the purest_json folder.
If the build succeeded, run ./embed-MacOSX-dependencies.sh to embed the dependencies in the shared library.
Working on it.