anchor.diff:      #"--enable-emscripten"
       "--disable-standalone"
       "--disable-debug"
  -    (enFlag "unit-tests" doCheck null)
  -    (enFlag "cairo" (cairo != null) null)
  +    "--${boolEn doCheck}-unit-tests"
  +    "--${boolEn (cairo != null)}-cairo"
       "--disable-profile"
       "--disable-maintainer-flags"
       "--enable-deprecated"
  -    (enFlag "glibtest" (glib != null) null)
  -    (enFlag "glib" (glib != null) null)
  -    (enFlag "cogl-pango" (pango != null) null)
  -    (enFlag "cogl-gst" (gstreamer != null && gst-plugins-base != null) null)
  +    "--${boolEn (glib != null)}-glibtest"
  +    "--${boolEn (glib != null)}-glib"
  +    "--${boolEn (pango != null)}-cogl-pango"
  +    "--${boolEn (
  +      gstreamer != null
  +      && gst-plugins-base != null)}-cogl-gst"
       "--enable-cogl-path"
  -    (enFlag "gdk-pixbuf" (gdk-pixbuf != null) null)
  +    "--${boolEn (gdk-pixbuf != null)}-gdk-pixbuf"
       "--disable-quartz-image"
       "--disable-examples-install"
       "--enable-gles1"
  
positive.code: , pango
  , wayland
  , xorg
  }:
  
  let
    inherit (stdenv.lib)
      enFlag
      optionalString;
  
    versionMajor = "1.22";
    versionMinor = "0";
    version = "${versionMajor}.${versionMinor}";
  in
  
  stdenv.mkDerivation rec {
    name = "cogl-${version}";
  
    src = fetchurl {
      url = "mirror://gnome/sources/cogl/${versionMajor}/${name}.tar.xz";
      sha256Url = "mirror://gnome/sources/cogl/${versionMajor}/${name}.sha256sum";
      sha256 = "14daxqrid5039xmq9yl4pk86awng1n9zgl6ysblhc4gw2ifzp7b8";
    };
  
    nativeBuildInputs = [
  
negative.code:     "--disable-gtk-doc-pdf"
      "--enable-nls"
      "--enable-rpath"
      "--${boolEn (gobject-introspection != null)}-introspection"
      "--with-x"
    ];
  
  