docstr: Detects the igraph include directory, library directory and the
  list of libraries to link to using ``pkg-config``.
docstr_tok: ["Detects","the","igraph","include","directory",",","library","directory","and","the","list","of","libraries","to","link","to","using","``","pkg-config","``","."]
code: def detect_from_pkgconfig(self) -> bool:
      """Detects the igraph include directory, library directory and the
      list of libraries to link to using ``pkg-config``."""
      if not buildcfg.has_pkgconfig:
          return False
  
      cmd = ["pkg-config", "igraph", "--cflags", "--libs"]
      if self.static_extension:
          cmd += ["--static"]
      line, exit_code = get_output_single_line(cmd)
      if exit_code > 0 or len(line) == 0:
          return False
  
      opts = line.strip().split()
      self.libraries = [opt[2:] for opt in opts if opt.startswith("-l")]
      self.library_dirs = [
          opt[2:] for opt in opts if opt.startswith("-L")
      ]
      self.include_dirs = [
          opt[2:] for opt in opts if opt.startswith("-I")
      ]
      return True
  
imports: import os
  import platform
  import sys
  from setuptools import find_packages, setup, Command, Extension
  import glob
  import shlex
  import shutil
  import subprocess
  import sysconfig
  from contextlib import contextmanager
  from pathlib import Path
  from select import select
  from shutil import which
  from time import sleep
  from typing import List, Iterable, Iterator, Optional, Tuple, TypeVar, Union
label_desc: Use image node_id 8 for calling the BuildConfiguration obj's underlying member method code with example usage: obj.detect_from_pkgconfig() and returns: True, False, False