-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·69 lines (61 loc) · 2.53 KB
/
setup.sh
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
#! /bin/bash
set -ex
UNAME="$(uname)"
# TODO: use venv?
if [ "$UNAME" = Darwin ]; then
# detail
# https://pygobject.readthedocs.io/en/latest/getting_started.html#macosx-getting-started
# pkg-config is installed
# brew install pkg-config
# brew reinstall libffi
brew update
#brew upgrade
brew install pygobject3
brew install gtk+3 python3
python3 -m pip install --user .
python3 -m pip install --user pygobject
elif [ -f /etc/lsb-release ] || [ -f /etc/debian_version ]; then
# debian, ubuntu
sudo apt-get update
sudo apt-get install -y python3 python3-dev python3-pip libgtk-3-dev \
python3-setuptools xvfb pkg-config python3-gi-cairo
python3 -m pip install --user .
elif [ -f /etc/redhat-release ] && grep "release 7" /etc/redhat-release; then
# redhat, centos7
sudo yum install -y gcc gobject-introspection-devel cairo-devel \
pkg-config python3-devel gtk3 python3-pip pygobject3-devel cairo-gobject-devel
python3 -m pip install --user PyGObject pycairo
python3 -m pip install --user .
# install x11
# http://morrey22.hatenablog.com/entry/2013/04/14/212837
# sudo yum -y groups install "GNOME Desktop"
elif [ -f /etc/redhat-release ] && grep "release 8" /etc/redhat-release; then
# redhat, centos8, oracle linux 8.4
sudo yum install -y gcc cairo-devel \
pkg-config python3-devel gtk3 python3-pip cairo-gobject-devel
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install PyGObject pycairo
sudo python3 -m pip install .
# install x11
# http://morrey22.hatenablog.com/entry/2013/04/14/212837
# sudo yum -y groups install "GNOME Desktop"
elif [[ "$UNAME" == "MINGW64_NT"* ]]; then
# msys2 on PC
# no package were upgraded -> ignore
# workaround: https://github.com/msys2/MSYS2-packages/issues/2021
pacman -Syu --noconfirm || true
pacman -Sydd --noconfirm filesystem
pacman -Syu --noconfirm || true
pacman -Sy --noconfirm mingw-w64-x86_64-gtk3 mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-gobject
pacman -Sy --noconfirm mingw-w64-x86_64-python3-setuptools mingw-w64-x86_64-python3-pip
python3 -m pip install .
elif [[ "$UNAME" == "MSYS_NT"* ]]; then
# travis
$msys2 pacman -Syu --noconfirm
$msys2 pacman -Sy --noconfirm mingw-w64-x86_64-gtk3 mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-gobject
$msys2 pacman -Sy --noconfirm mingw-w64-x86_64-python3-setuptools mingw-w64-x86_64-python3-pip
python3 -m pip install .
else
echo unsupported os
exit 1
fi