summaryrefslogtreecommitdiff
path: root/dev-embedded/fwup/fwup-1.17.1.ebuild
blob: abd547647df84170faf982e8366b681e4be83e4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit autotools

DESCRIPTION="Configurable embedded Linux firmware update creator and runner"
HOMEPAGE="https://github.com/fwup-home/fwup"
SRC_URI="https://github.com/fwup-home/fwup/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"
IUSE="test"

# Running tests requires dev-util/xdelta to be compiled with lzma support.
# Only run tests when the appropriate USE flag has been set.
RESTRICT="!test? ( test )"

BDEPEND="
	virtual/pkgconfig
	test? ( dev-util/xdelta:3[lzma] )
"

DEPEND="
	>=app-arch/libarchive-3.7.9:=[lzma]
	>=dev-libs/confuse-2.8:=
"

RDEPEND="
	${DEPEND}
	app-arch/zip
	dev-util/xdelta:3
	sys-fs/dosfstools
	sys-fs/mtools
	sys-fs/squashfs-tools
"

src_prepare() {
	default
	eautoreconf
}

src_test() {
	# The fwup tests do not like the portage sandbox. Make them play nice.

	# Certain tests make use of LD_PRELOAD, which does not work in the portage
	# sandbox. Most of these use the $WRITE_SHIM or $MOUNT_SHIM defined in
	# commmon.sh. Some tests define their own. Disable all of these so the
	# tests in question get skipped.
	sed -i 's/^\(WRITE\|MOUNT\|PREAD\|UBI\)_SHIM=".*"/\1_SHIM=""/' \
		'tests/common.sh' \
		'tests/222_block_cache_pread_count.test' \
		'tests/226_ubi_volume_write_success.test' \
		|| die 'Could not disable test shims'

	# set VERIFY_SYSCALLS_DISABLE, to disable tracing
	VERIFY_SYSCALLS_DISABLE="" emake check
}