summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szuba <marecki@gentoo.org>2021-05-17 14:57:07 +0200
committerMarek Szuba <marecki@gentoo.org>2021-05-17 14:58:44 +0200
commit5c80fe109a9f39146e37ad4fa4bbfd809d72e4ce (patch)
tree0dc33d43694906f6b31b03ecb79c1d3f4d87bd90 /sys-apps/flashrom/flashrom-9999.ebuild
parentnet-mail/rss2email: 3.13.1 (diff)
downloadgentoo-5c80fe109a9f39146e37ad4fa4bbfd809d72e4ce.tar.gz
gentoo-5c80fe109a9f39146e37ad4fa4bbfd809d72e4ce.tar.bz2
gentoo-5c80fe109a9f39146e37ad4fa4bbfd809d72e4ce.zip
sys-apps/flashrom: migrate the live ebuild to Meson
Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'sys-apps/flashrom/flashrom-9999.ebuild')
-rw-r--r--sys-apps/flashrom/flashrom-9999.ebuild119
1 files changed, 59 insertions, 60 deletions
diff --git a/sys-apps/flashrom/flashrom-9999.ebuild b/sys-apps/flashrom/flashrom-9999.ebuild
index fe588c7916e0..293b7023f216 100644
--- a/sys-apps/flashrom/flashrom-9999.ebuild
+++ b/sys-apps/flashrom/flashrom-9999.ebuild
@@ -3,7 +3,8 @@
EAPI=7
-inherit toolchain-funcs
+inherit meson
+
if [[ ${PV} == "9999" ]] ; then
EGIT_REPO_URI="https://review.coreboot.org/flashrom.git"
inherit git-r3
@@ -19,12 +20,11 @@ HOMEPAGE="https://flashrom.org/"
LICENSE="GPL-2"
SLOT="0"
-# The defaults match the upstream Makefile.
-# Note: Do not list bitbang_spi as it is not a programmer; it's a backend used
-# by some other spi programmers.
+
+# The defaults match the upstream meson_options.txt.
IUSE_PROGRAMMERS="
atahpt
- +atapromise
+ atapromise
+atavia
+buspirate-spi
+ch341a-spi
@@ -59,11 +59,10 @@ IUSE_PROGRAMMERS="
+satamv
+satasii
+serprog
- stlinkv3-spi
+ +stlinkv3-spi
+usbblaster-spi
"
-
-IUSE="${IUSE_PROGRAMMERS} +internal-dmi static tools +wiki"
+IUSE="${IUSE_PROGRAMMERS} +internal-dmi tools +wiki"
LIB_DEPEND="
atahpt? ( sys-apps/pciutils[static-libs(+)] )
@@ -87,74 +86,74 @@ LIB_DEPEND="
nicrealtek? ( sys-apps/pciutils[static-libs(+)] )
ogp-spi? ( sys-apps/pciutils[static-libs(+)] )
pickit2-spi? ( virtual/libusb:0[static-libs(+)] )
+ raiden-debug-spi? ( virtual/libusb:0[static-libs(+)] )
rayer-spi? ( sys-apps/pciutils[static-libs(+)] )
satamv? ( sys-apps/pciutils[static-libs(+)] )
satasii? ( sys-apps/pciutils[static-libs(+)] )
stlinkv3-spi? ( virtual/libusb:1[static-libs(+)] )
usbblaster-spi? ( dev-embedded/libftdi:1=[static-libs(+)] )
"
-RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
+RDEPEND="${LIB_DEPEND//\[static-libs(+)]}"
DEPEND="${RDEPEND}
- static? ( ${LIB_DEPEND} )
sys-apps/diffutils"
-BDEPEND="virtual/pkgconfig"
RDEPEND+=" !internal-dmi? ( sys-apps/dmidecode )"
-_flashrom_enable() {
- local c="CONFIG_${2:-$(echo "$1" | tr '[:lower:]-' '[:upper:]_')}"
- args+=( "${c}=$(usex $1 yes no)" )
-}
-flashrom_enable() {
- local u
- for u ; do _flashrom_enable "${u}" ; done
-}
+DOCS=( README Documentation/ )
-src_compile() {
- # Help keep things in sync.
- local sprogs=$(echo $(
- grep -o 'CONFIG_[A-Z0-9_]*' flashrom.c | \
- LC_ALL=C sort -u | \
- sed 's:^CONFIG_::' | \
- tr '[:upper:]_' '[:lower:]-' | \
- grep -v ni845x-spi))
- local eprogs=$(echo ${IUSE_PROGRAMMERS} | sed -E 's/\B[-+]\b//g')
- if [[ ${sprogs} != "${eprogs}" ]] ; then
- eerror "The ebuild needs to be kept in sync."
- eerror "IUSE set to: ${eprogs}"
- eerror "flashrom.c : ${sprogs}"
- die "sync IUSE to the list of source programmers"
- fi
-
- # Turn USE flags into CONFIG_xxx settings.
- local args=()
- flashrom_enable ${eprogs}
- _flashrom_enable wiki PRINT_WIKI
- _flashrom_enable static STATIC
-
- # You have to specify at least one programmer, and if you specify more than
- # one programmer you have to include either dummy or internal in the list.
- # We pick dummy as the default because internal requires libpci.
- if ! use internal && ! use dummy ; then
- if [[ ${#args[@]} -ne 1 ]] ; then
- ewarn "You have to specify at least one programmer, and if you specify"
- ewarn "more than one programmer, you have to enable either dummy or"
- ewarn "internal as well. 'dummy' will be the default now."
- args+=( CONFIG_DUMMY=yes )
- fi
- fi
+PATCHES=(
+ "${FILESDIR}"/${PN}-9999_meson-fixes.patch
+)
- tc-export AR CC PKG_CONFIG RANLIB
- emake WARNERROR=no "${args[@]}" all libflashrom.a
+src_configure() {
+ local emesonargs=(
+ $(meson_use atahpt config_atahpt)
+ $(meson_use atapromise config_atapromise)
+ $(meson_use atavia config_atavia)
+ $(meson_use buspirate-spi config_buspirate_spi)
+ $(meson_use ch341a-spi config_ch341a_spi)
+ $(meson_use dediprog config_dediprog)
+ $(meson_use developerbox-spi config_developerbox_spi)
+ $(meson_use digilent-spi config_digilent_spi)
+ $(meson_use drkaiser config_drkaiser)
+ $(meson_use dummy config_dummy)
+ $(meson_use ene-lpc config_ene_lpc)
+ $(meson_use ft2232-spi config_ft2232_spi)
+ $(meson_use gfxnvidia config_gfxnvidia)
+ $(meson_use internal config_internal)
+ $(meson_use internal-dmi config_internal_dmi)
+ $(meson_use it8212 config_it8212)
+ $(meson_use jlink-spi config_jlink_spi)
+ $(meson_use linux-mtd config_linux_mtd)
+ $(meson_use linux-spi config_linux_spi)
+ $(meson_use lspcon-i2c-spi config_lspcon_i2c_spi)
+ $(meson_use mec1308 config_mec1308)
+ $(meson_use mstarddc-spi config_mstarddc_spi)
+ $(meson_use nic3com config_nic3com)
+ $(meson_use nicintel-eeprom config_nicintel_eeprom)
+ $(meson_use nicintel-spi config_nicintel_spi)
+ $(meson_use nicintel config_nicintel)
+ $(meson_use nicnatsemi config_nicnatsemi)
+ $(meson_use nicrealtek config_nicrealtek)
+ $(meson_use ogp-spi config_ogp_spi)
+ $(meson_use pickit2-spi config_pickit2_spi)
+ $(meson_use pony-spi config_pony_spi)
+ $(meson_use raiden-debug-spi config_raiden_debug_spi)
+ $(meson_use rayer-spi config_rayer_spi)
+ $(meson_use realtek-mst-i2c-spi config_realtek_mst_i2c_spi)
+ $(meson_use satamv config_satamv)
+ $(meson_use satasii config_satasii)
+ $(meson_use stlinkv3-spi config_stlinkv3_spi)
+ $(meson_use serprog config_serprog)
+ $(meson_use usbblaster-spi config_usbblaster_spi)
+ $(meson_use wiki print_wiki)
+ )
+ meson_src_configure
}
src_install() {
- dosbin flashrom
- doman flashrom.8
- dodoc README Documentation/*.txt
- dolib.a libflashrom.a
- doheader libflashrom.h
+ meson_src_install
if use tools; then
- dosbin util/ich_descriptors_tool/ich_descriptors_tool
+ dosbin "${BUILD_DIR}"/util/ich_descriptors_tool/ich_descriptors_tool
fi
}