Applying patch to cario, build fails

Hi,

I’m trying to apply a patch to fix an issue with the latest version of cairo library

My overlay

final: prev: {
  cairo = prev.cairo.overrideAttrs (oldAttrs: {
    patches = (oldAttrs.patches or [ ]) ++ [
      (final.fetchpatch {
        url = "https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/595.patch";
        hash = "sha256-iWYxMVeNpseClSTf7BfU9GBe+tJWc+DUJWTWE5MnGh4=";
      })
    ];
  });
}

The build fails with this error

> src/mss/linux.py:319: ScreenShotError
> =========================== short test summary info ============================
> FAILED src/tests/test_gnu_linux.py::test_missing_fast_function_for_monitor_details_retrieval - mss.exception.ScreenShotError: Unable to open display: b':0'.
> =========== 1 failed, 58 passed, 10 skipped, 7 deselected in 14.45s ============

Any help is welcome

Looks like a false positive, probably easiest to just disable the tests:

final: prev: {
  cairo = prev.cairo.overrideAttrs (oldAttrs: {
    doCheck = false;
    patches = (oldAttrs.patches or [ ]) ++ [
      (final.fetchpatch {
        url = "https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/595.patch";
        hash = "sha256-iWYxMVeNpseClSTf7BfU9GBe+tJWc+DUJWTWE5MnGh4=";
      })
    ];
  });
}

There might be a way to disable the tests more granularly, but it’s probably not worth the effort for a lil’ downstream patch like this.

That test failure does not even appear to be caused by cairo, it comes from GitHub - BoboTiG/python-mss: An ultra fast cross-platform multiple screenshots module in pure Python using ctypes. so maybe that package is non-deterministic.

2 Likes