python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / applications / misc / phoc / default.nix
blob0fae80fc14e4b652f98dc8df405aac3aea35fd4d
1 { lib
2 , stdenv
3 , fetchFromGitLab
4 , fetchpatch
5 , meson
6 , ninja
7 , pkg-config
8 , python3
9 , wrapGAppsHook
10 , libinput
11 , gnome
12 , gnome-desktop
13 , glib
14 , gtk3
15 , wayland
16 , libdrm
17 , libxkbcommon
18 , wlroots
21 let
22   phocWlroots = wlroots.overrideAttrs (old: {
23     patches = (old.patches or []) ++ [
24       # Revert "layer-shell: error on 0 dimension without anchors"
25       # https://source.puri.sm/Librem5/phosh/-/issues/422
26       (fetchpatch {
27         name = "0001-Revert-layer-shell-error-on-0-dimension-without-anch.patch";
28         url = "https://source.puri.sm/Librem5/wlroots/-/commit/4f66b0931aaaee65367102e9c4ccb736097412c7.patch";
29         hash = "sha256-2Vy5a4lWh8FP2PN6xRIZv6IlUuLZibT0MYW+EyvVULs=";
30       })
32       # xdg-activation: Deduplicate token creation code
33       (fetchpatch {
34         name = "xdg-activation-deduplicate-token-creation-code.patch";
35         url = "https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/dd03d839ab56c3e5d7c607a8d76e58e0b75edb85.patch";
36         sha256 = "sha256-mxt68MISC24xpaBtVSc1F2W4cyNs5wQowtbUQH9Eqr8=";
37       })
39       # seat: Allow to cancel touches
40       (fetchpatch {
41         name = "seat-Allow-to-cancel-touches.patch";
42         url = "https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/17b2b06633729f1826715c1d0b84614aa3cedb3a.patch";
43         sha256 = "sha256-BAeXa3ZB5TXnlq0ZP2+rZlVXEPWpLP4Wi4TLwoXjkz4=";
44       })
46       # From
47       # https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/13fcdba75cf5f21cfd49c1a05f4fa62f77619b40
48       # which has been merged upstream, but doesn't cleanly apply on to the
49       # latest released version.
50       ./0001-handle-outputs-that-arent-in-the-layout.patch
51     ];
52   });
53 in stdenv.mkDerivation rec {
54   pname = "phoc";
55   version = "0.21.1";
57   src = fetchFromGitLab {
58     domain = "gitlab.gnome.org";
59     group = "World";
60     owner = "Phosh";
61     repo = pname;
62     rev = "v${version}";
63     sha256 = "sha256-HPqhro6TE/Ukh4txBPrDoIuDaxSxd/ZkDVZU3+m3GFg=";
64   };
66   nativeBuildInputs = [
67     meson
68     ninja
69     pkg-config
70     python3
71     wrapGAppsHook
72   ];
74   buildInputs = [
75     libdrm.dev
76     libxkbcommon
77     libinput
78     glib
79     gtk3
80     gnome-desktop
81     # For keybindings settings schemas
82     gnome.mutter
83     wayland
84     phocWlroots
85   ];
87   mesonFlags = ["-Dembed-wlroots=disabled"];
89   postPatch = ''
90     chmod +x build-aux/post_install.py
91     patchShebangs build-aux/post_install.py
92   '';
94   meta = with lib; {
95     description = "Wayland compositor for mobile phones like the Librem 5";
96     homepage = "https://gitlab.gnome.org/World/Phosh/phoc";
97     license = licenses.gpl3Plus;
98     maintainers = with maintainers; [ masipcat zhaofengli ];
99     platforms = platforms.linux;
100   };