forked from xrobau/clewarecontrol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
71 lines (63 loc) · 2.4 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
machine:
timezone:
Europe/Vienna
environment:
_SDK_: /usr/local/android-sdk-linux/
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig
dependencies:
override:
- echo dummy
pre:
- sudo apt-get update > /dev/null 2> /dev/null
- sudo apt-get install telnet > /dev/null 2> /dev/null
- sudo apt-get install x11-utils > /dev/null 2> /dev/null
- sudo apt-get install xvkbd > /dev/null 2> /dev/null
- sudo apt-get install swig
- sudo apt-get install libusb-dev
- sudo apt-get install python-dev ; exit 0
# install libhidapi ----------------
- cp /etc/apt/sources.list /tmp/aa
- echo 'deb http://cz.archive.ubuntu.com/ubuntu trusty main universe' >> /tmp/aa
- cat /tmp/aa; ls -al /etc/apt/sources.list /tmp/aa
- sudo cp -v /tmp/aa /etc/apt/sources.list
- sudo apt-get update
- sudo apt-get install libhidapi-dev
- dpkg-query -L libhidapi-dev
- sudo cp -av /usr/lib/x86_64-linux-gnu/pkgconfig/hidapi-libusb.pc /usr/lib/x86_64-linux-gnu/pkgconfig/hidapi.pc
- pkg-config --cflags hidapi ; exit 0
- pkg-config --libs hidapi ; exit 0
# install libhidapi ----------------
# --- binary ---
- make
- sudo make install
- cp -av clewarecontrol $CIRCLE_ARTIFACTS/clewarecontrol_$CIRCLE_SHA1 || exit 1
# --- binary ---
# --- perl extension ---
- sed -i -e 's#.o -o cle#.o -lhidapi-libusb -o cle#' Makefile # add hidapi-libusb to perl compile command!!
- sudo -- sh -c "make cleware_perl"
- mkdir $CIRCLE_ARTIFACTS/perl
- cp -av cleware.so $CIRCLE_ARTIFACTS/perl/ || exit 1
- ldd cleware.so
- cp -av cleware.pm $CIRCLE_ARTIFACTS/perl/ || exit 1
# --- perl extension ---
# --- python extension ---
- cp setup.py_CI setup.py # use setup file with added libs
- sudo make clean
- sudo -- sh -c "make cleware_python"
- find . -type f -name '_cleware.so' -exec cp -av {} ./ \;
- mkdir $CIRCLE_ARTIFACTS/python
- cp -av cleware.py $CIRCLE_ARTIFACTS/python/ || exit 1
- cp -av _cleware.so $CIRCLE_ARTIFACTS/python/ || exit 1
- ldd _cleware.so
# --- python extension ---
- make # make binary again
- ls -al
test:
pre:
- echo 'mtools_skip_check=1' > ~/.mtoolsrc
override:
- ./clewarecontrol -l # test binary
- printf 'import cleware \n' | python # test python extension
- ./example.py
- printf 'use Module::Load; \n load cleware; \n '|perl -w # test perl module
- ./example.pl