Commit 3199f641 authored by Vivien Kraus's avatar Vivien Kraus
Browse files

New safe make target

The "safe" target will build whatever is needed to ensure that no race
will occur.
parent 0b90078a
......@@ -2,21 +2,24 @@ image: debian:latest
stages:
- dist
- check
- manual
dist:
stage: dist
image: tarotbis/build:latest
script: "export $(dbus-launch) ; ./ci/dist.sh"
script: "./ci/dist.sh"
artifacts:
paths:
- dist
expire_in: 1 week
check:
stage: check
script: "./ci/check.sh"
pages:
stage: manual
image: tarotbis/doc:latest
script: "export $(dbus-launch) ; ./ci/pages.sh"
script: "./ci/pages.sh"
artifacts:
paths:
- public
......
......@@ -51,3 +51,17 @@ AM_CPPFLAGS += \
-Ilib -I$(srcdir)/lib \
-DLIBTAROT_VERSION_INFO="\"$(LIBTOOL_CURRENT):$(LIBTOOL_REVISION):$(LIBTOOL_AGE)\""
AM_YFLAGS = -d
AM_CFLAGS += \
$(NETTLE_CFLAGS) $(XML_CFLAGS)
AM_LDADD += \
$(NETTLE_LIBS) $(XML_LIBS)
if WITH_GOBJECT
AM_CFLAGS += $(GOBJECT_CFLAGS)
AM_LDADD += $(GOBJECT_LIBS)
endif # WITH_GOBJECT
.PHONY: safe
safe:
$(MAKE) $(AM_MAKEFLAGS) $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot
......@@ -22,8 +22,8 @@
touch AUTHORS || exit 1
touch README || exit 1
gnulib-tool --libtool \
--import assert git-version-gen getopt-gnu gitlog-to-changelog setenv xalloc readline \
setlocale || exit 1
--import assert git-version-gen getopt-gnu setenv readline stdalign xalloc setlocale \
gitlog-to-changelog git-version-gen || exit 1
./gitlog-to-changelog > ChangeLog
touch README || exit 1
autoreconf -vif || exit 1
......
......@@ -18,4 +18,5 @@
EXTRA_DIST += \
%reldir%/dist.sh \
%reldir%/pages.sh
%reldir%/pages.sh \
%reldir%/check.sh
#!/bin/sh
apt-get update
apt-get upgrade -y
apt-get install -y \
build-essential \
dbus \
dbus-x11 \
libglib2.0-dev \
libreadline-dev \
libxml2 \
libxml2-dev \
nettle-dev \
pkg-config \
valgrind
VERSION=$(cat dist/version)
cp dist/tarot-$VERSION.tar.gz . || exit 1
tar xf tarot-$VERSION.tar.gz || exit 1
mkdir build || exit 1
cd build/
../tarot-$VERSION/configure \
--enable-silent-rules=yes \
--enable-valgrind=yes \
--disable-program \
|| (cat config.log; exit 1)
make -j 16 check || exit 1
make distclean || exit 1
......@@ -4,6 +4,58 @@
#
# Remove VALAFLAGS="--target-glib=2.50"
apt-get update
apt-get upgrade -y
apt-get install -y \
appstream-util \
autoconf \
autoconf-archive \
autogen \
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 \
texinfo \
valac \
valgrind \
xsltproc
export $(dbus-launch)
SOURCE_TOP=$(pwd)
CLEAN_TOP=$(cd .. && pwd)/clean
mkdir -p ../clean
......@@ -27,7 +79,7 @@ sh autogen.sh VALAFLAGS="--target-glib=2.50" || exit 1
|| (cat config.log ; exit 1) \
|| exit 1
(cd lib && make -j 16 CFLAGS="-Wno-error -g $CFLAGS") || exit 1
make -j 16 src/tarot-app/tarot || exit 1
make -j 16 safe || exit 1
make -j 16 distcheck || exit 1
make -j 8 check || exit 1
make -j 16 install install-html || exit 1
......
#!/bin/sh
apt-get update
apt-get upgrade -y
apt-get install -y \
build-essential \
libglib2.0-dev \
libreadline-dev \
libxml2 \
libxml2-dev \
nettle-dev \
pkg-config \
texinfo \
valgrind
export $(dbus-launch)
VERSION=$(cat dist/version)
cp dist/tarot-$VERSION.tar.gz . || exit 1
......@@ -10,8 +25,7 @@ cd build/
--prefix="$PWD/../public" \
--enable-silent-rules=yes \
--enable-valgrind=yes \
--without-cairo \
--without-gtk \
--disable-program \
CFLAGS="-g -fprofile-arcs -ftest-coverage" \
|| (cat config.log; exit 1)
make -j 16 install-html || exit 1
......
......@@ -10,6 +10,13 @@ AC_ARG_ENABLE([runtime-prefix], AS_HELP_STRING([--enable-runtime-prefix=ENV],
[At runtime, prepend the value of the environment variable ENV to the installation prefix. This is useful to make the package relocatable. If ENV is empty or 'no', this is disabled.]))
AC_DEFINE_UNQUOTED([RUNTIME_PREFIX_ENV], "$enable_runtime_prefix", [Environment variable to look up the installation prefix])
AC_CONFIG_MACRO_DIRS([m4])
AC_SUBST([VERSION_MAJOR], m4_esyscmd([./get-version.sh package | cut -d '.' -f 1]))
AC_SUBST([VERSION_MINOR], m4_esyscmd([./get-version.sh package | cut -d '.' -f 2]))
AC_SUBST([VERSION_PATCH], m4_esyscmd([./get-version.sh package | cut -d '.' -f 3]))
AC_SUBST([VERSION_ADDITIONAL], m4_esyscmd([./get-version.sh package | tail -c +$(./get-version.sh package | cut -d '.' -f 1-3 | wc -c)]))
AC_SUBST([LIBTOOL_CURRENT], m4_esyscmd([./get-version.sh libtool | cut -d ':' -f 1]))
AC_SUBST([LIBTOOL_REVISION], m4_esyscmd([./get-version.sh libtool | cut -d ':' -f 2]))
AC_SUBST([LIBTOOL_AGE], m4_esyscmd([./get-version.sh libtool | cut -d ':' -f 3]))
# Checks for programs.
AC_PROG_CC
......@@ -41,6 +48,10 @@ AC_ARG_VAR([VALAFLAGS], [Additional flags to pass to the vala compiler])
AC_ARG_ENABLE([program], AS_HELP_STRING([--disable-program],
[Do not try to build the tarot program. Only the library will be built.]))
AM_CONDITIONAL([ENABLE_PROGRAM], [test "x$enable_program" != "xno"])
PKG_CHECK_VAR([GLIB_MKENUMS], [glib-2.0], [glib_mkenums])
AM_MISSING_PROG([VAPIGEN], [vapigen])
AM_MISSING_PROG([G_IR_SCANNER], [g-ir-scanner])
AM_MISSING_PROG([G_IR_COMPILER], [g-ir-compiler])
PKG_INSTALLDIR
AM_MISSING_PROG([FDP], [fdp])
AM_MISSING_PROG([HELP2MAN], [help2man])
......@@ -50,7 +61,6 @@ AM_MISSING_PROG([APPSTREAM_UTIL], [appstream-util])
# Checks for libraries.
gl_INIT
AS_IF([test "x$enable_program" != "xno"], [
PKG_CHECK_MODULES([LIBTAROT], [libtarot-gobject])
PKG_CHECK_MODULES([GOBJECT], [gobject-2.0],, [
AC_MSG_ERROR([GObject was not found.])
])
......@@ -62,10 +72,33 @@ AS_IF([test "x$enable_program" != "xno"], [
], [
AM_CONDITIONAL([WITH_GTK], [false])
])
], [
AM_CONDITIONAL([WITH_GTK], [false])
])
AX_LIB_NETTLE([yes])
PKG_CHECK_MODULES([XML], [libxml-2.0])
AC_ARG_WITH([gobject], AS_HELP_STRING([--without-gobject], [Do not build the GObject bindings]))
WITH_GOBJECT="no"
AS_IF([test "x$with_gobject" != "xno"], [
PKG_CHECK_MODULES([GOBJECT], [gobject-2.0], [
WITH_GOBJECT="yes"
], [
AC_MSG_ERROR([GObject was not found. Please use --without-gobject.])
])
])
AM_CONDITIONAL([WITH_GOBJECT], [test "x$WITH_GOBJECT" != "xno"])
AC_SEARCH_LIBS([atan2], [m])
AC_SEARCH_LIBS([sin], [m])
AC_SEARCH_LIBS([cos], [m])
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.19.8])
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$PACKAGE", [This needs to be defined in config.h manually...])
AC_ARG_WITH([static_program_name],
AS_HELP_STRING([--with-static-program-name=yes],
[Statically determine the program name to be "libtarot" for error reporting functionality.]))
AS_IF([test "x$with_static_program_name" != "xno"], [
CPPFLAGS="$CPPFLAGS -Dprogram_name=tarot_libtarot_program_name"
])
# Checks for header files.
AC_HEADER_STDBOOL
......@@ -83,6 +116,8 @@ AC_SEARCH_LIBS([add_history], [history])
AC_CONFIG_FILES([ po/Makefile.in
Makefile
lib/Makefile
src/libtarot/pkgconfig/libtarot.pc
src/libtarot/pkgconfig/libtarot-gobject.pc
])
AC_CONFIG_FILES([
pre-inst-env
......
......@@ -72,6 +72,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS =
AM_CPPFLAGS =
AM_CFLAGS =
AM_LIBS =
AM_LDADD =
AM_VALAFLAGS =
AM_MAKEINFOHTMLFLAGS =
TESTS =
......
......@@ -16,19 +16,9 @@
# along with this program. If not, see
# <http://www.gnu.org/licenses/>.
.PHONY: indent-org
indent: indent-org
indent-org: %reldir%/tarot.org
$(indent_verbose) (cd $(srcdir)/%reldir% \
&& (echo "/* *INDENT-OFF* */" ; cat tarot.org ; echo "/* *INDENT-ON* */") \
| $(INDENT) --no-tabs \
| tail -n +2 \
| head -n -1 \
> tarot-indented.org \
&& mv tarot-indented.org tarot.org)
include %reldir%/texinfo.am
include %reldir%/export-html.am
include %reldir%/export-docbook.am
include %reldir%/org-export-texinfo.am
include %reldir%/man.am
include %reldir%/examples.am
This diff is collapsed.
# doc/examples.am
#
# Copyright (C) 2019 Vivien Kraus <vivien@planete-kraus.eu>
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see
# <http://www.gnu.org/licenses/>.
check_PROGRAMS += \
%reldir%/basic-initialization \
%reldir%/players-and-cards \
%reldir%/events \
%reldir%/xml \
%reldir%/petit-sec
%canon_reldir%_basic_initialization_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
%canon_reldir%_players_and_cards_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
%canon_reldir%_events_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
%canon_reldir%_xml_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
%canon_reldir%_petit_sec_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
BUILT_SOURCES += \
%reldir%/players-and-cards.c \
%reldir%/events.c
%reldir%/players-and-cards.c: src/libtarot/cards/tarot/cards.h
%reldir%/events.c: src/libtarot/cards/tarot/cards.h
......@@ -18,8 +18,7 @@
dist_chelp_DATA += %reldir%/tarot.xml
tarotfigureschelpdir = $(chelpdir)/tarot-figures
dist_tarotfigureschelp_DATA = \
%reldir%/tarot-figures/example.png
dist_tarotfigureschelp_DATA = $(dist_tarotfigures_DATA)
MAINTAINERCLEANFILES += $(srcdir)/%reldir%/tarot.xml
$(srcdir)/%reldir%/tarot.xml: %reldir%/tarot.texi
......
......@@ -17,9 +17,7 @@
# <http://www.gnu.org/licenses/>.
tarotfigureshtmldir = $(htmldir)/tarot.html/tarot-figures
dist_tarotfigureshtml_DATA = \
%reldir%/tarot-figures/example.png \
%reldir%/tarot-figures/example-tree.png
dist_tarotfigureshtml_DATA = $(dist_tarotfigures_DATA)
AM_MAKEINFOHTMLFLAGS += --css-include $(srcdir)/%reldir%/style.css
......
......@@ -16,21 +16,42 @@
# along with this program. If not, see
# <http://www.gnu.org/licenses/>.
TANGLED =
TANGLED = \
$(srcdir)/%reldir%/basic-initialization.c \
$(srcdir)/%reldir%/players-and-cards.c \
$(srcdir)/%reldir%/events.c \
$(srcdir)/%reldir%/petit-sec.c \
$(srcdir)/%reldir%/xml.c \
$(srcdir)/%reldir%/tarot-tune \
$(srcdir)/tuneconfig.h \
$(srcdir)/%reldir%/tarot-figures/convergence-parameter.eps \
$(srcdir)/%reldir%/tarot-figures/convergence-parameter.png \
$(srcdir)/%reldir%/tarot-figures/convergence-agreed.eps \
$(srcdir)/%reldir%/tarot-figures/convergence-agreed.png \
$(srcdir)/%reldir%/tarot-figures/convergence-random.eps \
$(srcdir)/%reldir%/tarot-figures/convergence-random.png
dist_noinst_SCRIPTS += %reldir%/tarot-tune
EXTRA_DIST += \
$(srcdir)/%reldir%/tarot.texi \
%reldir%/tarot.org \
%reldir%/setup.el \
$(TANGLED) \
%reldir%/org-stamp
%reldir%/org-stamp \
%reldir%/convergence.csv
MAINTAINERCLEANFILES += \
$(srcdir)/%reldir%/tarot.texi \
$(TANGLED) \
%reldir%/org-stamp
$(srcdir)/%reldir%/org-stamp: %reldir%/tarot.org %reldir%/setup.el
.PHONY: tune
tune: %reldir%/tarot-tune
$(srcdir)/%reldir%/tarot-tune | tee $(srcdir)/%reldir%/convergence.csv
$(srcdir)/%reldir%/org-stamp: %reldir%/tarot.org %reldir%/setup.el %reldir%/convergence.csv
$(org_verbose) cd $(srcdir) && $(EMACS) --batch \
-l %reldir%/setup.el \
--eval "(defun package-version () \"$(VERSION)\")" \
......
(setq org-confirm-babel-evaluate nil)
(setq org-export-use-babel t)
(setq org-babel-load-languages '((emacs-lisp . t) (scheme . t) (shell . t)))
(setq org-babel-load-languages '((emacs-lisp . t) (scheme . t) (shell . t) (R . t)))
(setq geiser-default-implementation 'guile)
(setq org-html-htmlize-output-type 'css)
(setq ess-startup-directory "./")
(add-to-list 'load-path ".")
(require 'org)
(require 'ox-texinfo)
......
This diff is collapsed.
......@@ -18,7 +18,15 @@
info_TEXINFOS += %reldir%/tarot.texi
tarotfiguresdir = $(infodir)/tarot-figures
dist_tarotfigures_DATA =
dist_tarotfigures_DATA = \
%reldir%/tarot-figures/convergence-parameter.png \
%reldir%/tarot-figures/convergence-agreed.png \
%reldir%/tarot-figures/convergence-random.png \
%reldir%/tarot-figures/convergence-parameter.eps \
%reldir%/tarot-figures/convergence-agreed.eps \
%reldir%/tarot-figures/convergence-random.eps \
%reldir%/tarot-figures/example.png \
%reldir%/tarot-figures/example-tree.png
%canon_reldir%_tarot_TEXINFOS = \
%reldir%/fdl.texi
#!/bin/sh
PACKAGE_VERSION=$(./git-version-gen .tarball-version \
| sed 's|/[[:digit:]]\.[[:digit:]]\.[[:digit:]]||g')
LIBTOOL_VERSION=$(./git-version-gen .tarball-version \
| sed 's|.*/\([[:digit:]]\.[[:digit:]]\.[[:digit:]]\).*|\1|g' \
| sed 's/\./:/g')
case $1 in
package)
echo -n "$PACKAGE_VERSION";;
libtool)
echo -n "$LIBTOOL_VERSION";;
*)
echo -n "Usage: ./get-version.sh (package|libtool)" ; exit 1;;
esac
......@@ -12,4 +12,7 @@ src/tarot-app/gui/widget.ui
src/tarot-app/gui/card_view.vala
src/tarot-app/card_painter_default.vala
eu.planete_kraus.Tarot.appdata.xml.in
src/tarot-app/server.vala
\ No newline at end of file
src/tarot-app/server.vala
src/tarot-app/server.vala
src/libtarot/cards/tarot/cards_private_impl.h
src/libtarot/player/tarot/player_private_impl.h
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment