From 0ea5f7650a8b0b3311fa755151dfcde8137aa2af Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Tue, 3 Oct 2017 08:58:59 +0200 Subject: [PATCH 1/3] build: drop autotools Signed-off-by: Maciek Borzecki --- .travis.yml | 2 +- Makefile.am | 157 --------------------------------------------- configure.ac | 60 ----------------- extra/install-tree | 13 ++++ extra/travis-build | 91 +++++++++++++------------- 5 files changed, 61 insertions(+), 262 deletions(-) delete mode 100644 Makefile.am delete mode 100644 configure.ac create mode 100644 extra/install-tree diff --git a/.travis.yml b/.travis.yml index 64d3a41..d8a8ba3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ env: - DISTRO=fedora - DISTRO=archlinux - DISTRO=opensuse - - DISTRO=ubuntu + - DISTRO=ubuntu-xenial script: - ./extra/travis-build "${DISTRO}" diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index a66e4c8..0000000 --- a/Makefile.am +++ /dev/null @@ -1,157 +0,0 @@ -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. -# -# 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, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# AUTHORS -# Maciek Borzecki -# - -# location of *.desktop file, usually /usr/share/applications -applicationsdir = $(datadir)/applications - -applications_DATA = \ - mconnect.desktop - -mconnectdatadir = $(datadir)/mconnect - -mconnectdata_DATA = \ - mconnect.conf - -bin_PROGRAMS = \ - mconnect \ - mconnectctl - -noinst_PROGRAMS = \ - test-mconn-crypt - -noinst_LTLIBRARIES = - -VALAFLAGS = \ - --no-color \ - -g \ - --vapidir=vapi \ - --pkg=gio-2.0 \ - --pkg=gio-unix-2.0 \ - --pkg=json-glib-1.0 \ - --pkg=gee-0.8 \ - --pkg=libnotify \ - --pkg=posix \ - --pkg=gdk-3.0 \ - --pkg=atspi-2 \ - --pkg=gnutls \ - --vapidir=src/crypt - -TESTS = \ - test-mconn-crypt - -#------------------------------------------------------------- - -mconnect_SOURCES = \ - src/mconnect/main.vala \ - src/mconnect/discovery.vala \ - src/mconnect/packet.vala \ - src/mconnect/device.vala \ - src/mconnect/discovereddevice.vala \ - src/mconnect/device-proxy.vala \ - src/mconnect/devicemanager.vala \ - src/mconnect/devicemanager-proxy.vala \ - src/mconnect/devicechannel.vala \ - src/mconnect/core.vala \ - src/mconnect/packethandlerinterface.vala \ - src/mconnect/packethandlerinterface-proxy.vala \ - src/mconnect/packethandlers.vala \ - src/mconnect/packethandlers-proxy.vala \ - src/mconnect/notification.vala \ - src/mconnect/battery.vala \ - src/mconnect/battery-proxy.vala \ - src/mconnect/telephony.vala \ - src/mconnect/mousepad.vala \ - src/mconnect/ping.vala \ - src/mconnect/ping-proxy.vala \ - src/mconnect/config.vala \ - src/mconnect/application.vala \ - src/mconnect/utils.vala \ - src/mconnect/property-proxy.vala \ - src/crypt/certificate.vala - -mconnect_LDADD = \ - $(MCONNECT_LIBS) - -mconnect_CFLAGS = \ - $(MCONNECT_CFLAGS) \ - -I$(top_srcdir)/src/crypt - -#------------------------------------------------------------- - -test_mconn_crypt_SOURCES = \ - src/crypt/certificate.vala \ - test/mconn-crypt-vala-test.vala - -test_mconn_crypt_LDADD = \ - $(MCONNECT_LIBS) - -test_mconn_crypt_CFLAGS = \ - $(MCONNECT_CFLAGS) - -test_mconn_crypt_VALAFLAGS = \ - --pkg=gio-2.0 \ - --pkg=posix \ - --pkg=gnutls - -#------------------------------------------------------------- - -mconnectctl_SOURCES = \ - src/mconnectctl/main.vala - -mconnectctl_LDADD = \ - $(MCONNECT_LIBS) - -mconnectctl_CFLAGS = \ - $(MCONNECT_CFLAGS) - - -#------------------------------------------------------------- - -# configure will expand bindir to ${exec_prefix}/bin, we want the -# whole thing, that's why mconnect.desktop is generated here and not -# in configure -do_desktop_subst = sed -e 's,[@]bindir[@],${bindir},g' -mconnect.desktop: mconnect.desktop.in - $(do_desktop_subst) < $< > $@ - -#------------------------------------------------------------- - -REV ?= HEAD - -git-source-dist: - gitsha=`git rev-list $(REV) -1`; \ - git archive --prefix=mconnect-$${gitsha}/ $(REV) | \ - gzip -c > mconnect-$${gitsha}.tar.gz - -#------------------------------------------------------------- - -run-gdb: gdb-script install - gdb -x gdb-script - -.PHONY: run-gdb - -gdb-script: gdb-script.in - sed -e 's,[@]bindir[@],${bindir},g' < $< > $@ - -#------------------------------------------------------------- - -GEN_FROM_VALA = $(filter %.vala,$(mconnect_SOURCES) $(test_mconn_crypt_SOURCES)) -BUILT_SOURCES = \ - mconnect.desktop \ - $(GEN_FROM_VALA:.vala=.c) - -CLEANFILES = $(BUILT_SOURCES) diff --git a/configure.ac b/configure.ac deleted file mode 100644 index cb79a33..0000000 --- a/configure.ac +++ /dev/null @@ -1,60 +0,0 @@ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. -# -# 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, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# AUTHORS -# Maciek Borzecki -# -AC_PREREQ(2.61) -AC_INIT([mconnect], [0.1.0], [maciek.borzecki@gmail.com]) -AC_CONFIG_SRCDIR([src/mconnect/main.vala]) -AC_CONFIG_AUX_DIR([.]) -AC_PROG_MAKE_SET -AM_PROG_LIBTOOL -AM_INIT_AUTOMAKE([tar-pax foreign subdir-objects]) -AM_SILENT_RULES([yes]) - -AM_MAINTAINER_MODE - -# Checks for header files. -# AC_HEADER_STDC -# AC_CHECK_HEADERS([stdlib.h]) - -# Checks for typedefs, structures, and compiler characteristics. -# AC_C_CONST - -# Checks for programs. -AC_PROG_CC -AM_PROG_VALAC([0.7.0]) -AC_PROG_INSTALL - -PKG_CHECK_MODULES(MCONNECT, [glib-2.0, - gobject-2.0, - gobject-introspection-1.0 - gio-2.0, - gio-unix-2.0, - json-glib-1.0, - gee-0.8, - libnotify - gdk-3.0 - atspi-2 - gnutls - ]) -AC_SUBST(MCONNECT_CFLAGS) -AC_SUBST(MCONNECT_LIBS) - -# Files to generate -AC_CONFIG_FILES([Makefile]) - -# Output -AC_OUTPUT diff --git a/extra/install-tree b/extra/install-tree new file mode 100644 index 0000000..3574526 --- /dev/null +++ b/extra/install-tree @@ -0,0 +1,13 @@ +. +`-- [drwxr-xr-x] usr + `-- [drwxr-xr-x] local + |-- [drwxr-xr-x] bin + | |-- [-rwxr-xr-x] mconnect + | `-- [-rwxr-xr-x] mconnectctl + `-- [drwxr-xr-x] share + |-- [drwxr-xr-x] applications + | `-- [-rw-rw-r--] mconnect.desktop + `-- [drwxr-xr-x] mconnect + `-- [-rw-r--r--] mconnect.conf + +6 directories, 4 files diff --git a/extra/travis-build b/extra/travis-build index 8bbb102..455bcaf 100755 --- a/extra/travis-build +++ b/extra/travis-build @@ -27,9 +27,7 @@ deps_fedora() { dnf install --best -y --refresh \ - automake \ - autoconf \ - libtool \ + meson \ pkgconfig \ gcc \ vala \ @@ -40,34 +38,32 @@ deps_fedora() { libnotify-devel \ at-spi2-core-devel \ gtk3-devel \ - glib-networking + glib-networking \ + tree } deps_opensuse() { zypper install -y \ - make \ - automake \ - autoconf \ - libtool \ - pkgconfig \ - gcc \ - vala \ - gobject-introspection-devel \ - json-glib-devel \ - libgee-devel \ - gnutls-devel \ - libnotify-devel \ - at-spi2-core-devel \ - gtk3-devel \ - glib-networking + make \ + meson \ + pkgconfig \ + gcc \ + vala \ + gobject-introspection-devel \ + json-glib-devel \ + libgee-devel \ + gnutls-devel \ + libnotify-devel \ + at-spi2-core-devel \ + gtk3-devel \ + glib-networking \ + tree } deps_archlinux() { pacman -Syu --noconfirm \ base-devel \ - autoconf \ - automake \ - libtool \ + meson \ pkg-config \ gcc \ vala \ @@ -79,22 +75,24 @@ deps_archlinux() { at-spi2-core \ gtk3 \ gnutls \ - glib-networking + glib-networking \ + tree } -deps_ubuntu() { +deps_ubuntu_xenial() { apt-get update && \ - apt-get install -y \ - autoconf \ - libtool \ - valac \ - libgirepository1.0-dev \ - libjson-glib-dev \ - libgee-0.8-dev \ - libgnutls28-dev \ - libnotify-dev \ - libgtk-3-dev \ - glib-networking + apt-get install -y \ + meson/xenial-backports \ + pkg-config \ + valac \ + libgirepository1.0-dev \ + libjson-glib-dev \ + libgee-0.8-dev \ + libgnutls28-dev \ + libnotify-dev \ + libgtk-3-dev \ + glib-networking \ + tree } install_deps() { @@ -108,8 +106,8 @@ install_deps() { archlinux) deps_archlinux ;; - ubuntu) - deps_ubuntu + ubuntu-xenial) + deps_ubuntu_xenial ;; *) echo "unsupported distro $1" @@ -118,11 +116,16 @@ install_deps() { } build() { - autoreconf -if && \ - ./configure && \ - make && \ - make check && \ - make install + set -e + mkdir build && \ + cd build && \ + meson .. && \ + ninja && \ + ninja test + + DESTDIR=$PWD/install-dir ninja install + (cd install-dir; LC_ALL=C tree -pan . > ../current-tree) + diff -up ../extra/install-tree current-tree } build_in_container() { @@ -142,8 +145,8 @@ spin_container() { opensuse) DOCKER_IMG=opensuse:tumbleweed ;; - ubuntu) - DOCKER_IMG=ubuntu:latest + ubuntu-xenial) + DOCKER_IMG=ubuntu:xenial ;; *) echo "unsupported distro $1" From e6cfb51e2ce413925c70ef456fb380298359304e Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Tue, 3 Oct 2017 09:04:45 +0200 Subject: [PATCH 2/3] extra: helper for doing local builds --- extra/local-build | 13 +++++++++++++ extra/travis-build | 12 +++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) create mode 100755 extra/local-build diff --git a/extra/local-build b/extra/local-build new file mode 100755 index 0000000..e5e74e0 --- /dev/null +++ b/extra/local-build @@ -0,0 +1,13 @@ +#!/bin/bash + +set -ex + +SELFDIR=$(dirname $(readlink -f $0)) +TOPDIR=$(readlink -f $SELFDIR/..) + +export IN_CONTAINER=1 +export NO_BUILD=1 +. $SELFDIR/travis-build + +(cd $TOPDIR && \ + build) diff --git a/extra/travis-build b/extra/travis-build index 455bcaf..18eced8 100755 --- a/extra/travis-build +++ b/extra/travis-build @@ -116,7 +116,7 @@ install_deps() { } build() { - set -e + set -ex mkdir build && \ cd build && \ meson .. && \ @@ -162,8 +162,10 @@ spin_container() { /mnt/extra/travis-build "$@" } -if [ "$IN_CONTAINER" = "1" ]; then - build_in_container "$@" -else - spin_container "$@" +if [ -z "$NO_BUILD" ]; then + if [ "$IN_CONTAINER" = "1" ]; then + build_in_container "$@" + else + spin_container "$@" + fi fi From 9ca9f24dc8815c6e045a6ba912703aaf6cb9b5ae Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Tue, 3 Oct 2017 09:22:02 +0200 Subject: [PATCH 3/3] README: update build instructions, add meson dependency --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a088abb..5d5cae7 100644 --- a/README.md +++ b/README.md @@ -18,17 +18,19 @@ Build dependencies (using package names as found in Fedora): - libnotify-devel - gtk3-devel - at-spi2-core-devel (and at-spi2-atk) +- meson +- pkg-config or see `extra/travis-build` in the source tree for example installation commands. Once build deps are in place, run: - autoreconf -if - ./configure --prefix= - make - make install - # or make DESTDIR= install if you want to inspect what - # gets installed - + mkdir build + cd build + meson .. + ninja + ninja install + # to set a custom installation directory run: + # DESTDIR= ninja install # Configuration