summaryrefslogtreecommitdiff
blob: 9daf8f9fe45eabf2b96eebd89f733c9032fceff7 (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
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit toolchain-funcs

MY_COMMIT="6c10c305e8dde193546e6b33cf8a785d5dc123e2"

DESCRIPTION="Google snappy in C for Linux Kernel"
HOMEPAGE="https://github.com/zeevt/csnappy"
SRC_URI="https://github.com/zeevt/csnappy/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}"/${PN}-${MY_COMMIT}

# https://github.com/zeevt/csnappy/issues/21
LICENSE="BSD"
# 0/${PV} b/c of the SONAME situation (see below).
SLOT="0/${PV}"
KEYWORDS="~amd64 ~ppc64 ~x86"

# https://github.com/zeevt/csnappy/issues/33
# No SONAME yet.
QA_SONAME="usr/lib.*/libcsnappy.so"

PATCHES=(
	"${FILESDIR}"/${PN}-0_pre20220804-fix-tests.patch
)

src_compile() {
	emake CC="$(tc-getCC)" OPT_FLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
		libcsnappy.so
}

src_test() {
	# We don't want to run the Valgrind tests as it's fragile in sandbox
	# and makes life harder for some arches.
	emake CC="$(tc-getCC)" OPT_FLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
		check_unaligned_uint64 \
		cl_test
}

src_install() {
	emake DESTDIR="${ED}" LIBDIR="/usr/$(get_libdir)" install
}