From 39e7d37cc5a1ec507f51366e930c004f0f530b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= Date: Tue, 5 Oct 2021 23:05:33 +0200 Subject: [PATCH] New package: bees-0.7 --- .../0001-don-t-run-tests-unless-asked.patch | 44 +++++++++++++++ .../patches/0002-move-sbin-into-bin.patch | 37 +++++++++++++ ...0003-start-work-on-cross-compilation.patch | 54 +++++++++++++++++++ srcpkgs/bees/patches/series | 2 + srcpkgs/bees/template | 28 ++++++++++ 5 files changed, 165 insertions(+) create mode 100644 srcpkgs/bees/patches/0001-don-t-run-tests-unless-asked.patch create mode 100644 srcpkgs/bees/patches/0002-move-sbin-into-bin.patch create mode 100644 srcpkgs/bees/patches/0003-start-work-on-cross-compilation.patch create mode 100644 srcpkgs/bees/patches/series create mode 100644 srcpkgs/bees/template diff --git a/srcpkgs/bees/patches/0001-don-t-run-tests-unless-asked.patch b/srcpkgs/bees/patches/0001-don-t-run-tests-unless-asked.patch new file mode 100644 index 000000000000..4b1431b45873 --- /dev/null +++ b/srcpkgs/bees/patches/0001-don-t-run-tests-unless-asked.patch @@ -0,0 +1,44 @@ +From e139a679d7cc3f04ad001054a6b1815b7afc92e3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= + +Date: Thu, 7 Oct 2021 18:04:15 +0200 +Subject: [PATCH 1/3] don't run tests unless asked + +--- + Makefile | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/Makefile b/Makefile +index 9c840c4..d4c241e 100644 +--- a/Makefile ++++ b/Makefile +@@ -14,16 +14,12 @@ BEES_VERSION ?= $(shell git describe --always --dirty || echo UNKNOWN) + + DEFAULT_MAKE_TARGET ?= reallyall + +-ifeq ($(DEFAULT_MAKE_TARGET),reallyall) +- RUN_INSTALL_TESTS = test +-endif +- + include Defines.mk + + default: $(DEFAULT_MAKE_TARGET) + + all: lib src scripts +-reallyall: all doc test ++reallyall: all doc + + clean: ## Cleanup + git clean -dfx -e localconf +@@ -55,7 +51,7 @@ install_tools: src + install -Dm755 bin/fiewalk $(DESTDIR)$(PREFIX)/sbin/fiewalk + + install_bees: ## Install bees + libs +-install_bees: src $(RUN_INSTALL_TESTS) ++install_bees: src + install -Dm755 bin/bees $(DESTDIR)$(LIBEXEC_PREFIX)/bees + + install_scripts: ## Install scipts +-- +2.35.1 + diff --git a/srcpkgs/bees/patches/0002-move-sbin-into-bin.patch b/srcpkgs/bees/patches/0002-move-sbin-into-bin.patch new file mode 100644 index 000000000000..3d3b7fe22291 --- /dev/null +++ b/srcpkgs/bees/patches/0002-move-sbin-into-bin.patch @@ -0,0 +1,37 @@ +From fc133aa8647fe34a41c70bd5915c7f7f655d3160 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= + +Date: Thu, 7 Oct 2021 18:05:15 +0200 +Subject: [PATCH 2/3] move sbin/* into bin/* + +Void does not distinguis between bin and sbin, but this patch will +likely not be upstreamable. +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index d4c241e..2694e78 100644 +--- a/Makefile ++++ b/Makefile +@@ -48,7 +48,7 @@ scripts: scripts/beesd scripts/beesd@.service + install_tools: ## Install support tools + libs + install_tools: src + install -Dm755 bin/fiemap $(DESTDIR)$(PREFIX)/bin/fiemap +- install -Dm755 bin/fiewalk $(DESTDIR)$(PREFIX)/sbin/fiewalk ++ install -Dm755 bin/fiewalk $(DESTDIR)$(PREFIX)/bin/fiewalk + + install_bees: ## Install bees + libs + install_bees: src +@@ -56,7 +56,7 @@ install_bees: src + + install_scripts: ## Install scipts + install_scripts: scripts +- install -Dm755 scripts/beesd $(DESTDIR)$(PREFIX)/sbin/beesd ++ install -Dm755 scripts/beesd $(DESTDIR)$(PREFIX)/bin/beesd + install -Dm644 scripts/beesd.conf.sample $(DESTDIR)/$(ETC_PREFIX)/bees/beesd.conf.sample + ifneq ($(SYSTEMD_SYSTEM_UNIT_DIR),) + install -Dm644 scripts/beesd@.service $(DESTDIR)$(SYSTEMD_SYSTEM_UNIT_DIR)/beesd@.service +-- +2.35.1 + diff --git a/srcpkgs/bees/patches/0003-start-work-on-cross-compilation.patch b/srcpkgs/bees/patches/0003-start-work-on-cross-compilation.patch new file mode 100644 index 000000000000..30f758460754 --- /dev/null +++ b/srcpkgs/bees/patches/0003-start-work-on-cross-compilation.patch @@ -0,0 +1,54 @@ +From be64a6e50987dba582d8704d62cb1f9a3577645d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= + +Date: Thu, 7 Oct 2021 18:06:54 +0200 +Subject: [PATCH 3/3] start work on cross compilation + +The tests have to be run on the host, so these shouldn't be cross +compiled. This patch is not done yet, but it's included here anyway, so +that whoever wants to continue on it doesn't have to start from scratch. +--- + makeflags | 3 +++ + test/Makefile | 6 +++--- + 2 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/makeflags b/makeflags +index c5b6951..29e0430 100644 +--- a/makeflags ++++ b/makeflags +@@ -11,3 +11,6 @@ CCFLAGS += -I../include -D_FILE_OFFSET_BITS=64 + + BEES_CFLAGS = $(CCFLAGS) -std=c99 $(CFLAGS) + BEES_CXXFLAGS = $(CCFLAGS) -std=c++11 -Wold-style-cast $(CXXFLAGS) ++ ++BEES_CFLAGS_FOR_BUILD = $(CCFLAGS_FOR_BUILD) -std=c99 $(CFLAGS_FOR_BUILD) ++BEES_CXXFLAGS_FOR_BUILD = $(CCFLAGS_FOR_BUILD) -std=c++11 -Wold-style-cast $(CXXFLAGS_FOR_BUILD) +diff --git a/test/Makefile b/test/Makefile +index ae66a7c..3c70244 100644 +--- a/test/Makefile ++++ b/test/Makefile +@@ -24,7 +24,7 @@ BEES_LDFLAGS = -L../lib $(LDFLAGS) + mkdir -p $@ + + .depends/%.dep: %.cc tests.h Makefile | .depends +- $(CXX) $(BEES_CXXFLAGS) -M -MF $@ -MT $(<:.cc=.o) $< ++ $(CXX_FOR_BUILD) $(BEES_CXXFLAGS_FOR_BUILD) -M -MF $@ -MT $(<:.cc=.o) $< + + depends.mk: $(PROGRAMS:%=.depends/%.dep) + cat $^ > $@.new +@@ -33,10 +33,10 @@ depends.mk: $(PROGRAMS:%=.depends/%.dep) + include depends.mk + + $(PROGRAMS:%=%.o): %.o: %.cc ../makeflags Makefile +- $(CXX) $(BEES_CXXFLAGS) -o $@ -c $< ++ $(CXX_FOR_BUILD) $(BEES_CXXFLAG_FOR_BUILDS) -o $@ -c $< + + $(PROGRAMS): %: %.o ../makeflags Makefile ../lib/libcrucible.a +- $(CXX) $(BEES_CXXFLAGS) $(BEES_LDFLAGS) -o $@ $< $(LIBS) ++ $(CXX_FOR_BUILD) $(BEES_CXXFLAGS_FOR_BUILD) $(BEES_LDFLAGS) -o $@ $< $(LIBS) + + %.txt: % Makefile FORCE + ./$< >$@ 2>&1 || (RC=$$?; cat $@; exit $$RC) +-- +2.35.1 + diff --git a/srcpkgs/bees/patches/series b/srcpkgs/bees/patches/series new file mode 100644 index 000000000000..d9a2837128f2 --- /dev/null +++ b/srcpkgs/bees/patches/series @@ -0,0 +1,2 @@ +0001-don-t-run-tests-unless-asked.patch +0002-move-sbin-into-bin.patch diff --git a/srcpkgs/bees/template b/srcpkgs/bees/template new file mode 100644 index 000000000000..38f6c07da4e2 --- /dev/null +++ b/srcpkgs/bees/template @@ -0,0 +1,28 @@ +# Template file for 'bees' +pkgname=bees +version=0.7 +revision=1 +build_style=gnu-makefile +make_check_target="test" +hostmakedepends="pkg-config" +depends="btrfs-progs" +short_desc="Best-Effort Extent-Same, a btrfs deduplication agent" +maintainer="Jan Christian Grünhage " +license="GPL-3.0-or-later" +homepage="https://github.com/Zygo/bees" +distfiles="https://github.com/Zygo/bees/archive/refs/tags/v${version}.tar.gz" +checksum=2e67422b9f0d9ef665523b474fb27055efffceb263f8ccfdfda2a3aac9c6bdb1 + +if [ "$CROSS_BUILD" ]; then + # Tests don't work properly with cross compilation, because it doesn't + # differentiate between host and target compilers correctly. + # + # There is a patch included which starts working on this, but I + # couldn't get it to work properly, so it's not being applied right + # now. + make_check="no" +fi + +pre_build() { + export BEES_VERSION="${version}" +}