[gentoo-commits] repo/gentoo:master commit in: sys-apps/flashrom/files/, sys-apps/flashrom/

2024-04-24 Thread Marek Szuba
commit: 04d0f920c4169a94c463633b4eac93fcb3e535d6
Author: Marek Szuba  gentoo  org>
AuthorDate: Wed Apr 24 13:18:14 2024 +
Commit: Marek Szuba  gentoo  org>
CommitDate: Wed Apr 24 13:27:30 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=04d0f920

sys-apps/flashrom: drop 1.2-r4, 1.3.0

Note that this drops flashrom on ppc64 to ~arch-only, owing to none of
the newer versions having been stabilised for this architecture for
almost a year.

Closes: https://bugs.gentoo.org/906737
Signed-off-by: Marek Szuba  gentoo.org>

 sys-apps/flashrom/Manifest |   1 -
 .../flashrom/files/flashrom-1.2_meson-fixes.patch  | 289 -
 .../files/flashrom-1.2_meson-install-manpage.patch |  43 ---
 sys-apps/flashrom/flashrom-1.2-r4.ebuild   | 145 ---
 sys-apps/flashrom/flashrom-1.3.0.ebuild| 128 -
 5 files changed, 606 deletions(-)

diff --git a/sys-apps/flashrom/Manifest b/sys-apps/flashrom/Manifest
index 20d3cca7fc80..9814b3053ebe 100644
--- a/sys-apps/flashrom/Manifest
+++ b/sys-apps/flashrom/Manifest
@@ -1,2 +1 @@
-DIST flashrom-v1.2.tar.bz2 366995 BLAKE2B 
091e01a91e12b486154ace334a5e74bccbb5f5311ad76e37f43a28167080757873d8c78b8f549d2e77eb984922c830895ba955b23eb6ee4fc24f1ffed259954b
 SHA512 
8e01395a54d0d1344bc55e7e4975f43bb8e59ebe83fb5f2766d14f76756d718b487254ce9a19ef4093aed04fb9d40fff5fe8f709b18c512f6e6fad894f83d7b8
 DIST flashrom-v1.3.0.tar.bz2 489782 BLAKE2B 
e6d2284d83171b003b434251f060fa44edf32ecfd3d397bd4ba39b74c6a0b5c9d1659b703dd6b632b63aa4bf27d08c8aeece72920199712c6a4ae160b2eb3a8a
 SHA512 
73b6e00bd3bc66c98d4ad53966a65b19d3d92f07d7b210d69e041d6f5788605b9791a9bf7aec0a52e13d19fcb62c4bdaf4bab9f805fc31468393ca313129a77b

diff --git a/sys-apps/flashrom/files/flashrom-1.2_meson-fixes.patch 
b/sys-apps/flashrom/files/flashrom-1.2_meson-fixes.patch
deleted file mode 100644
index bb185fae8223..
--- a/sys-apps/flashrom/files/flashrom-1.2_meson-fixes.patch
+++ /dev/null
@@ -1,289 +0,0 @@
 a/meson.build
-+++ b/meson.build
-@@ -2,7 +2,7 @@
-   version : run_command('util/getversion.sh', '-v').stdout().strip(),
-   license : 'GPL-2.0',
-   meson_version : '>=0.47.0',
--  default_options : ['warning_level=2', 'c_std=c99'],
-+  default_options : ['warning_level=2', 'c_std=gnu99'],
- )
- 
- # libtool versioning
-@@ -44,6 +44,7 @@
- config_gfxnvidia = get_option('config_gfxnvidia')
- config_internal = get_option('config_internal')
- config_it8212 = get_option('config_it8212')
-+config_jlink_spi = get_option('config_jlink_spi')
- config_linux_mtd = get_option('config_linux_mtd')
- config_linux_spi = get_option('config_linux_spi')
- config_mstarddc_spi = get_option('config_mstarddc_spi')
-@@ -67,6 +68,10 @@
- deps = []
- srcs = []
- 
-+config_bitbang_spi = false
-+need_libftdi = false
-+need_libpci = false
-+need_libusb = false
- need_raw_access = false
- need_serial = false
- 
-@@ -81,24 +86,24 @@
-   add_project_arguments('-DHAVE_UTSNAME=1', language : 'c')
- endif
- 
--# some programmers require libusb
--if get_option('usb')
--  srcs += 'usbdev.c'
--  deps += dependency('libusb-1.0')
--else
-+if get_option('no_libftdi_programmers')
-+  message('Disabling ALL libftdi-based programmers')
-+  config_ft2232_spi = false
-+  config_usbblaster_spi = false
-+endif
-+
-+if get_option('no_libusb_programmers')
-+  message('Disabling ALL libusb-based programmers')
-   config_ch341a_spi = false
-   config_dediprog = false
--  config_digilent_spi = false
-   config_developerbox_spi = false
-+  config_digilent_spi = false
-   config_pickit2_spi = false
-+  config_stlinkv3_spi = false
- endif
- 
--# some programmers require libpci
--if get_option('pciutils')
--  srcs += 'pcidev.c'
--  deps += dependency('libpci')
--  cargs += '-DNEED_PCI=1'
--else
-+if get_option('no_libpci_programmers')
-+  message('Disabling ALL libpci-based programmers')
-   config_atahpt = false
-   config_atapromise = false
-   config_atavia = false
-@@ -121,14 +126,20 @@
- # set defines for configured programmers
- if config_atahpt
-   srcs += 'atahpt.c'
-+  need_libpci = true
-+  need_raw_access = true
-   cargs += '-DCONFIG_ATAHPT=1'
- endif
- if config_atapromise
-   srcs += 'atapromise.c'
-+  need_libpci = true
-+  need_raw_access = true
-   cargs += '-DCONFIG_ATAPROMISE=1'
- endif
- if config_atavia
-   srcs += 'atavia.c'
-+  need_libpci = true
-+  need_raw_access = true
-   cargs += '-DCONFIG_ATAVIA=1'
- endif
- if config_buspirate_spi
-@@ -138,22 +149,28 @@
- endif
- if config_ch341a_spi
-   srcs += 'ch341a_spi.c'
-+  need_libusb = true
-   cargs += '-DCONFIG_CH341A_SPI=1'
- endif
- if config_dediprog
-   srcs += 'dediprog.c'
-+  need_libusb = true
-   cargs += '-DCONFIG_DEDIPROG=1'
- endif
- if config_developerbox_spi
-   srcs += 'developerbox_spi.c'
-+  need_libusb = true
-   cargs += '-DCONFIG_DEVELOPERBOX_SPI=1'
- endif
- if config_digilent_spi
-   srcs += 'digilent_spi.c'
-+  need_libusb = true
-   cargs += 

[gentoo-commits] repo/gentoo:master commit in: sys-apps/flashrom/files/, sys-apps/flashrom/

2023-06-12 Thread Marek Szuba
commit: bee3bcde7d86726cb8386d85a4c93b8d5df7aced
Author: Marek Szuba  gentoo  org>
AuthorDate: Mon Jun 12 23:20:43 2023 +
Commit: Marek Szuba  gentoo  org>
CommitDate: Mon Jun 12 23:22:14 2023 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bee3bcde

