Difference between revisions of "Development on Linux/en"

From GIMX
Jump to: navigation, search
(Updating to match new version of source page)
(Updating to match new version of source page)
 

(6 intermediate revisions by the same user not shown)

Line 4: Line 4:
 
==Install development packages==
 
==Install development packages==
  
    sudo apt-get install subversion g++ libwxgtk2.8-dev libbluetooth-dev libglib2.0-dev libxml2-dev libusb-dev libusb-1.0-0-dev libncursesw5-dev gettext xterm xdg-utils
+
On Ubuntu 14.04:<br />
patch and libxi-dev were also required before r1277.
+
<code>
 +
sudo apt-get install git g++ libwxgtk2.8-dev libbluetooth-dev libxml2-dev libusb-1.0-0-dev libncursesw5-dev gettext xterm xdg-utils libmhash-dev libcurl4-gnutls-dev libxi-dev libx11-dev</code>
  
On Fedora: yum -y install wxGTK-devel bluez-libs-devel glib2-devel libxml2-devel libXi-devel libusb-devel (to be completed)
+
On Ubuntu 16.04:<br />
 +
<code>
 +
sudo apt-get install git g++ libwxgtk3.0-dev libbluetooth-dev libxml2-dev libusb-1.0-0-dev libncursesw5-dev gettext xterm xdg-utils libmhash-dev libcurl4-gnutls-dev libxi-dev libx11-dev</code>
  
==Compile a patched SDL library (not required anymore since r1277)==
+
On Raspbian Jessie:<br />
 +
<code>
 +
sudo apt-get install git g++ libwxgtk2.8-dev libbluetooth-dev libxml2-dev libusb-1.0-0-dev libncursesw5-dev gettext xterm xdg-utils libmhash-dev libcurl4-gnutls-dev libxi-dev libx11-dev</code>
  
    wget http://www.libsdl.org/release/SDL-1.2.14.tar.gz
+
On Fedora:<br />
    tar xzvf SDL-1.2.14.tar.gz
+
<code>
    svn export http://diyps3controller.googlecode.com/svn/trunk/libsdl/patch
+
yum -y install wxGTK-devel bluez-libs-devel glib2-devel libxml2-devel libXi-devel libusb-devel (to be completed)</code>
    cd SDL-1.2.14
 
    patch -p1 < ../patch
 
    ./configure ; make
 
    cd ..
 
 
 
