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
	valac \
	valgrind \
57
	wget \
Vivien Kraus's avatar
Vivien Kraus committed
58
59
60
61
	xsltproc

export $(dbus-launch)

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

if test "x$CI_COMMIT_TAG" != "x"
then
    cd $SOURCE_TOP
    TARFILE=$(ls dist/tarot-*.tar.gz)
90
    mkdir /root/.ssh || exit 1
Vivien Kraus's avatar
Vivien Kraus committed
91
92
    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
93
94
    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
95
96
    git config --global user.email "vivien@planete-kraus.eu" || exit 1
    git config --global user.name "Gitlab CI for the tarot package" || exit 1
97
98
99
    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
100
fi