sys-apps/flashrom: backport possible "incomplete spi master definition" fix to 
1.3.0

Signed-off-by: Marek Szuba  gentoo.org>

 .../flashrom/files/flashrom-1.3.0_spi-master.patch | 285 +
 sys-apps/flashrom/flashrom-1.3.0-r1.ebuild | 132 ++
 2 files changed, 417 insertions(+)

diff --git a/sys-apps/flashrom/files/flashrom-1.3.0_spi-master.patch 
b/sys-apps/flashrom/files/flashrom-1.3.0_spi-master.patch
new file mode 100644
index ..72298f8cfca3
--- /dev/null
+++ b/sys-apps/flashrom/files/flashrom-1.3.0_spi-master.patch
@@ -0,0 +1,285 @@
+Backported upstream commit
+https://github.com/flashrom/flashrom/commit/e1f30bbce7a603d518ecec9d7e6885719f396719
+
+--- a/bitbang_spi.c
 b/bitbang_spi.c
+@@ -148,7 +148,6 @@
+   .write_256  = default_spi_write_256,
+   .write_aai  = default_spi_write_aai,
+   .shutdown   = bitbang_spi_shutdown,
+-  .probe_opcode   = default_spi_probe_opcode,
+ };
+ 
+ int register_spi_bitbang_master(const struct bitbang_spi_master *master, void 
*spi_data)
+--- a/buspirate_spi.c
 b/buspirate_spi.c
+@@ -183,7 +183,6 @@
+   .write_256  = default_spi_write_256,
+   .write_aai  = default_spi_write_aai,
+   .shutdown   = buspirate_spi_shutdown,
+-  .probe_opcode   = default_spi_probe_opcode,
+ };
+ 
+ static const struct buspirate_speeds spispeeds[] = {
+--- a/ch341a_spi.c
 b/ch341a_spi.c
+@@ -418,7 +418,6 @@
+   .write_256  = default_spi_write_256,
+   .write_aai  = default_spi_write_aai,
+   .shutdown   = ch341a_spi_shutdown,
+-  .probe_opcode   = default_spi_probe_opcode,
+ };
+ 
+ static int ch341a_spi_init(const struct programmer_cfg *cfg)
+--- a/dediprog.c
 b/dediprog.c
+@@ -1038,7 +1038,6 @@
+   .write_256  = dediprog_spi_write_256,
+   .write_aai  = dediprog_spi_write_aai,
+   .shutdown   = dediprog_shutdown,
+-  .probe_opcode   = default_spi_probe_opcode,
+ };
+ 
+ /*
+--- a/digilent_spi.c
 b/digilent_spi.c
+@@ -338,7 +338,6 @@
+   .write_256  = default_spi_write_256,
+   .write_aai  = default_spi_write_aai,
+   .shutdown   = digilent_spi_shutdown,
+-  .probe_opcode   = default_spi_probe_opcode,
+ };
+ 
+ static bool default_reset(struct libusb_device_handle *handle)
+--- a/dirtyjtag_spi.c
 b/dirtyjtag_spi.c
+@@ -198,7 +198,6 @@
+   .write_256  = default_spi_write_256,
+   .write_aai  = default_spi_write_aai,
+   .shutdown   = dirtyjtag_spi_shutdown,
+-  .probe_opcode   = default_spi_probe_opcode,
+ };
+ 
+ static int dirtyjtag_spi_init(const struct programmer_cfg *cfg)
+--- a/ft2232_spi.c
 b/ft2232_spi.c
+@@ -301,7 +301,6 @@
+   .write_256  = default_spi_write_256,
+   .write_aai  = default_spi_write_aai,
+   .shutdown   = ft2232_shutdown,
+-  .probe_opcode   = default_spi_probe_opcode,
+ };
+ 
+ /* Returns 0 upon success, a negative number upon errors. */
+--- a/include/chipdrivers.h
 b/include/chipdrivers.h
+@@ -26,6 +26,7 @@
+ int spi_aai_write(struct flashctx *flash, const uint8_t *buf, unsigned int 
start, unsigned int len);
+ int spi_chip_write_256(struct flashctx *flash, const uint8_t *buf, unsigned 
int start, unsigned int len);
+ int spi_chip_read(struct flashctx *flash, uint8_t *buf, unsigned int start, 
int unsigned len);
++bool spi_probe_opcode(const struct flashctx *flash, uint8_t opcode);
+ 
+ /* spi25.c */
+ int probe_spi_rdid(struct flashctx *flash);
+--- a/include/programmer.h
 b/include/programmer.h
+@@ -312,7 +312,7 @@
+   int (*write_256)(struct flashctx *flash, const uint8_t *buf, unsigned 
int start, unsigned int len);
+   int (*write_aai)(struct flashctx *flash, const uint8_t *buf, unsigned 
int start, unsigned int len);
+   int (*shutdown)(void *data);
+-  bool (*probe_opcode)(struct flashctx *flash, uint8_t opcode);
++  bool (*probe_opcode)(const struct flashctx *flash, uint8_t opcode); /* 
NULL func implies true. */
+   void *data;
+ };
+ 
+@@ -322,7 +322,6 @@
+ int default_spi_read(struct flashctx *flash, uint8_t *buf, unsigned int 
start, unsigned int len);
+ int default_spi_write_256(struct flashctx *flash, const uint8_t *buf, 
unsigned int start, unsigned int len);
+ int default_spi_write_aai(struct flashctx *flash, const uint8_t *buf, 
unsigned int start, unsigned int len);
+-bool default_spi_probe_opcode(struct flashctx *flash, uint8_t opcode);
+ int register_spi_master(const struct spi_master *mst, void *data);
+ 
+ /* The following enum is needed by ich_descriptor_tool and ich* code as well 
as in chipset_enable.c. */
+--- a/it87spi.c
 b/it87spi.c
+@@ -320,7 +320,6 

[gentoo-commits] repo/gentoo:master commit in: sys-apps/flashrom/files/, sys-apps/flashrom/

2022-03-11 Thread Marek Szuba
commit: f9226e226265bc83bfb9427deec51f167192
Author: Marek Szuba  gentoo  org>
AuthorDate: Fri Mar 11 16:00:52 2022 +
Commit: Marek Szuba  gentoo  org>
CommitDate: Fri Mar 11 16:40:25 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9226e22

sys-apps/flashrom: remove live ebuild

Live ebuilds are only useful if someone is interested in keeping
them functional. I am not, especially given how large a patch is
currently required for dependencies of Meson builds to be sane.

Closes: https://bugs.gentoo.org/834021
Signed-off-by: Marek Szuba  gentoo.org>

 .../flashrom/files/flashrom-_meson-fixes.patch | 281 -
 sys-apps/flashrom/flashrom-.ebuild | 159 
 sys-apps/flashrom/metadata.xml |   5 +-
 3 files changed, 1 insertion(+), 444 deletions(-)

