summaryrefslogtreecommitdiff
blob: 0df5cfc8b4b97bb1700295e612f3829c6222d776 (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
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

inherit cmake-utils flag-o-matic linux-info udev

DESCRIPTION="turns FL2000-based USB 3.0 to VGA adapters into low cost DACs"

HOMEPAGE="https://osmocom.org/projects/osmo-fl2k/wiki"

if [[ ${PV} == "9999" ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://git.osmocom.org/osmo-fl2k"
else
	KEYWORDS="~amd64"
	SRC_URI="https://git.osmocom.org/osmo-fl2k/snapshot/v${PV}.tar.gz -> ${P}.tar.gz"
	S="${WORKDIR}/v${PV}"
fi

LICENSE="GPL-2+"
SLOT="0"

IUSE="udev"

DEPEND="virtual/libusb:1"
RDEPEND="${DEPEND}"
PDEPEND="media-sound/sox
	sys-apps/pv"

# continguous memory allocator can optionally be used for zero-copy transfer
# TODO: tell users to set CONFIG_CMA_SIZE_MBYTES or boot with cma=... parameter
CONFIG_CHECK="~CMA ~DMA_CMA"

src_configure() {
	# udev rules use wrong filename and would go to wrong directory anyway
	local mycmakeargs=(
		-DLIB_INSTALL_DIR="/usr/$(get_libdir)"
		-DINSTALL_UDEV_RULES=OFF
	)
	#https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653
	replace-flags -O0 -O2
	replace-flags -Os -O2
	cmake-utils_src_configure
}

src_install() {
	if use udev; then
		udev_newrules ${PN}.rules 99-${PN}.rules
	fi
	cmake-utils_src_install
}