nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 meson,
6 ninja,
7 pkg-config,
8 libpng,
9 glib, # just passthru
10
11 # for passthru.tests
12 cairo,
13 qemu,
14 scribus,
15 tigervnc,
16 wlroots_0_17,
17 wlroots_0_18,
18 xwayland,
19
20 gitUpdater,
21 testers,
22
23 __flattenIncludeHackHook,
24}:
25
26stdenv.mkDerivation (finalAttrs: {
27 pname = "pixman";
28 version = "0.46.2";
29
30 src = fetchurl {
31 urls = [
32 "mirror://xorg/individual/lib/pixman-${finalAttrs.version}.tar.gz"
33 "https://cairographics.org/releases/pixman-${finalAttrs.version}.tar.gz"
34 ];
35 hash = "sha256-Pg3lum41aRaUaj2VgZLxVQXcq4UTR3G/6rTOTim71zM=";
36 };
37
38 # Raise test timeout, 120s can be slightly exceeded on slower hardware
39 postPatch = ''
40 substituteInPlace test/meson.build \
41 --replace-fail 'timeout : 120' 'timeout : 240'
42 '';
43
44 separateDebugInfo = !stdenv.hostPlatform.isStatic;
45
46 nativeBuildInputs = [
47 meson
48 ninja
49 pkg-config
50 __flattenIncludeHackHook
51 ];
52
53 buildInputs = [ libpng ];
54
55 # Default "enabled" value attempts to enable CPU features on all
56 # architectures and requires used to disable them:
57 # https://gitlab.freedesktop.org/pixman/pixman/-/issues/88
58 mesonAutoFeatures = "auto";
59 # fix armv7 build
60 mesonFlags = lib.optionals stdenv.hostPlatform.isAarch32 [
61 "-Darm-simd=disabled"
62 "-Dneon=disabled"
63 ];
64
65 preConfigure = ''
66 # https://gitlab.freedesktop.org/pixman/pixman/-/issues/62
67 export OMP_NUM_THREADS=$((NIX_BUILD_CORES > 184 ? 184 : NIX_BUILD_CORES))
68 '';
69
70 enableParallelBuilding = true;
71
72 doCheck = !stdenv.hostPlatform.isDarwin;
73
74 passthru = {
75 tests = {
76 inherit
77 cairo
78 qemu
79 scribus
80 tigervnc
81 wlroots_0_17
82 wlroots_0_18
83 xwayland
84 ;
85 pkg-config = testers.hasPkgConfigModules {
86 package = finalAttrs.finalPackage;
87 };
88 };
89 updateScript = gitUpdater {
90 url = "https://gitlab.freedesktop.org/pixman/pixman.git";
91 rev-prefix = "pixman-";
92 };
93 };
94
95 meta = with lib; {
96 homepage = "https://pixman.org";
97 description = "Low-level library for pixel manipulation";
98 license = licenses.mit;
99 platforms = platforms.all;
100 pkgConfigModules = [ "pixman-1" ];
101 };
102})