summaryrefslogtreecommitdiff
path: root/sys-apps/flashrom/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-08-25 10:45:55 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-08-25 10:45:55 +0100
commit3cf7c3ef441822c889356fd1812ebf2944a59851 (patch)
treec513fe68548b40365c1c2ebfe35c58ad431cdd77 /sys-apps/flashrom/files
parent05b8b0e0af1d72e51a3ee61522941bf7605cd01c (diff)
gentoo resync : 25.08.2020
Diffstat (limited to 'sys-apps/flashrom/files')
-rw-r--r--sys-apps/flashrom/files/flashrom-1.2_make-libflashrom-usable.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/sys-apps/flashrom/files/flashrom-1.2_make-libflashrom-usable.patch b/sys-apps/flashrom/files/flashrom-1.2_make-libflashrom-usable.patch
new file mode 100644
index 000000000000..ea15a4230592
--- /dev/null
+++ b/sys-apps/flashrom/files/flashrom-1.2_make-libflashrom-usable.patch
@@ -0,0 +1,70 @@
+1. Add an (extremely primitive) rule for generating a pkgconfig file
+ for libflashrom, as fwupd cannot find it without one. Note that this
+ rule depends on several variables to be passed to make, see ebuilds
+ using this patch for details;
+2. Tweak the way library dependencies are passed around a bit to make it
+ easier to inject them into said pkgconfig file;
+3. Move print.o from CLI_OBJS to LIB_OBJS - it contains the array
+ 'boards_known' which is used in library code. Upstream have already
+ fixed this in Meson files but not in the Makefile.
+
+diff -urN a/flashrom.pc.in b/flashrom.pc.in
+--- a/flashrom.pc.in 1970-01-01 01:00:00.000000000 +0100
++++ b/flashrom.pc.in 2020-07-28 22:47:01.928679346 +0200
+@@ -0,0 +1,9 @@
++prefix=@PREFIX@
++libdir=${prefix}/@LIBDIR@
++includedir=${prefix}/@INCLUDEDIR@
++
++Name: libflashrom
++Description: library to interact with flashrom
++Version: @VERSION@
++Libs: -L${libdir} -lflashrom @LIBS@
++Cflags: -I${includedir}
+diff -urN a/Makefile b/Makefile
+--- a/Makefile 2019-12-31 18:25:41.000000000 +0100
++++ b/Makefile 2020-07-28 23:18:41.019492448 +0200
+@@ -570,12 +570,12 @@
+ ###############################################################################
+ # Library code.
+
+-LIB_OBJS = libflashrom.o layout.o flashrom.o udelay.o programmer.o helpers.o ich_descriptors.o fmap.o
++LIB_OBJS = libflashrom.o layout.o flashrom.o udelay.o programmer.o helpers.o ich_descriptors.o fmap.o print.o
+
+ ###############################################################################
+ # Frontend related stuff.
+
+-CLI_OBJS = cli_classic.o cli_output.o cli_common.o print.o
++CLI_OBJS = cli_classic.o cli_output.o cli_common.o
+
+ # versioninfo.inc stores metadata required to build a packaged flashrom. It is generated by the export rule and
+ # imported below. If versioninfo.inc is not found and the variables are not defined by the user, the info will
+@@ -1130,11 +1130,16 @@
+ @+$(MAKE) -C util/ich_descriptors_tool/ TARGET_OS=$(TARGET_OS) EXEC_SUFFIX=$(EXEC_SUFFIX)
+ endif
+
++ALL_LIBS = $(LIBS) $(PCILIBS) $(FEATURE_LIBS) $(USBLIBS) $(USB1LIBS) $(JAYLINKLIBS) $(NI845X_LIBS)
++
++flashrom.pc:
++ sed -e "s#@PREFIX@#$(PREFIX)#" -e "s#@LIBDIR@#$(LIBDIR)#" -e "s#@INCLUDEDIR@#$(INCLUDEDIR)#" -e "s#@VERSION@#$(VERSION)#" -e "s#@LIBS@#$(ALL_LIBS)#" < $@.in > $@.tmp && mv $@.tmp $@
++
+ $(PROGRAM)$(EXEC_SUFFIX): $(OBJS)
+- $(CC) $(LDFLAGS) -o $(PROGRAM)$(EXEC_SUFFIX) $(OBJS) $(LIBS) $(PCILIBS) $(FEATURE_LIBS) $(USBLIBS) $(USB1LIBS) $(JAYLINKLIBS) $(NI845X_LIBS)
++ $(CC) $(LDFLAGS) -o $(PROGRAM)$(EXEC_SUFFIX) $(OBJS) $(ALL_LIBS)
+
+-libflashrom.a: $(LIBFLASHROM_OBJS)
+- $(AR) rcs $@ $^
++libflashrom.a: $(LIBFLASHROM_OBJS) flashrom.pc
++ $(AR) rcs $@ $(LIBFLASHROM_OBJS)
+ $(RANLIB) $@
+
+ # TAROPTIONS reduces information leakage from the packager's system.
+@@ -1149,7 +1154,7 @@
+ # This includes all frontends and libflashrom.
+ # We don't use EXEC_SUFFIX here because we want to clean everything.
+ clean:
+- rm -f $(PROGRAM) $(PROGRAM).exe libflashrom.a *.o *.d $(PROGRAM).8 $(PROGRAM).8.html $(BUILD_DETAILS_FILE)
++ rm -f $(PROGRAM) $(PROGRAM).exe libflashrom.a flashrom.pc *.o *.d $(PROGRAM).8 $(PROGRAM).8.html $(BUILD_DETAILS_FILE)
+ @+$(MAKE) -C util/ich_descriptors_tool/ clean
+
+ distclean: clean