Browse Source

Merge pull request #26 from bboozzoo/bboozzoo/meson-only

drop autotools, use meson exclusively
bboozzzoo/sms
Maciej Borzecki 7 years ago
committed by GitHub
parent
commit
332cadb996
7 changed files with 89 additions and 273 deletions
  1. +1
    -1
      .travis.yml
  2. +0
    -157
      Makefile.am
  3. +9
    -7
      README.md
  4. +0
    -60
      configure.ac
  5. +13
    -0
      extra/install-tree
  6. +13
    -0
      extra/local-build
  7. +53
    -48
      extra/travis-build

+ 1
- 1
.travis.yml View File

@ -6,7 +6,7 @@ env:
- DISTRO=fedora - DISTRO=fedora
- DISTRO=archlinux - DISTRO=archlinux
- DISTRO=opensuse - DISTRO=opensuse
- DISTRO=ubuntu
- DISTRO=ubuntu-xenial
script: script:
- ./extra/travis-build "${DISTRO}" - ./extra/travis-build "${DISTRO}"

+ 0
- 157
Makefile.am View File

@ -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 <maciek.borzecki (at] gmail.com>
#
# 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)

+ 9
- 7
README.md View File

@ -18,17 +18,19 @@ Build dependencies (using package names as found in Fedora):
- libnotify-devel - libnotify-devel
- gtk3-devel - gtk3-devel
- at-spi2-core-devel (and at-spi2-atk) - at-spi2-core-devel (and at-spi2-atk)
- meson
- pkg-config
or see `extra/travis-build` in the source tree for example installation or see `extra/travis-build` in the source tree for example installation
commands. Once build deps are in place, run: commands. Once build deps are in place, run:
autoreconf -if
./configure --prefix=<your favorite prefix>
make
make install
# or make DESTDIR=<somedir> 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=<somedir> ninja install
# Configuration # Configuration


+ 0
- 60
configure.ac View File

@ -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 <maciek.borzecki (at] gmail.com>
#
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

+ 13
- 0
extra/install-tree View File

@ -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

+ 13
- 0
extra/local-build View File

@ -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)

+ 53
- 48
extra/travis-build View File

@ -27,9 +27,7 @@
deps_fedora() { deps_fedora() {
dnf install --best -y --refresh \ dnf install --best -y --refresh \
automake \
autoconf \
libtool \
meson \
pkgconfig \ pkgconfig \
gcc \ gcc \
vala \ vala \
@ -40,34 +38,32 @@ deps_fedora() {
libnotify-devel \ libnotify-devel \
at-spi2-core-devel \ at-spi2-core-devel \
gtk3-devel \ gtk3-devel \
glib-networking
glib-networking \
tree
} }
deps_opensuse() { deps_opensuse() {
zypper install -y \ 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() { deps_archlinux() {
pacman -Syu --noconfirm \ pacman -Syu --noconfirm \
base-devel \ base-devel \
autoconf \
automake \
libtool \
meson \
pkg-config \ pkg-config \
gcc \ gcc \
vala \ vala \
@ -79,22 +75,24 @@ deps_archlinux() {
at-spi2-core \ at-spi2-core \
gtk3 \ gtk3 \
gnutls \ gnutls \
glib-networking
glib-networking \
tree
} }
deps_ubuntu() {
deps_ubuntu_xenial() {
apt-get update && \ 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() { install_deps() {
@ -108,8 +106,8 @@ install_deps() {
archlinux) archlinux)
deps_archlinux deps_archlinux
;; ;;
ubuntu)
deps_ubuntu
ubuntu-xenial)
deps_ubuntu_xenial
;; ;;
*) *)
echo "unsupported distro $1" echo "unsupported distro $1"
@ -118,11 +116,16 @@ install_deps() {
} }
build() { build() {
autoreconf -if && \
./configure && \
make && \
make check && \
make install
set -ex
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() { build_in_container() {
@ -142,8 +145,8 @@ spin_container() {
opensuse) opensuse)
DOCKER_IMG=opensuse:tumbleweed DOCKER_IMG=opensuse:tumbleweed
;; ;;
ubuntu)
DOCKER_IMG=ubuntu:latest
ubuntu-xenial)
DOCKER_IMG=ubuntu:xenial
;; ;;
*) *)
echo "unsupported distro $1" echo "unsupported distro $1"
@ -159,8 +162,10 @@ spin_container() {
/mnt/extra/travis-build "$@" /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 fi

Loading…
Cancel
Save