freebsd-ports/devel/electron4/files/patch-build_linux_libpci_BUILD.gn
Luca Pizzamiglio 2f40d531c4 devel/electron4: Add electron 4.2.2
Finally, after a long wait, an electron port for FreeBSD lands in the
portstree.

A huge thanks to everyone contributed to this huge effort and to the
maintainer that is willing to take the burden of the maintainership!
2019-05-28 09:12:02 +00:00

53 lines
1.2 KiB
Text

--- build/linux/libpci/BUILD.gn.orig 2019-03-15 06:25:28 UTC
+++ build/linux/libpci/BUILD.gn
@@ -3,20 +3,36 @@
# found in the LICENSE file.
import("//tools/generate_library_loader/generate_library_loader.gni")
+import("//build/config/linux/pkg_config.gni")
-# This generates a target named "libpci".
-generate_library_loader("libpci") {
- name = "LibPciLoader"
- output_h = "libpci.h"
- output_cc = "libpci_loader.cc"
- header = "<pci/pci.h>"
+declare_args() {
+ use_system_libpci = is_bsd
+}
- functions = [
- "pci_alloc",
- "pci_init",
- "pci_cleanup",
- "pci_scan_bus",
- "pci_fill_info",
- "pci_lookup_name",
- ]
+if (use_system_libpci) {
+ pkg_config("system_libpci") {
+ packages = [ "libpci" ]
+ }
+
+ source_set("libpci") {
+ public_configs = [ ":system_libpci" ]
+ }
+
+} else {
+ # This generates a target named "libpci".
+ generate_library_loader("libpci") {
+ name = "LibPciLoader"
+ output_h = "libpci.h"
+ output_cc = "libpci_loader.cc"
+ header = "<pci/pci.h>"
+
+ functions = [
+ "pci_alloc",
+ "pci_init",
+ "pci_cleanup",
+ "pci_scan_bus",
+ "pci_fill_info",
+ "pci_lookup_name",
+ ]
+ }
}