Diff libftdi-0.20-r2 with a libftdi-1.5-r5

/usr/portage/dev-embedded/libftdi/libftdi-1.5-r5.ebuild 2023-10-09 14:52:29.348368347 +0300
6 6
PYTHON_COMPAT=( python3_{10..11} )
7 7
inherit cmake python-single-r1
8 8

  
9
MY_P="${PN}1-${PV}"
9 10
if [[ ${PV} == 9999* ]] ; then
10 11
	inherit git-r3
11 12
	EGIT_REPO_URI="git://developer.intra2net.com/${PN}"
12 13
else
13
	SRC_URI="https://www.intra2net.com/en/developer/${PN}/download/${P}.tar.gz"
14
	KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86"
14
	SRC_URI="https://www.intra2net.com/en/developer/${PN}/download/${MY_P}.tar.bz2"
15
	S="${WORKDIR}/${MY_P}"
16

  
17
	KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv sparc x86"
18

  
19
	PATCHES=(
20
		"${FILESDIR}"/${P}-tests-no-cxx.patch
21
		"${FILESDIR}"/${P}-cmake-cxx.patch
22
	)
15 23
fi
16 24

  
17 25
DESCRIPTION="Userspace access to FTDI USB interface chips"
18 26
HOMEPAGE="https://www.intra2net.com/en/developer/libftdi/"
19 27

  
20 28
LICENSE="LGPL-2"
21
SLOT="0"
22
IUSE="cxx doc examples python static-libs"
29
SLOT="1"
30
IUSE="cxx doc examples python test tools"
31
RESTRICT="!test? ( test )"
23 32
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
24 33

  
25 34
RDEPEND="
26
	virtual/libusb:0
35
	virtual/libusb:1
27 36
	cxx? ( dev-libs/boost )
28
	doc? ( !dev-embedded/libftdi:1[doc] )
37
	doc? ( !dev-embedded/libftdi:0[doc] )
29 38
	python? ( ${PYTHON_DEPS} )
39
	tools? ( dev-libs/confuse:= )
40
"
41
DEPEND="${RDEPEND}
42
	test? ( dev-libs/boost )
30 43
"
31
DEPEND="${RDEPEND}"
32 44
BDEPEND="
33 45
	doc? ( app-doc/doxygen )
34 46
	python? ( dev-lang/swig )
35 47
"
36 48

  
37
PATCHES=(
38
	"${FILESDIR}"/${P}-cmake-include.patch
39
	"${FILESDIR}"/${P}-cmake-version.patch
40
)
41

  
42 49
pkg_setup() {
43 50
	use python && python-single-r1_pkg_setup
44 51
}
45 52

  
46
src_prepare() {
47
	if use python; then
48
		sed -i \
49
			-e "s:[$]{PYTHON_LIB_INSTALL}/../site-packages:$(python_get_sitedir):" \
50
			bindings/CMakeLists.txt || die
51
	fi
52
	sed -i \
53
		-e '/SET(LIB_SUFFIX /d' \
54
		CMakeLists.txt || die
55

  
56
	cmake_src_prepare
57
}
58

  
59 53
src_configure() {
60 54
	local mycmakeargs=(
61 55
		-DFTDIPP=$(usex cxx)
62 56
		-DDOCUMENTATION=$(usex doc)
63 57
		-DEXAMPLES=$(usex examples)
64 58
		-DPYTHON_BINDINGS=$(usex python)
59
		-DBUILD_TESTS=$(usex test)
60
		-DFTDI_EEPROM=$(usex tools)
65 61
		-DCMAKE_SKIP_BUILD_RPATH=ON
62
		-DSTATICLIBS=OFF
66 63
	)
67

  
68 64
	cmake_src_configure
69 65
}
70 66

  
67
src_test() {
68
	cd "${BUILD_DIR}/test" || die
69
	LD_LIBRARY_PATH="${BUILD_DIR}/src" ./test_libftdi1 -l all || die
70
}
71

  
71 72
src_install() {
72 73
	cmake_src_install
74

  
73 75
	use python && python_optimize
74
	dodoc ChangeLog README
76
	dodoc AUTHORS ChangeLog README TODO
75 77

  
76 78
	if use doc ; then
77 79
		# Clean up man pages with too generic names. #356369
78
		rm -vf "${BUILD_DIR}"/doc/man/man3/{_,usb_,deprecated}* || die
80
		rm -vf "${BUILD_DIR}"/doc/man/man3/_* || die
79 81

  
80 82
		doman "${BUILD_DIR}"/doc/man/man3/*
81 83
		dodoc -r "${BUILD_DIR}"/doc/html
......
85 87
		docinto examples
86 88
		dodoc examples/*.c
87 89
	fi
88

  
89
	use static-libs || rm "${ED}"/usr/$(get_libdir)/${PN}.a || die
90 90
}
Thank you!