1
0
mirror of https://github.com/falk-werner/webfuse synced 2024-10-27 20:34:10 +00:00

Merge pull request #72 from nosamad/master

switch to meson buildsystem
This commit is contained in:
Falk Werner 2020-06-07 18:25:50 +02:00 committed by GitHub
commit b363426b65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 115 additions and 212 deletions

View File

@ -18,7 +18,7 @@ env:
- DISTRIB_ID=ubuntu VARIANT=coverage MARCH=x86_64 CHECK_TARGET=check
- DISTRIB_ID=ubuntu VARIANT=release MARCH=x86_64 CHECK_TARGET=memcheck
- DISTRIB_ID=ubuntu VARIANT=debug MARCH=arm32v7 CHECK_TARGET=check
- DISTRIB_ID=ubuntu VARIANT=min_size_rel MARCH=arm32v7 CHECK_TARGET=check
- DISTRIB_ID=ubuntu VARIANT=minsize MARCH=arm32v7 CHECK_TARGET=check
- DISTRIB_ID=alpine VARIANT=debug MARCH=x86_64 CHECK_TARGET=check
before_script:
- make -j4 DISTRIB_ID=$DISTRIB_ID VARIANT=$VARIANT MARCH=$MARCH

View File

@ -11,7 +11,9 @@ default: all
# Overridable project defaults
DOBUILD_DOCKERFILE ?= $(PROJECTDIR)/build/%MARCH%-%DISTRIB_ID%-%ID%.dockerfile
DOBUILD_EXTDIR ?= $(PROJECTDIR)/build/dobuild-extensions
DOBUILD_PROJECTDIR ?= $(patsubst %/,%,$(dir $(MAKEFILE)))
DOBUILD_GENERIC_ADAPTER ?= meson
DOBUILDDIR ?= $(PROJECTDIR)/build/dobuild
PROJECTDIR = $(DOBUILD_PROJECTDIR)
@ -39,30 +41,12 @@ FETCH_TARGETS += $(FETCHDIR)/dumb-init-$(DUMB_INIT_VERSION).tar.gz
$(FETCHDIR)/dumb-init-$(DUMB_INIT_VERSION).tar.gz: URL := https://github.com/Yelp/dumb-init/archive/v${DUMB_INIT_VERSION}.tar.gz
$(SKIP_MD5SUM)$(FETCHDIR)/dumb-init-$(DUMB_INIT_VERSION).tar.gz: MD5 := 6166084b05772cdcf615a762c6f3b32e
GTEST_VERSION ?= 1.10.0
IMAGE_BUILDARGS += GTEST_VERSION=$(GTEST_VERSION)
FETCH_TARGETS += $(FETCHDIR)/googletest-release-$(GTEST_VERSION).tar.gz
$(FETCHDIR)/googletest-release-$(GTEST_VERSION).tar.gz: URL := https://github.com/google/googletest/archive/release-$(GTEST_VERSION).tar.gz
$(SKIP_MD5SUM)$(FETCHDIR)/googletest-release-$(GTEST_VERSION).tar.gz: MD5 := ecd1fa65e7de707cd5c00bdac56022cd
FUSE_VERSION ?= 3.9.1
IMAGE_BUILDARGS += FUSE_VERSION=$(FUSE_VERSION)
FETCH_TARGETS += $(FETCHDIR)/libfuse-fuse-$(FUSE_VERSION).tar.gz
$(FETCHDIR)/libfuse-fuse-$(FUSE_VERSION).tar.gz: URL := https://github.com/libfuse/libfuse/archive/fuse-$(FUSE_VERSION).tar.gz
$(SKIP_MD5SUM)$(FETCHDIR)/libfuse-fuse-$(FUSE_VERSION).tar.gz: MD5 := 5f7c1062def710d8b60343524a18cc82
WEBSOCKETS_VERSION ?= 4.0.10
IMAGE_BUILDARGS += WEBSOCKETS_VERSION=$(WEBSOCKETS_VERSION)
FETCH_TARGETS += $(FETCHDIR)/libwebsockets-$(WEBSOCKETS_VERSION).tar.gz
$(FETCHDIR)/libwebsockets-$(WEBSOCKETS_VERSION).tar.gz: URL := https://github.com/warmcat/libwebsockets/archive/v$(WEBSOCKETS_VERSION).tar.gz
$(SKIP_MD5SUM)$(FETCHDIR)/libwebsockets-$(WEBSOCKETS_VERSION).tar.gz: MD5 := a1ce5a279fd06b2ce132c02c292df7aa
JANSSON_VERSION ?= 2.12
IMAGE_BUILDARGS += JANSSON_VERSION=$(JANSSON_VERSION)
FETCH_TARGETS += $(FETCHDIR)/jansson-$(JANSSON_VERSION).tar.gz
$(FETCHDIR)/jansson-$(JANSSON_VERSION).tar.gz: URL := https://github.com/akheron/jansson/archive/v$(JANSSON_VERSION).tar.gz
$(SKIP_MD5SUM)$(FETCHDIR)/jansson-$(JANSSON_VERSION).tar.gz: MD5 := c4b106528d5ffb521178565de1ba950d
QEMU_VERSION ?= v4.1.0-1
IMAGE_BUILDARGS += QEMU_VERSION_=$(QEMU_VERSION)
FETCH_TARGETS += $(FETCHDIR)/qemu-arm-static-$(QEMU_VERSION)
@ -72,7 +56,7 @@ $(SKIP_MD5SUM)$(FETCHDIR)/qemu-arm-static-$(QEMU_VERSION): MD5 := e508e6e4dd7f3a
#######################################################################################################################
# Architecture-specific rule target configuration
CMAKE_TARGETS += $(call target_properties_combine,\
GENERIC_TARGETS += $(call target_properties_combine,\
,\
x86_64 arm32v7,\
ubuntu@bionic alpine@3.9,\
@ -80,9 +64,9 @@ CMAKE_TARGETS += $(call target_properties_combine,\
,\
builder,\
,\
debug release coverage min_size_rel \
debug release coverage minsize \
)
DOCKER_TARGETS += $(CMAKE_TARGETS)
DOCKER_TARGETS += $(GENERIC_TARGETS)
#######################################################################################################################
# Common rule target configuration
@ -114,7 +98,6 @@ MAKEFILE_DEPS += cp
#######################################################################################################################
# Rules
include $(DOBUILDDIR)/cmake.mk
include $(DOBUILDDIR)/docker.mk
include $(DOBUILDDIR)/standardrules.mk

View File

@ -14,14 +14,21 @@ RUN set -x \
gcc \
g++ \
make \
python3 \
py3-pip \
py3-setuptools \
py3-cryptography \
cmake \
ninja \
pkgconf \
rsync \
tar \
gdb \
valgrind
# util-linux \
# util-linux-dev
git \
ca-certificates \
openssl \
openssl-dev \
linux-headers \
&& pip3 install meson
COPY src /usr/local/src
@ -44,60 +51,18 @@ RUN set -x \
&& rm -rf "$builddir" \
&& apk del .build-deps
ARG GTEST_VERSION=1.10.0
RUN set -x \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake "/usr/local/src/googletest-release-$GTEST_VERSION" \
&& make "$PARALLELMFLAGS" install \
&& rm -rf "$builddir"
ARG FUSE_VERSION=3.9.1
RUN set -x \
&& builddeps="linux-headers eudev-dev python3 py3-pip py3-setuptools py3-cryptography" \
&& builddeps="eudev-dev" \
&& apk add --no-cache --virtual .build-deps $builddeps \
&& pip3 install meson \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& meson "/usr/local/src/libfuse-fuse-$FUSE_VERSION" \
&& meson configure -Dexamples=false \
&& ninja \
&& ninja install \
&& pip3 uninstall -y meson \
&& meson -Dexamples=false "$builddir" "/usr/local/src/libfuse-fuse-$FUSE_VERSION" \
&& ninja "$PARALLELMFLAGS" -C "$builddir" install \
&& rm -rf "$builddir" \
&& apk del .build-deps
ARG WEBSOCKETS_VERSION=4.0.10
RUN set -x \
&& builddeps="linux-headers" \
&& apk add --no-cache --virtual .build-deps $builddeps \
&& apk add --no-cache \
ca-certificates \
openssl \
openssl-dev \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake "/usr/local/src/libwebsockets-$WEBSOCKETS_VERSION" \
&& make "$PARALLELMFLAGS" install \
&& rm -rf "$builddir" \
&& apk del .build-deps
ARG JANSSON_VERSION=2.12
RUN set -x \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake -DJANSSON_BUILD_DOCS=OFF "/usr/local/src/jansson-$JANSSON_VERSION" \
&& make "$PARALLELMFLAGS" install \
&& rm -rf "$builddir"
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
ENV PKG_CONFIG_PATH=/usr/local/lib32/pkgconfig

View File

@ -12,13 +12,21 @@ RUN set -x \
&& apt upgrade -y \
&& apt install --yes --no-install-recommends \
build-essential \
python3 \
python3-pip \
python3-setuptools \
python3-wheel \
cmake \
ninja-build \
pkg-config \
rsync \
gdb \
gdbserver \
lcov
lcov \
git \
ca-certificates \
openssl \
libssl-dev \
&& pip3 install --system meson
COPY src /usr/local/src
@ -41,57 +49,18 @@ RUN set -x \
&& rm -rf "$builddir" \
&& apt purge -y $builddeps
ARG GTEST_VERSION=1.10.0
RUN set -x \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake "/usr/local/src/googletest-release-$GTEST_VERSION" \
&& make "$PARALLELMFLAGS" install \
&& rm -rf "$builddir"
ARG FUSE_VERSION=3.9.1
RUN set -x \
&& builddeps="udev gettext python3 python3-pip python3-setuptools python3-wheel" \
&& builddeps="udev gettext" \
&& apt install --yes --no-install-recommends $builddeps \
&& pip3 install --system meson \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& meson "/usr/local/src/libfuse-fuse-$FUSE_VERSION" \
&& meson configure -Dexamples=false \
&& ninja \
&& ninja install \
&& pip3 uninstall -y meson \
&& meson -Dexamples=false "$builddir" "/usr/local/src/libfuse-fuse-$FUSE_VERSION" \
&& ninja "$PARALLELMFLAGS" -C "$builddir" install \
&& rm -rf "$builddir" \
&& apt purge -y $builddeps
ARG WEBSOCKETS_VERSION=4.0.10
RUN set -x \
&& apt install --yes --no-install-recommends \
ca-certificates \
openssl \
libssl-dev \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake "/usr/local/src/libwebsockets-$WEBSOCKETS_VERSION" \
&& make "$PARALLELMFLAGS" install \
&& rm -rf "$builddir"
ARG JANSSON_VERSION=2.12
RUN set -x \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake -DJANSSON_BUILD_DOCS=OFF "/usr/local/src/jansson-$JANSSON_VERSION" \
&& make "$PARALLELMFLAGS" install \
&& rm -rf "$builddir"
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
ARG USERID=1000

View File

@ -0,0 +1,4 @@
#!/bin/sh
exec ninja_adapter "$@"

View File

@ -0,0 +1,4 @@
#!/bin/sh -e
exec ninja_adapter test "$@"

View File

@ -0,0 +1,9 @@
#!/bin/sh
. DoBuildFiles/generic.properties
{ [ -z "$BUILDVERBOSE" ] && [ -z "$TESTVERBOSE" ]; } || set -- -v "$@"
[ -z "$VERBOSE" ] || set -x
exec meson test -C "${PWD}/meson" --num-processes "$NPROC" --print-errorlogs --wrap 'valgrind --error-exitcode=1' "$@"

View File

@ -0,0 +1,10 @@
#!/bin/sh
. DoBuildFiles/generic.properties
set -- "$@" -C "${PWD}/meson"
{ [ -z "$BUILDVERBOSE" ] && [ -z "$TESTVERBOSE" ]; } || set -- -v "$@"
[ -z "$VERBOSE" ] || set -x
exec ninja -j"$NPROC" "$@"

View File

@ -0,0 +1,5 @@
#!/bin/sh
export DESTDIR="$1"
exec ninja_adapter install

View File

@ -0,0 +1,18 @@
#!/bin/sh
. DoBuildFiles/generic.properties
rm -rf meson
BUILDTYPE="$VARIANT"
COVERAGE=false
if [ "$VARIANT" = "coverage" ]; then
BUILDTYPE="debug"
COVERAGE=true
fi
[ -z "$VERBOSE" ] || set -x
exec meson setup --buildtype "$BUILDTYPE" "-Db_coverage=$COVERAGE" "${PWD}/meson" "$PROJECTDIR" "$@"

View File

@ -552,7 +552,7 @@ HOST_CONTAINER = $(call memorize,HOST_CONTAINER,$(DOBUILD_HOSTCONTAINER))
SOURCE_DATE_EPOCH ?= $(call memorize,SOURCE_DATE_EPOCH,$(shell $(DOBUILDDIR)/bin/get_source_date_epoch $(TOPDIR)))
BUILDTIME = $(call memorize,BUILDTIME,$(shell date -u -d '@$(SOURCE_DATE_EPOCH)' --rfc-3339 ns 2>/dev/null))
JOBSLOTS_DEFAULT = $(if $(findstring --jobserver-,$(make_cmdline)),2,$(shell nproc 2>/dev/null || echo '2'))
JOBSLOTS_DEFAULT = $(if $(findstring --jobserver-,$(make_cmdline)),2,$(nproc))
JOBSLOTS = $(call memorize,JOBSLOTS,$(or $(DOBUILD_JOBSLOTS),$(JOBSLOTS_DEFAULT)))
SKIP_MD5SUM = $(call memorize,SKIP_MD5SUM,$(DOBUILD_SKIPMD5SUM))
@ -590,6 +590,7 @@ $(VERBOSE)SILENT := @
make_pid = $(call memorize,make_pid,$(shell echo "$$PPID"))
make_cmdline = $(call memorize,make_cmdline,$(shell set -- $$(ps T 2>/dev/null | sed -n -e 's!^\s*$(make_pid)\s\+.*\($(call escape,$(MAKE),!)\s\+.*\)!\1!p') && echo "$$@"))
nproc = $(call memorize,nproc,$(shell nproc || echo '1'))
machine = $(call memorize,machine,$(shell uname -m 2>/dev/null))
make_version = $(MAKE_VERSION)

View File

@ -344,7 +344,7 @@ ifeq ($(docker_portable_workspace),)
container_destdir = $(abspath $(DESTDIR))
endif
container_cpus = $(call min,$(INTERNPARALLEL) $(JOBSLOTS_DEFAULT))
container_cpus = $(call min,$(INTERNPARALLEL) $(nproc))
container_cpuperiod = 100000
container_quota = $(call bc,($(container_cpus)*$(container_cpuperiod)))
container_nproc = $(INTERNPARALLEL)

View File

@ -105,7 +105,7 @@ generic_default_prerequisites = \
# retrieves the target generic default extension directory
# $(call generic_default_extdir,target-name)
generic_default_extdir = $(addprefix $(PROJECTDIR)/dobuild-extensions/,$(cache.$1.adapter))
generic_default_extdir = $(addprefix $(addsuffix /,$(EXTDIR)),$(cache.$1.adapter))
# creates a generic run rule command
# $(call generic_run_cmd,target-name,command[,args],alternative-command[,output-command])

View File

@ -10,14 +10,22 @@ RUN set -x \
gcc \
g++ \
make \
python3 \
py3-pip \
py3-setuptools \
py3-cryptography \
cmake \
ninja \
pkgconf \
rsync \
tar \
gdb \
valgrind
# util-linux \
# util-linux-dev
valgrind \
git \
ca-certificates \
openssl \
openssl-dev \
linux-headers \
&& pip3 install meson
COPY src /usr/local/src
@ -40,60 +48,18 @@ RUN set -x \
&& rm -rf "$builddir" \
&& apk del .build-deps
ARG GTEST_VERSION=1.10.0
RUN set -x \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake "/usr/local/src/googletest-release-$GTEST_VERSION" \
&& make "$PARALLELMFLAGS" install \
&& rm -rf "$builddir"
ARG FUSE_VERSION=3.9.1
RUN set -x \
&& builddeps="linux-headers eudev-dev python3 py3-pip py3-setuptools py3-cryptography" \
&& builddeps="eudev-dev" \
&& apk add --no-cache --virtual .build-deps $builddeps \
&& pip3 install meson \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& meson "/usr/local/src/libfuse-fuse-$FUSE_VERSION" \
&& meson configure -Dexamples=false \
&& ninja \
&& ninja install \
&& pip3 uninstall -y meson \
&& meson -Dexamples=false "$builddir" "/usr/local/src/libfuse-fuse-$FUSE_VERSION" \
&& ninja "$PARALLELMFLAGS" -C "$builddir" install \
&& rm -rf "$builddir" \
&& apk del .build-deps
ARG WEBSOCKETS_VERSION=4.0.10
RUN set -x \
&& builddeps="linux-headers" \
&& apk add --no-cache --virtual .build-deps $builddeps \
&& apk add --no-cache \
ca-certificates \
openssl \
openssl-dev \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake "/usr/local/src/libwebsockets-$WEBSOCKETS_VERSION" \
&& make "$PARALLELMFLAGS" install \
&& rm -rf "$builddir" \
&& apk del .build-deps
ARG JANSSON_VERSION=2.12
RUN set -x \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake -DJANSSON_BUILD_DOCS=OFF "/usr/local/src/jansson-$JANSSON_VERSION" \
&& make "$PARALLELMFLAGS" install \
&& rm -rf "$builddir"
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig

View File

@ -8,14 +8,22 @@ RUN set -x \
&& apt upgrade -y \
&& apt install --yes --no-install-recommends \
build-essential \
python3 \
python3-pip \
python3-setuptools \
python3-wheel \
cmake \
ninja-build \
pkg-config \
rsync \
gdb \
gdbserver \
valgrind \
lcov
lcov \
git \
ca-certificates \
openssl \
libssl-dev \
&& pip3 install --system meson
COPY src /usr/local/src
@ -38,57 +46,18 @@ RUN set -x \
&& rm -rf "$builddir" \
&& apt purge -y $builddeps
ARG GTEST_VERSION=1.10.0
RUN set -x \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake "/usr/local/src/googletest-release-$GTEST_VERSION" \
&& make "$PARALLELMFLAGS" install \
&& rm -rf "$builddir"
ARG FUSE_VERSION=3.9.1
RUN set -x \
&& builddeps="udev gettext python3 python3-pip python3-setuptools python3-wheel" \
&& builddeps="udev gettext" \
&& apt install --yes --no-install-recommends $builddeps \
&& pip3 install --system meson \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& meson "/usr/local/src/libfuse-fuse-$FUSE_VERSION" \
&& meson configure -Dexamples=false \
&& ninja \
&& ninja install \
&& pip3 uninstall -y meson \
&& meson -Dexamples=false "$builddir" "/usr/local/src/libfuse-fuse-$FUSE_VERSION" \
&& ninja "$PARALLELMFLAGS" -C "$builddir" install \
&& rm -rf "$builddir" \
&& apt purge -y $builddeps
ARG WEBSOCKETS_VERSION=4.0.10
RUN set -x \
&& apt install --yes --no-install-recommends \
ca-certificates \
openssl \
libssl-dev \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake "/usr/local/src/libwebsockets-$WEBSOCKETS_VERSION" \
&& make "$PARALLELMFLAGS" install \
&& rm -rf "$builddir"
ARG JANSSON_VERSION=2.12
RUN set -x \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& cmake -DJANSSON_BUILD_DOCS=OFF "/usr/local/src/jansson-$JANSSON_VERSION" \
&& make "$PARALLELMFLAGS" install \
&& rm -rf "$builddir"
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
ARG USERID=1000