diff --git a/sys-apps/flashrom/files/flashrom-_meson-fixes.patch 
b/sys-apps/flashrom/files/flashrom-_meson-fixes.patch
deleted file mode 100644
index 7651585f4f6a..
--- a/sys-apps/flashrom/files/flashrom-_meson-fixes.patch
+++ /dev/null
@@ -1,281 +0,0 @@
 a/meson.build
-+++ b/meson.build
-@@ -2,7 +2,7 @@ project('flashromutils', 'c',
-   version : run_command('util/getversion.sh', '-v').stdout().strip(),
-   license : 'GPL-2.0',
-   meson_version : '>=0.50.0',
--  default_options : ['warning_level=2', 'c_std=c99'],
-+  default_options : ['warning_level=2', 'c_std=gnu99'],
- )
- 
- # libtool versioning
-@@ -105,6 +105,10 @@ cargs = []
- deps = []
- srcs = []
- 
-+config_bitbang_spi = false
-+need_libftdi = false
-+need_libpci = false
-+need_libusb = false
- need_raw_access = false
- need_serial = false
- 
-@@ -119,27 +123,25 @@ if cc.check_header('sys/utsname.h')
-   add_project_arguments('-DHAVE_UTSNAME=1', language : 'c')
- endif
- 
--# some programmers require libusb
--if get_option('usb')
--  srcs += 'usbdev.c'
--  srcs += 'usb_device.c'
--  deps += dependency('libusb-1.0')
--else
-+if get_option('no_libftdi_programmers')
-+  message('Disabling ALL libftdi-based programmers')
-+  config_ft2232_spi = false
-+  config_usbblaster_spi = false
-+endif
-+
-+if get_option('no_libusb_programmers')
-+  message('Disabling ALL libusb-based programmers')
-   config_ch341a_spi = false
-   config_dediprog = false
-   config_digilent_spi = false
-   config_developerbox_spi = false
-   config_pickit2_spi = false
-   config_raiden_debug_spi = false
-+  config_stlinkv3_spi = false
- endif
- 
--# some programmers require libpci
--if get_option('pciutils')
--  srcs += 'pcidev.c'
--  deps += dependency('libpci')
--  need_raw_access = true
--  cargs += '-DNEED_PCI=1'
--else
-+if get_option('no_libpci_programmers')
-+  message('Disabling ALL libpci-based programmers')
-   config_atahpt = false
-   config_atapromise = false
-   config_atavia = false
-@@ -161,14 +163,17 @@ endif
- # set defines for configured programmers
- if config_atahpt
-   srcs += 'atahpt.c'
-+  need_libpci = true
-   cargs += '-DCONFIG_ATAHPT=1'
- endif
- if config_atapromise
-   srcs += 'atapromise.c'
-+  need_libpci = true
-   cargs += '-DCONFIG_ATAPROMISE=1'
- endif
- if config_atavia
-   srcs += 'atavia.c'
-+  need_libpci = true
-   cargs += '-DCONFIG_ATAVIA=1'
- endif
- if config_buspirate_spi
-@@ -178,18 +183,22 @@ if config_buspirate_spi
- endif
- if config_ch341a_spi
-   srcs += 'ch341a_spi.c'
-+  need_libusb = true
-   cargs += '-DCONFIG_CH341A_SPI=1'
- endif
- if config_dediprog
-   srcs += 'dediprog.c'
-+  need_libusb = true
-   cargs += '-DCONFIG_DEDIPROG=1'
- endif
- if config_developerbox_spi
-   srcs += 'developerbox_spi.c'
-+  need_libusb = true
-   cargs += '-DCONFIG_DEVELOPERBOX_SPI=1'
- endif
- if config_digilent_spi
-   srcs += 'digilent_spi.c'
-+  need_libusb = true
-   cargs += '-DCONFIG_DIGILENT_SPI=1'
- endif
- if config_jlink_spi
-@@ -199,6 +208,7 @@ if config_jlink_spi
- endif
- if config_drkaiser
-   srcs += 'drkaiser.c'
-+  need_libpci = true
-   cargs += '-DCONFIG_DRKAISER=1'
- endif
- if config_dummy
-@@ -207,16 +217,18 @@ if config_dummy
- endif
- if config_ft2232_spi
-   srcs += 'ft2232_spi.c'
-+  need_libftdi = true
-   cargs += '-DCONFIG_FT2232_SPI=1'
--  deps += dependency('libftdi1')
-   cargs += '-DHAVE_FT232H=1'
- endif
- if config_gfxnvidia
-   srcs += 'gfxnvidia.c'
-+  need_libpci = true
-   cargs += '-DCONFIG_GFXNVIDIA=1'
- endif
- if config_raiden_debug_spi
-   srcs += 'raiden_debug_spi.c'
-+  need_libusb = true
-   cargs += '-DCONFIG_RAIDEN_DEBUG_SPI=1'
- endif
- if config_internal
-@@ -235,6 +247,7 @@ if config_internal
- srcs += 'sb600spi.c'
- srcs += 'wbsio_spi.c'
-   endif
-+  need_libpci = true
-   config_bitbang_spi = true
-   cargs += '-DCONFIG_INTERNAL=1'
-   if get_option('config_internal_dmi')
-@@ -244,6 +257,7 @@ if config_internal
- endif
- if config_it8212
-   srcs += 'it8212.c'
-+  need_libpci = true
-   cargs += '-DCONFIG_IT8212=1'
- endif
- if config_linux_mtd
-@@ -260,36 +274,44 @@ if config_mstarddc_spi
- 

[gentoo-commits] repo/gentoo:master commit in: sys-apps/flashrom/files/, sys-apps/flashrom/

2021-11-16 Thread Marek Szuba
commit: 79dea382ce9cc55c44b2f9d8d256f1615112eb5c
Author: Marek Szuba  gentoo  org>
AuthorDate: Tue Nov 16 15:05:46 2021 +
Commit: Marek Szuba  gentoo  org>
CommitDate: Tue Nov 16 15:05:46 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79dea382

sys-apps/flashrom-: do not auto-build tests if cmocka is present

Signed-off-by: Marek Szuba  gentoo.org>

 .../flashrom/files/flashrom-_meson-fixes.patch | 54 --
 sys-apps/flashrom/flashrom-.ebuild |  2 +-
 2 files changed, 41 insertions(+), 15 deletions(-)

diff --git a/sys-apps/flashrom/files/flashrom-_meson-fixes.patch 
b/sys-apps/flashrom/files/flashrom-_meson-fixes.patch
index 63c2e2ef7553..7651585f4f6a 100644
--- a/sys-apps/flashrom/files/flashrom-_meson-fixes.patch
+++ b/sys-apps/flashrom/files/flashrom-_meson-fixes.patch
@@ -9,7 +9,7 @@
  )
  
  # libtool versioning
-@@ -74,6 +74,10 @@ cargs = []
+@@ -105,6 +105,10 @@ cargs = []
  deps = []
  srcs = []
  
@@ -20,7 +20,7 @@
  need_raw_access = false
  need_serial = false
  
-@@ -88,27 +92,25 @@ if cc.check_header('sys/utsname.h')
+@@ -119,27 +123,25 @@ if cc.check_header('sys/utsname.h')
add_project_arguments('-DHAVE_UTSNAME=1', language : 'c')
  endif
  