==Copy SDL headers and .so (not required anymore since r1277)==
 
 
 
    mkdir -p libsdl/lib
 
    mkdir -p libsdl/include/SDL
 
    cp SDL-1.2.14/build/.libs/libSDL.so libsdl/lib
 
    cp SDL-1.2.14/include/* libsdl/include/SDL
 
  
 
==Download GIMX sources==
 
==Download GIMX sources==
  
    svn checkout http://diyps3controller.googlecode.com/svn/trunk/GIMX
+
<code>
 +
git clone -b master --single-branch --depth 1 <nowiki>https://github.com/matlo/GIMX.git</nowiki></code>
  
 
==Compile==
 
==Compile==
  
    cd GIMX
+
<code>
    make -j 2
+
cd GIMX<br />
 +
make -j 2</code>
  
 
Replace "2" with your number of CPU cores.
 
Replace "2" with your number of CPU cores.
Line 39: Line 35:
 
==Install==
 
==Install==
  
    sudo make install
+
<code>
 +
sudo make install</code>
  
==Set Input Device Permissions (required since r1277)==
+
==Set the setuid==
 +
 
 +
A few gimx binaries need root priviledges.
 +
 
 +
<code>
 +
sudo chmod u+s /usr/bin/gimx /usr/bin/sixaddr /usr/bin/bdaddr /usr/bin/hcirevision</code>
 +
 
 +
==Set Input Device Permissions==
  
 
One way to give read permissions to GIMX is to create a special group, change /dev/input/event* group ownership to that group, and then make the gimx binaries setgid to that group.
 
One way to give read permissions to GIMX is to create a special group, change /dev/input/event* group ownership to that group, and then make the gimx binaries setgid to that group.
  
groupadd -f input
+
<code>
+
sudo su<br />
echo "KERNEL==\"event*\", NAME=\"input/%k\", MODE:=\"660\", GROUP=\"input\"" > /etc/udev/rules.d/99-gimx-input.rules
+
 
echo "KERNEL==\"js*\", NAME=\"input/%k\", MODE:=\"664\", GROUP=\"input\"" >> /etc/udev/rules.d/99-gimx-input.rules
+
groupadd -f input<br />
chgrp input /dev/input/event* /dev/input/js*
+
 
+
echo "KERNEL==\"event*\", NAME=\"input/%k\", MODE:=\"660\", GROUP=\"input\"" > /etc/udev/rules.d/99-gimx-input.rules<br />
chgrp input /usr/bin/gimx-config /usr/bin/gimx-fpsconfig /usr/bin/gimx-bluetooth /usr/bin/gimx-serial
+
echo "KERNEL==\"js*\", NAME=\"input/%k\", MODE:=\"664\", GROUP=\"input\"" >> /etc/udev/rules.d/99-gimx-input.rules<br />
chmod g+s /usr/bin/gimx-config /usr/bin/gimx-fpsconfig /usr/bin/gimx-bluetooth /usr/bin/gimx-serial
+
chgrp -f input /dev/input/event* /dev/input/js*<br />
 +
chmod -f g+rw /dev/input/event* /dev/input/js*<br />
 +
 
 +
chgrp input /usr/bin/gimx-config /usr/bin/gimx-fpsconfig /usr/bin/gimx-launcher<br />
 +
chmod g+s /usr/bin/gimx-config /usr/bin/gimx-fpsconfig /usr/bin/gimx-launcher<br />
 +
 
 +
exit</code>

Latest revision as of 17:49, 6 November 2016

Other languages:

This wiki explains how to compile GIMX from a Linux terminal.

Install development packages

On Ubuntu 14.04:
sudo apt-get install git g++ libwxgtk2.8-dev libbluetooth-dev libxml2-dev libusb-1.0-0-dev libncursesw5-dev gettext xterm xdg-utils libmhash-dev libcurl4-gnutls-dev libxi-dev libx11-dev

On Ubuntu 16.04:
sudo apt-get install git g++ libwxgtk3.0-dev libbluetooth-dev libxml2-dev libusb-1.0-0-dev libncursesw5-dev gettext xterm xdg-utils libmhash-dev libcurl4-gnutls-dev libxi-dev libx11-dev

On Raspbian Jessie:
sudo apt-get install git g++ libwxgtk2.8-dev libbluetooth-dev libxml2-dev libusb-1.0-0-dev libncursesw5-dev gettext xterm xdg-utils libmhash-dev libcurl4-gnutls-dev libxi-dev libx11-dev

On Fedora:
yum -y install wxGTK-devel bluez-libs-devel glib2-devel libxml2-devel libXi-devel libusb-devel (to be completed)

Download GIMX sources

git clone -b master --single-branch --depth 1 https://github.com/matlo/GIMX.git

Compile

cd GIMX
make -j 2

Replace "2" with your number of CPU cores.

Install

sudo make install

Set the setuid

A few gimx binaries need root priviledges.

sudo chmod u+s /usr/bin/gimx /usr/bin/sixaddr /usr/bin/bdaddr /usr/bin/hcirevision

Set Input Device Permissions

One way to give read permissions to GIMX is to create a special group, change /dev/input/event* group ownership to that group, and then make the gimx binaries setgid to that group.

sudo su

groupadd -f input

echo "KERNEL==\"event*\", NAME=\"input/%k\", MODE:=\"660\", GROUP=\"input\"" > /etc/udev/rules.d/99-gimx-input.rules
echo "KERNEL==\"js*\", NAME=\"input/%k\", MODE:=\"664\", GROUP=\"input\"" >> /etc/udev/rules.d/99-gimx-input.rules
chgrp -f input /dev/input/event* /dev/input/js*
chmod -f g+rw /dev/input/event* /dev/input/js*

chgrp input /usr/bin/gimx-config /usr/bin/gimx-fpsconfig /usr/bin/gimx-launcher
chmod g+s /usr/bin/gimx-config /usr/bin/gimx-fpsconfig /usr/bin/gimx-launcher

exit