tkurbad-overlay/dev-embedded/xc3sprog/xc3sprog-9999.ebuild
2021-05-18 11:08:43 +02:00

52 lines
1.2 KiB
Bash

# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=7
EGIT_REPO_URI="https://github.com/matrix-io/xc3sprog.git"
inherit git-r3 cmake-utils toolchain-funcs
DESCRIPTION="A suite of utilities for programming Xilinx FPGAs, CPLDs, and EEPROMs"
HOMEPAGE="http://xc3sprog.sourceforge.net/"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS=""
IUSE="-ftd2xx"
DEPEND="!ftd2xx? ( dev-embedded/libftdi )
ftd2xx? ( dev-embedded/libftd2xx )
virtual/libusb:0"
RDEPEND="${DEPEND}"
src_prepare() {
sed -i -e '/if(EXISTS/a set(VERSION_STRING "Gentoo")' \
-e '/if(EXISTS/,/endif(EXISTS/d' \
-e 's/"Use WiringPi" ON/"Use WiringPi" OFF/' \
CMakeLists.txt || die
sed -i -e 's#usr/lib#opt/lib64#' FindlibFTD2XX.cmake || die
if [ $(gcc-major-version) -gt "10" ]; then
eapply "${FILESDIR}/${P}-gcc-11.patch"
fi
cmake-utils_src_prepare
default
}
src_configure() {
local mycmakeargs=(
-DLIBFTDI_INCLUDE_DIR=/usr/include/libftdi1
-DLIBFTDI_LIBRARIES=/usr/$(get_libdir)/libftdi1.so
-DUSE_FTD2XX="$(usex ftd2xx)"
)
cmake-utils_src_configure
}
src_install() {
cmake-utils_src_install
insinto /usr/share/${PF}/
doins -r bscan_spi
}