@@ -59,7 +59,7 @@
config_atahpt = false
config_atapromise = false
config_atavia = false
-@@ -130,14 +132,17 @@ endif
+@@ -161,14 +163,17 @@ endif
  # set defines for configured programmers
  if config_atahpt
srcs += 'atahpt.c'
@@ -77,7 +77,7 @@
cargs += '-DCONFIG_ATAVIA=1'
  endif
  if config_buspirate_spi
-@@ -147,18 +152,22 @@ if config_buspirate_spi
+@@ -178,18 +183,22 @@ if config_buspirate_spi
  endif
  if config_ch341a_spi
srcs += 'ch341a_spi.c'
@@ -100,7 +100,7 @@
cargs += '-DCONFIG_DIGILENT_SPI=1'
  endif
  if config_jlink_spi
-@@ -168,6 +177,7 @@ if config_jlink_spi
+@@ -199,6 +208,7 @@ if config_jlink_spi
  endif
  if config_drkaiser
srcs += 'drkaiser.c'
@@ -108,7 +108,7 @@
cargs += '-DCONFIG_DRKAISER=1'
  endif
  if config_dummy
-@@ -176,16 +186,18 @@ if config_dummy
+@@ -207,16 +217,18 @@ if config_dummy
  endif
  if config_ft2232_spi
srcs += 'ft2232_spi.c'
@@ -128,7 +128,7 @@
cargs += '-DCONFIG_RAIDEN_DEBUG_SPI=1'
  endif
  if config_internal
-@@ -204,6 +216,7 @@ if config_internal
+@@ -235,6 +247,7 @@ if config_internal
  srcs += 'sb600spi.c'
  srcs += 'wbsio_spi.c'
endif
@@ -136,7 +136,7 @@
config_bitbang_spi = true
cargs += '-DCONFIG_INTERNAL=1'
if get_option('config_internal_dmi')
-@@ -217,6 +230,7 @@ if config_ene_lpc
+@@ -244,6 +257,7 @@ if config_internal
  endif
  if config_it8212
srcs += 'it8212.c'
@@ -144,7 +144,7 @@
cargs += '-DCONFIG_IT8212=1'
  endif
  if config_linux_mtd
-@@ -237,36 +251,44 @@ if config_mstarddc_spi
+@@ -260,36 +274,44 @@ if config_mstarddc_spi
  endif
  if config_nic3com
srcs += 'nic3com.c'
@@ -189,7 +189,7 @@
cargs += '-DCONFIG_PICKIT2_SPI=1'
  endif
  if config_pony_spi
-@@ -283,10 +305,12 @@ if config_rayer_spi
+@@ -306,10 +328,12 @@ if config_rayer_spi
  endif
  if config_satamv
srcs += 'satamv.c'
@@ -202,7 +202,7 @@
cargs += '-DCONFIG_SATASII=1'
  endif
  if config_serprog
-@@ -296,10 +320,12 @@ if config_serprog
+@@ -319,10 +343,12 @@ if config_serprog
  endif
  if config_usbblaster_spi
srcs += 'usbblaster_spi.c'
@@ -215,8 +215,8 @@
cargs += '-DCONFIG_STLINKV3_SPI=1'
  endif
  if config_lspcon_i2c_spi
-@@ -322,6 +348,26 @@ if host_machine.system() == 'linux'
-   cargs += '-DCONFIG_I2C_SUPPORT=1'
+@@ -344,6 +370,26 @@ if host_machine.system() == 'linux'
+   srcs += 'i2c_helper_linux.c'
  endif
  
 +# some programmers require libftdi
@@ -242,14 +242,40 @@
  # raw memory, MSR or PCI port I/O access
  if need_raw_access
