dist.sh 2.23 KB
Newer Older
Vivien Kraus's avatar
Vivien Kraus committed
1
2
#!/bin/sh

Vivien Kraus's avatar
Vivien Kraus committed
3
4
5
6
# HACKS!!!!
#
# Remove VALAFLAGS="--target-glib=2.50"

Vivien Kraus's avatar
Vivien Kraus committed
7
8
9
apt-get update
apt-get upgrade -y
apt-get install -y \
10
	appstream \
Vivien Kraus's avatar
Vivien Kraus committed
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
	autoconf \
	autoconf-archive \
	automake \
	autopoint \
	bison \
	build-essential \
	check \
	curl \
	dbus \
	dbus-x11 \
	devscripts \
	emacs \
	emacs-goodies-el \
	flex \
	gcc \
	gettext \
	git \
	gnulib \
	gobject-introspection \
	gperf \
	graphviz \
	help2man \
	imagemagick \
	indent \
	jekyll \
	jq \
	libcairo2-dev \
	libgirepository1.0-dev \
	libglib2.0-dev \
	libgtk-3-dev \
	libreadline-dev \
	libtool \
	libxml2 \
	libxml2-dev \
	libxml2-utils \
	make \
	nettle-dev \
	org-mode \
	pkg-config \
	r-cran-ggplot2 \
Vivien Kraus's avatar
Vivien Kraus committed
51
	r-cran-glmnet \
Vivien Kraus's avatar
Vivien Kraus committed
52
	r-cran-optparse \
Vivien Kraus's avatar
Vivien Kraus committed
53
	texinfo \
54
	texlive-full \
Vivien Kraus's avatar
Vivien Kraus committed
55
56
57
58
59
60
	valac \
	valgrind \
	xsltproc

export $(dbus-launch)

61
SOURCE_TOP=$(pwd)
Vivien Kraus's avatar
Vivien Kraus committed
62
rm -rf $SOURCE_TOP/dist || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
63
rm -rf ../tarot-*.tar.gz ../tarot-*/ tarot-*.tar.gz
64
sh autogen.sh VALAFLAGS="--target-glib=2.50" || exit 1
65
./configure \
66
    CFLAGS="-Wall -Wextra -g $CFLAGS" \
Vivien Kraus's avatar
Vivien Kraus committed
67
    VALAFLAGS="--target-glib=2.50" \
Vivien Kraus's avatar
Vivien Kraus committed
68
    --prefix="$SOURCE_TOP/dist" \
Vivien Kraus's avatar
Vivien Kraus committed
69
    --enable-valgrind=yes \
Vivien Kraus's avatar
Vivien Kraus committed
70
    --enable-silent-rules=yes \
71
72
    || (cat config.log ; exit 1) \
    || exit 1
73
74
75
76
77
(cd lib && make -j 16) || exit 1
make -j 16 CFLAGS="$CFLAGS -Werror" safe || exit 1
make -j 16 CFLAGS="$CFLAGS -Werror" distcheck || exit 1
make -j 8 CFLAGS="$CFLAGS -Werror" check || exit 1
make -j 16 CFLAGS="$CFLAGS -Werror" install install-html || exit 1
78
make -j 8 git-check || exit 1
79
cd $SOURCE_TOP || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
80
mkdir -p $SOURCE_TOP/dist || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
81
cp $SOURCE_TOP/.version \
Vivien Kraus's avatar
Vivien Kraus committed
82
83
   $SOURCE_TOP/dist/version || exit 1
cp tarot-*.tar.gz $SOURCE_TOP/dist/ || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
84
85
86
87
88

if test "x$CI_COMMIT_TAG" != "x"
then
    cd $SOURCE_TOP
    TARFILE=$(ls dist/tarot-*.tar.gz)
89
    mkdir /root/.ssh || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
90
91
    echo "$SSH_KEY" > /root/.ssh/id_rsa || exit 1
    echo "$SSH_KEY_PUB" > /root/.ssh/id_rsa.pub || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
92
93
    echo "$SSH_KNOWN_HOSTS" > /root/.ssh/known_hosts || exit 1
    chmod go-rwx /root/.ssh/id_rsa || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
94
95
    git config --global user.email "vivien@planete-kraus.eu" || exit 1
    git config --global user.name "Gitlab CI for the tarot package" || exit 1
96
97
98
    wget -O /tmp/submit https://play-tarot.frama.io/tarot-releases/submit || exit 1
    chmod ugo+x /tmp/submit || exit 1
    /tmp/submit $TARFILE || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
99
fi