srcs += 'hwaccess.c'
+@@ -493,10 +539,12 @@ executable(
+ subdir('util')
+ 
+ # unit-test framework
++if get_option('build_tests')
++
+ cmocka_dep = dependency(
+   'cmocka',
+   fallback: ['cmocka', 'cmocka_dep'],
+-  required: false
++  required: true
+ )
+ flashrom_test_dep = declare_dependency(
+   include_directories : include_directories('.'),
+@@ -519,3 +567,5 @@ flashrom_test_dep = declare_dependency(
+ if cmocka_dep.found()
+   subdir('tests')
+ endif
++
++endif
 --- a/meson_options.txt
 +++ b/meson_options.txt
-@@ -1,5 +1,6 @@
+@@ -1,9 +1,12 @@
 -option('pciutils', type : 'boolean', value : true, description : 'use 
pciutils')
 -option('usb', type : 'boolean', value : true, description : 'use libusb1')
 +option('no_libftdi_programmers', type : 'boolean', value : false, description 
: 'disable all programmers depending on libftdi')
 +option('no_libpci_programmers', type : 'boolean', value : false, description 
: 'disable all programmers depending on libpci')
 +option('no_libusb_programmers', type : 'boolean', value : false, description 
: 'disable all programmers depending on libusb')
  option('print_wiki', type : 'boolean', value : true,  description : 'Print 
Wiki')
+ 

[gentoo-commits] repo/gentoo:master commit in: sys-apps/flashrom/files/, sys-apps/flashrom/

2021-05-17 Thread Marek Szuba
commit: 5c80fe109a9f39146e37ad4fa4bbfd809d72e4ce
Author: Marek Szuba  gentoo  org>
AuthorDate: Mon May 17 12:57:07 2021 +
Commit: Marek Szuba  gentoo  org>
CommitDate: Mon May 17 12:58:44 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c80fe10

sys-apps/flashrom: migrate the live ebuild to Meson

Signed-off-by: Marek Szuba  gentoo.org>

 .../flashrom/files/flashrom-_meson-fixes.patch | 263 +
 sys-apps/flashrom/flashrom-.ebuild | 119 +-
 2 files changed, 322 insertions(+), 60 deletions(-)

diff --git a/sys-apps/flashrom/files/flashrom-_meson-fixes.patch 
b/sys-apps/flashrom/files/flashrom-_meson-fixes.patch
new file mode 100644
index 000..64d2cebff54
--- /dev/null
+++ b/sys-apps/flashrom/files/flashrom-_meson-fixes.patch
@@ -0,0 +1,263 @@
+--- a/meson.build
 b/meson.build
+@@ -2,7 +2,7 @@ project('flashromutils', 'c',
+   version : run_command('util/getversion.sh', '-v').stdout().strip(),
+   license : 'GPL-2.0',
+   meson_version : '>=0.50.0',
+-  default_options : ['warning_level=2', 'c_std=c99'],
++  default_options : ['warning_level=2', 'c_std=gnu99'],
+ )
+ 
+ # libtool versioning
+@@ -74,6 +74,10 @@ cargs = []
+ deps = []
+ srcs = []
+ 
++config_bitbang_spi = false
++need_libftdi = false
++need_libpci = false
++need_libusb = false
+ need_raw_access = false
+ need_serial = false
+ 
+@@ -88,27 +92,25 @@ if cc.check_header('sys/utsname.h')
+   add_project_arguments('-DHAVE_UTSNAME=1', language : 'c')
+ endif
+ 
+-# some programmers require libusb
+-if get_option('usb')
+-  srcs += 'usbdev.c'
+-  srcs += 'usb_device.c'
+-  deps += dependency('libusb-1.0')
+-else
++if get_option('no_libftdi_programmers')
++  message('Disabling ALL libftdi-based programmers')
++  config_ft2232_spi = false
++  config_usbblaster_spi = false
++endif
++
++if get_option('no_libusb_programmers')
++  message('Disabling ALL libusb-based programmers')
+   config_ch341a_spi = false
+   config_dediprog = false
+   config_digilent_spi = false
+   config_developerbox_spi = false
+   config_pickit2_spi = false
+   config_raiden_debug_spi = false
++  config_stlinkv3_spi = false
+ endif
+ 
+-# some programmers require libpci
+-if get_option('pciutils')
+-  srcs += 'pcidev.c'
+-  deps += dependency('libpci')
+-  need_raw_access = true
+-  cargs += '-DNEED_PCI=1'
+-else
++if get_option('no_libpci_programmers')
++  message('Disabling ALL libpci-based programmers')
+   config_atahpt = false
+   config_atapromise = false
+   config_atavia = false
+@@ -130,14 +132,17 @@ endif
+ # set defines for configured programmers
+ if config_atahpt
+   srcs += 'atahpt.c'
++  need_libpci = true
+   cargs += '-DCONFIG_ATAHPT=1'
+ endif
+ if config_atapromise
+   srcs += 'atapromise.c'
++  need_libpci = true
+   cargs += '-DCONFIG_ATAPROMISE=1'
+ endif
+ if config_atavia
+   srcs += 'atavia.c'
++  need_libpci = true
+   cargs += '-DCONFIG_ATAVIA=1'
+ endif
+ if config_buspirate_spi
+@@ -147,18 +152,22 @@ if config_buspirate_spi
+ endif
+ if config_ch341a_spi
+   srcs += 'ch341a_spi.c'
++  need_libusb = true
+   cargs += '-DCONFIG_CH341A_SPI=1'
+ endif
+ if config_dediprog
+   srcs += 'dediprog.c'
++  need_libusb = true
+   cargs += '-DCONFIG_DEDIPROG=1'
+ endif
+ if config_developerbox_spi
+   srcs += 'developerbox_spi.c'
++  need_libusb = true
+   cargs += '-DCONFIG_DEVELOPERBOX_SPI=1'
+ endif
+ if config_digilent_spi
+   srcs += 'digilent_spi.c'
++  need_libusb = true
+   cargs += '-DCONFIG_DIGILENT_SPI=1'
+ endif
+ if config_jlink_spi
+@@ -168,6 +177,7 @@ if config_jlink_spi
+ endif
+ if config_drkaiser
+   srcs += 'drkaiser.c'
++  need_libpci = true
+   cargs += '-DCONFIG_DRKAISER=1'
+ endif
+ if config_dummy
+@@ -176,16 +186,18 @@ if config_dummy
+ endif
+ if config_ft2232_spi
+   srcs += 'ft2232_spi.c'
++  need_libftdi = true
+   cargs += '-DCONFIG_FT2232_SPI=1'
+-  deps += dependency('libftdi1')
+   cargs += '-DHAVE_FT232H=1'
+ endif
+ if config_gfxnvidia
+   srcs += 'gfxnvidia.c'
++  need_libpci = true
+   cargs += '-DCONFIG_GFXNVIDIA=1'
+ endif
+ if config_raiden_debug_spi
+   srcs += 'raiden_debug_spi.c'
++  need_libusb = true
+   cargs += '-DCONFIG_RAIDEN_DEBUG_SPI=1'
+ endif
+ if config_internal
+@@ -204,6 +216,7 @@ if config_internal
+ srcs += 'sb600spi.c'
+ srcs += 'wbsio_spi.c'
+   endif
++  need_libpci = true
+   config_bitbang_spi = true
+   cargs += '-DCONFIG_INTERNAL=1'
+   if get_option('config_internal_dmi')
+@@ -217,6 +230,7 @@ if config_ene_lpc
+ endif
+ if config_it8212
+   srcs += 'it8212.c'
++  need_libpci = true
+   cargs += '-DCONFIG_IT8212=1'
+ endif
+ if config_linux_mtd
+@@ -237,36 +251,44 @@ if config_mstarddc_spi
+ endif
+ if config_nic3com
+   srcs += 'nic3com.c'
++  need_libpci = true
+   cargs += '-DCONFIG_NIC3COM=1'
+ endif
+ if config_nicintel
+   srcs += 'nicintel.c'
++  need_libpci = true
+   cargs += '-DCONFIG_NICINTEL=1'
+ endif
+ if config_nicintel_eeprom
+   srcs += 'nicintel_eeprom.c'
++  

[gentoo-commits] repo/gentoo:master commit in: sys-apps/flashrom/files/, sys-apps/flashrom/

2020-11-09 Thread Marek Szuba
commit: 0202348e1e89c3ee6459dc8f6dafca5a2cedaa29
Author: Marek Szuba  gentoo  org>
AuthorDate: Mon Nov  9 17:31:56 2020 +
Commit: Marek Szuba  gentoo  org>
CommitDate: Mon Nov  9 17:41:56 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0202348e

sys-apps/flashrom-1.2-r3: install the man page

Signed-off-by: Marek Szuba  gentoo.org>

 .../files/flashrom-1.2_meson-install-manpage.patch | 43 ++
 sys-apps/flashrom/flashrom-1.2-r3.ebuild   |  1 +
 2 files changed, 44 insertions(+)

diff --git a/sys-apps/flashrom/files/flashrom-1.2_meson-install-manpage.patch 
b/sys-apps/flashrom/files/flashrom-1.2_meson-install-manpage.patch
new file mode 100644
index 000..8783cfeefa7
--- /dev/null
+++ b/sys-apps/flashrom/files/flashrom-1.2_meson-install-manpage.patch
@@ -0,0 +1,43 @@
+This is essentially the upstream commit 
7aea04f7099ad4dde7b1f5900b54ef603eadf25e,
+modified so that MAN_DATE is set to simply '-' - the commit generates
+the date using the script util/getrevision.sh, which is not included in
+release tarballs.
+
+--- a/flashrom.8.tmpl
 b/flashrom.8.tmpl
+@@ -40,7 +40,7 @@
+ .\}
+ .  \}
+ ..
+-.TH FLASHROM 8 "" ""
++.TH FLASHROM 8 "@MAN_DATE@" "@VERSION@" "@MAN_DATE@"
+ .SH NAME
+ flashrom \- detect, read, write, verify and erase flash chips
+ .SH SYNOPSIS
+--- a/meson.build
 b/meson.build
+@@ -321,6 +321,7 @@ endif
+ prefix = get_option('prefix')
+ sbindir = join_paths(prefix, get_option('sbindir'))
+ libdir = join_paths(prefix, get_option('libdir'))
++mandir = join_paths(prefix, get_option('mandir'))
+ 
+ install_headers([
+ 'libflashrom.h',
+@@ -394,6 +395,16 @@ pkgg.generate(
+   description : 'library to interact with flashrom',
+ )
+ 
++conf.set('VERSION', version)
++conf.set('MAN_DATE', '-')
++configure_file(
++  input : 'flashrom.8.tmpl',
++  output : 'flashrom.8',
++  configuration : conf,
++  install: true,
++  install_dir: join_paths(mandir, 'man8'),
++)
++
+ flashrom_dep = declare_dependency(
+   link_with : flashrom,
+   include_directories : include_directories('.'),

diff --git a/sys-apps/flashrom/flashrom-1.2-r3.ebuild 
b/sys-apps/flashrom/flashrom-1.2-r3.ebuild
index 7d87b514771..732c1ed8d28 100644
--- a/sys-apps/flashrom/flashrom-1.2-r3.ebuild
+++ b/sys-apps/flashrom/flashrom-1.2-r3.ebuild
@@ -96,6 +96,7 @@ DOCS=( README Documentation/ )
 
 PATCHES=(
"${FILESDIR}"/${PN}-1.2_meson-fixes.patch
+   "${FILESDIR}"/${PN}-1.2_meson-install-manpage.patch
 )
 
 src_configure() {



[gentoo-commits] repo/gentoo:master commit in: sys-apps/flashrom/files/, sys-apps/flashrom/

2020-11-09 Thread Marek Szuba
commit: b053316c6417ee2313bf324020ef4de56ec3c333
Author: Marek Szuba  gentoo  org>
AuthorDate: Tue Apr 28 09:31:40 2020 +
Commit: Marek Szuba  gentoo  org>
CommitDate: Mon Nov  9 16:18:42 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b053316c

sys-apps/flashrom: reintroduce a meson-based 1.2 ebuild

Still doesn't work with most, if not all, non-x86 arches - but if the
alternative is messing with the upstream Makefile in order to address
problems such as Bug #753383, I would rather work on fixing Meson
scripts.

Signed-off-by: Marek Szuba  gentoo.org>

 .../flashrom/files/flashrom-1.2_meson-fixes.patch  | 263 +
 sys-apps/flashrom/flashrom-1.2-r3.ebuild   | 147 
 2 files changed, 410 insertions(+)

diff --git a/sys-apps/flashrom/files/flashrom-1.2_meson-fixes.patch 
b/sys-apps/flashrom/files/flashrom-1.2_meson-fixes.patch
new file mode 100644
index 000..84dec173676
--- /dev/null
+++ b/sys-apps/flashrom/files/flashrom-1.2_meson-fixes.patch
@@ -0,0 +1,263 @@
+--- a/meson.build
 b/meson.build
+@@ -44,6 +44,7 @@
+ config_gfxnvidia = get_option('config_gfxnvidia')
+ config_internal = get_option('config_internal')
+ config_it8212 = get_option('config_it8212')
++config_jlink_spi = get_option('config_jlink_spi')
+ config_linux_mtd = get_option('config_linux_mtd')
+ config_linux_spi = get_option('config_linux_spi')
+ config_mstarddc_spi = get_option('config_mstarddc_spi')
+@@ -67,6 +68,9 @@
+ deps = []
+ srcs = []
+ 
++need_libftdi = false
++need_libpci = false
++need_libusb = false
+ need_raw_access = false
+ need_serial = false
+ 
+@@ -81,24 +85,24 @@
+   add_project_arguments('-DHAVE_UTSNAME=1', language : 'c')
+ endif
+ 
+-# some programmers require libusb
+-if get_option('usb')
+-  srcs += 'usbdev.c'
+-  deps += dependency('libusb-1.0')
+-else
++if get_option('no_libftdi_programmers')
++  message('Disabling ALL libftdi-based programmers')
++  config_ft2232_spi = false
++  config_usbblaster_spi = false
++endif
++
++if get_option('no_libusb_programmers')
++  message('Disabling ALL libusb-based programmers')
+   config_ch341a_spi = false
+   config_dediprog = false
+-  config_digilent_spi = false
+   config_developerbox_spi = false
++  config_digilent_spi = false
+   config_pickit2_spi = false
++  config_stlinkv3_spi = false
+ endif
+ 
+-# some programmers require libpci
+-if get_option('pciutils')
+-  srcs += 'pcidev.c'
+-  deps += dependency('libpci')
+-  cargs += '-DNEED_PCI=1'
+-else
++if get_option('no_libpci_programmers')
++  message('Disabling ALL libpci-based programmers')
+   config_atahpt = false
+   config_atapromise = false
+   config_atavia = false
+@@ -121,14 +125,17 @@
+ # set defines for configured programmers
+ if config_atahpt
+   srcs += 'atahpt.c'
++  need_libpci = true
+   cargs += '-DCONFIG_ATAHPT=1'
+ endif
+ if config_atapromise
+   srcs += 'atapromise.c'
++  need_libpci = true
+   cargs += '-DCONFIG_ATAPROMISE=1'
+ endif
+ if config_atavia
+   srcs += 'atavia.c'
++  need_libpci = true
+   cargs += '-DCONFIG_ATAVIA=1'
+ endif
+ if config_buspirate_spi
+@@ -138,22 +145,27 @@
+ endif
+ if config_ch341a_spi
+   srcs += 'ch341a_spi.c'
++  need_libusb = true
+   cargs += '-DCONFIG_CH341A_SPI=1'
+ endif
+ if config_dediprog
+   srcs += 'dediprog.c'
++  need_libusb = true
+   cargs += '-DCONFIG_DEDIPROG=1'
+ endif
+ if config_developerbox_spi
+   srcs += 'developerbox_spi.c'
++  need_libusb = true
+   cargs += '-DCONFIG_DEVELOPERBOX_SPI=1'
+ endif
+ if config_digilent_spi
+   srcs += 'digilent_spi.c'
++  need_libusb = true
+   cargs += '-DCONFIG_DIGILENT_SPI=1'
+ endif
+ if config_drkaiser
+   srcs += 'drkaiser.c'
++  need_libpci = true
+   cargs += '-DCONFIG_DRKAISER=1'
+ endif
+ if config_dummy
+@@ -162,12 +174,13 @@
+ endif
+ if config_ft2232_spi
+   srcs += 'ft2232_spi.c'
++  need_libftdi = true
+   cargs += '-DCONFIG_FT2232_SPI=1'
+-  deps += dependency('libftdi1')
+   cargs += '-DHAVE_FT232H=1'
+ endif
+ if config_gfxnvidia
+   srcs += 'gfxnvidia.c'
++  need_libpci = true
+   cargs += '-DCONFIG_GFXNVIDIA=1'
+ endif
+ if config_internal
+@@ -186,6 +199,7 @@
+ srcs += 'sb600spi.c'
+ srcs += 'wbsio_spi.c'
+   endif
++  need_libpci = true
+   config_bitbang_spi = true
+   cargs += '-DCONFIG_INTERNAL=1'
+   if get_option('config_internal_dmi')
+@@ -195,6 +209,7 @@
+ endif
+ if config_it8212
+   srcs += 'it8212.c'
++  need_libpci = true
+   cargs += '-DCONFIG_IT8212=1'
+ endif
+ if config_linux_mtd
+@@ -211,36 +226,44 @@
+ endif
+ if config_nic3com
+   srcs += 'nic3com.c'
++  need_libpci = true
+   cargs += '-DCONFIG_NIC3COM=1'
+ endif
+ if config_nicintel
+   srcs += 'nicintel.c'
++  need_libpci = true
+   cargs += '-DCONFIG_NICINTEL=1'
+ endif
+ if config_nicintel_eeprom
+   srcs += 'nicintel_eeprom.c'
++  need_libpci = true
+   cargs += '-DCONFIG_NICINTEL_EEPROM=1'
+ endif
+ if config_nicintel_spi
+   srcs += 'nicintel_spi.c'
++  need_libpci = true
+   config_bitbang_spi = true
+   cargs += 

[gentoo-commits] repo/gentoo:master commit in: sys-apps/flashrom/files/, sys-apps/flashrom/

2020-05-02 Thread Marek Szuba
commit: 36674d2c08d09829f2527026517c4d015ec5efb6
Author: Marek Szuba  gentoo  org>
AuthorDate: Sat May  2 16:34:35 2020 +
Commit: Marek Szuba  gentoo  org>
CommitDate: Sat May  2 16:36:46 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=36674d2c

Revert "sys-apps/flashrom: switch to building with meson"

Turns out that not only do upstream meson scripts require patching to
handle all programmers flashrom supports, they also only appear to work
on amd64. Sigh.

This reverts commit b5a312d32873362067980b2a02886a4b79d08ca6.

Bug: https://bugs.gentoo.org/720210
Signed-off-by: Marek Szuba  gentoo.org>

 .../flashrom/files/flashrom-1.2_meson-fixes.patch  | 263 -
 sys-apps/flashrom/flashrom-1.2-r2.ebuild   | 147 
 2 files changed, 410 deletions(-)

diff --git a/sys-apps/flashrom/files/flashrom-1.2_meson-fixes.patch 
b/sys-apps/flashrom/files/flashrom-1.2_meson-fixes.patch
deleted file mode 100644
index 84dec173676..000
--- a/sys-apps/flashrom/files/flashrom-1.2_meson-fixes.patch
+++ /dev/null
@@ -1,263 +0,0 @@
 a/meson.build
-+++ b/meson.build
-@@ -44,6 +44,7 @@
- config_gfxnvidia = get_option('config_gfxnvidia')
- config_internal = get_option('config_internal')
- config_it8212 = get_option('config_it8212')
-+config_jlink_spi = get_option('config_jlink_spi')
- config_linux_mtd = get_option('config_linux_mtd')
- config_linux_spi = get_option('config_linux_spi')
- config_mstarddc_spi = get_option('config_mstarddc_spi')
-@@ -67,6 +68,9 @@
- deps = []
- srcs = []
- 
-+need_libftdi = false
-+need_libpci = false
-+need_libusb = false
- need_raw_access = false
- need_serial = false
- 
-@@ -81,24 +85,24 @@
-   add_project_arguments('-DHAVE_UTSNAME=1', language : 'c')
- endif
- 
--# some programmers require libusb
--if get_option('usb')
--  srcs += 'usbdev.c'
--  deps += dependency('libusb-1.0')
--else
-+if get_option('no_libftdi_programmers')
-+  message('Disabling ALL libftdi-based programmers')
-+  config_ft2232_spi = false
-+  config_usbblaster_spi = false
-+endif
-+
-+if get_option('no_libusb_programmers')
-+  message('Disabling ALL libusb-based programmers')
-   config_ch341a_spi = false
-   config_dediprog = false
--  config_digilent_spi = false
-   config_developerbox_spi = false
-+  config_digilent_spi = false
-   config_pickit2_spi = false
-+  config_stlinkv3_spi = false
- endif
- 
--# some programmers require libpci
--if get_option('pciutils')
--  srcs += 'pcidev.c'
--  deps += dependency('libpci')
--  cargs += '-DNEED_PCI=1'
--else
-+if get_option('no_libpci_programmers')
-+  message('Disabling ALL libpci-based programmers')
-   config_atahpt = false
-   config_atapromise = false
-   config_atavia = false
-@@ -121,14 +125,17 @@
- # set defines for configured programmers
- if config_atahpt
-   srcs += 'atahpt.c'
-+  need_libpci = true
-   cargs += '-DCONFIG_ATAHPT=1'
- endif
- if config_atapromise
-   srcs += 'atapromise.c'
-+  need_libpci = true
-   cargs += '-DCONFIG_ATAPROMISE=1'
- endif
- if config_atavia
-   srcs += 'atavia.c'
-+  need_libpci = true
-   cargs += '-DCONFIG_ATAVIA=1'
- endif
- if config_buspirate_spi
-@@ -138,22 +145,27 @@
- endif
- if config_ch341a_spi
-   srcs += 'ch341a_spi.c'
-+  need_libusb = true
-   cargs += '-DCONFIG_CH341A_SPI=1'
- endif
- if config_dediprog
-   srcs += 'dediprog.c'
-+  need_libusb = true
-   cargs += '-DCONFIG_DEDIPROG=1'
- endif
- if config_developerbox_spi
-   srcs += 'developerbox_spi.c'
-+  need_libusb = true
-   cargs += '-DCONFIG_DEVELOPERBOX_SPI=1'
- endif
- if config_digilent_spi
-   srcs += 'digilent_spi.c'
-+  need_libusb = true
-   cargs += '-DCONFIG_DIGILENT_SPI=1'
- endif
- if config_drkaiser
-   srcs += 'drkaiser.c'
-+  need_libpci = true
-   cargs += '-DCONFIG_DRKAISER=1'
- endif
- if config_dummy
-@@ -162,12 +174,13 @@
- endif
- if config_ft2232_spi
-   srcs += 'ft2232_spi.c'
-+  need_libftdi = true
-   cargs += '-DCONFIG_FT2232_SPI=1'
--  deps += dependency('libftdi1')
-   cargs += '-DHAVE_FT232H=1'
- endif
- if config_gfxnvidia
-   srcs += 'gfxnvidia.c'
-+  need_libpci = true
-   cargs += '-DCONFIG_GFXNVIDIA=1'
- endif
- if config_internal
-@@ -186,6 +199,7 @@
- srcs += 'sb600spi.c'
- srcs += 'wbsio_spi.c'
-   endif
-+  need_libpci = true
-   config_bitbang_spi = true
-   cargs += '-DCONFIG_INTERNAL=1'
-   if get_option('config_internal_dmi')
-@@ -195,6 +209,7 @@
- endif
- if config_it8212
-   srcs += 'it8212.c'
-+  need_libpci = true
-   cargs += '-DCONFIG_IT8212=1'
- endif
- if config_linux_mtd
-@@ -211,36 +226,44 @@
- endif
- if config_nic3com
-   srcs += 'nic3com.c'
-+  need_libpci = true
-   cargs += '-DCONFIG_NIC3COM=1'
- endif
- if config_nicintel
-   srcs += 'nicintel.c'
-+  need_libpci = true
-   cargs += '-DCONFIG_NICINTEL=1'
- endif
- if config_nicintel_eeprom
-   srcs += 'nicintel_eeprom.c'
-+  need_libpci = true
-   cargs += '-DCONFIG_NICINTEL_EEPROM=1'
- endif
- if config_nicintel_spi
-   srcs += 'nicintel_spi.c'
-+  need_libpci = 

[gentoo-commits] repo/gentoo:master commit in: sys-apps/flashrom/files/, sys-apps/flashrom/

2020-04-28 Thread Marek Szuba
commit: b5a312d32873362067980b2a02886a4b79d08ca6
Author: Marek Szuba  gentoo  org>
AuthorDate: Tue Apr 28 09:31:40 2020 +
Commit: Marek Szuba  gentoo  org>
CommitDate: Tue Apr 28 09:34:31 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b5a312d3

sys-apps/flashrom: switch to building with meson

Much simpler ebuild, libflashrom is shared, and most importantly - it
gets an auto-generated pkg-config file. Upstream meson scripts have for
now, as previously mentioned, not reached feature parity with the
Makefile but with some patching, we can now at least support all the
programmers.

Signed-off-by: Marek Szuba  gentoo.org>

 .../flashrom/files/flashrom-1.2_meson-fixes.patch  | 263 +
 sys-apps/flashrom/flashrom-1.2-r2.ebuild   | 147 
 2 files changed, 410 insertions(+)

diff --git a/sys-apps/flashrom/files/flashrom-1.2_meson-fixes.patch 
b/sys-apps/flashrom/files/flashrom-1.2_meson-fixes.patch
new file mode 100644
index 000..84dec173676
--- /dev/null
+++ b/sys-apps/flashrom/files/flashrom-1.2_meson-fixes.patch
@@ -0,0 +1,263 @@
+--- a/meson.build
 b/meson.build
+@@ -44,6 +44,7 @@
+ config_gfxnvidia = get_option('config_gfxnvidia')
+ config_internal = get_option('config_internal')
+ config_it8212 = get_option('config_it8212')
++config_jlink_spi = get_option('config_jlink_spi')
+ config_linux_mtd = get_option('config_linux_mtd')
+ config_linux_spi = get_option('config_linux_spi')
+ config_mstarddc_spi = get_option('config_mstarddc_spi')
+@@ -67,6 +68,9 @@
+ deps = []
+ srcs = []
+ 
++need_libftdi = false
++need_libpci = false
++need_libusb = false
+ need_raw_access = false
+ need_serial = false
+ 
+@@ -81,24 +85,24 @@
+   add_project_arguments('-DHAVE_UTSNAME=1', language : 'c')
+ endif
+ 
+-# some programmers require libusb
+-if get_option('usb')
+-  srcs += 'usbdev.c'
+-  deps += dependency('libusb-1.0')
+-else
++if get_option('no_libftdi_programmers')
++  message('Disabling ALL libftdi-based programmers')
++  config_ft2232_spi = false
++  config_usbblaster_spi = false
++endif
++
++if get_option('no_libusb_programmers')
++  message('Disabling ALL libusb-based programmers')
+   config_ch341a_spi = false
+   config_dediprog = false
+-  config_digilent_spi = false
+   config_developerbox_spi = false
++  config_digilent_spi = false
+   config_pickit2_spi = false
++  config_stlinkv3_spi = false
+ endif
+ 
+-# some programmers require libpci
+-if get_option('pciutils')
+-  srcs += 'pcidev.c'
+-  deps += dependency('libpci')
+-  cargs += '-DNEED_PCI=1'
+-else
++if get_option('no_libpci_programmers')
++  message('Disabling ALL libpci-based programmers')
+   config_atahpt = false
+   config_atapromise = false
+   config_atavia = false
+@@ -121,14 +125,17 @@
+ # set defines for configured programmers
+ if config_atahpt
+   srcs += 'atahpt.c'
++  need_libpci = true
+   cargs += '-DCONFIG_ATAHPT=1'
+ endif
+ if config_atapromise
+   srcs += 'atapromise.c'
++  need_libpci = true
+   cargs += '-DCONFIG_ATAPROMISE=1'
+ endif
+ if config_atavia
+   srcs += 'atavia.c'
++  need_libpci = true
+   cargs += '-DCONFIG_ATAVIA=1'
+ endif
+ if config_buspirate_spi
+@@ -138,22 +145,27 @@
+ endif
+ if config_ch341a_spi
+   srcs += 'ch341a_spi.c'
++  need_libusb = true
+   cargs += '-DCONFIG_CH341A_SPI=1'
+ endif
+ if config_dediprog
+   srcs += 'dediprog.c'
++  need_libusb = true
+   cargs += '-DCONFIG_DEDIPROG=1'
+ endif
+ if config_developerbox_spi
+   srcs += 'developerbox_spi.c'
++  need_libusb = true
+   cargs += '-DCONFIG_DEVELOPERBOX_SPI=1'
+ endif
+ if config_digilent_spi
+   srcs += 'digilent_spi.c'
++  need_libusb = true
+   cargs += '-DCONFIG_DIGILENT_SPI=1'
+ endif
+ if config_drkaiser
+   srcs += 'drkaiser.c'
++  need_libpci = true
+   cargs += '-DCONFIG_DRKAISER=1'
+ endif
+ if config_dummy
+@@ -162,12 +174,13 @@
+ endif
+ if config_ft2232_spi
+   srcs += 'ft2232_spi.c'
++  need_libftdi = true
+   cargs += '-DCONFIG_FT2232_SPI=1'
+-  deps += dependency('libftdi1')
+   cargs += '-DHAVE_FT232H=1'
+ endif
+ if config_gfxnvidia
+   srcs += 'gfxnvidia.c'
++  need_libpci = true
+   cargs += '-DCONFIG_GFXNVIDIA=1'
+ endif
+ if config_internal
+@@ -186,6 +199,7 @@
+ srcs += 'sb600spi.c'
+ srcs += 'wbsio_spi.c'
+   endif
++  need_libpci = true
+   config_bitbang_spi = true
+   cargs += '-DCONFIG_INTERNAL=1'
+   if get_option('config_internal_dmi')
+@@ -195,6 +209,7 @@
+ endif
+ if config_it8212
+   srcs += 'it8212.c'
++  need_libpci = true
+   cargs += '-DCONFIG_IT8212=1'
+ endif
+ if config_linux_mtd
+@@ -211,36 +226,44 @@
+ endif
+ if config_nic3com
+   srcs += 'nic3com.c'
++  need_libpci = true
+   cargs += '-DCONFIG_NIC3COM=1'
+ endif
+ if config_nicintel
+   srcs += 'nicintel.c'
++  need_libpci = true
+   cargs += '-DCONFIG_NICINTEL=1'
+ endif
+ if config_nicintel_eeprom
+   srcs += 'nicintel_eeprom.c'
++  need_libpci = true
+   cargs += '-DCONFIG_NICINTEL_EEPROM=1'
+ endif
+ if config_nicintel_spi
+   srcs +=