-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathflake.nix
More file actions
160 lines (140 loc) · 3.79 KB
/
Copy pathflake.nix
File metadata and controls
160 lines (140 loc) · 3.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
{
description = "pywm - Wayland compositor core";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
};
has_xwayland = true;
inherit (pkgs.lib) optionals;
in
{
packages.pywm = (
pkgs.python3.pkgs.buildPythonPackage rec {
pname = "pywm";
version = "0.3alpha";
# BEGIN Fucking subprojects bug workaround for 'src = ./.'
srcs = [
./.
(builtins.fetchGit {
url = "https://gitlab.freedesktop.org/wlroots/wlroots";
rev = "e279266f714c7122e9ad97d56d047313f78cfdbe";
submodules = true;
})
];
setSourceRoot = ''
for i in ./*; do
if [ -f "$i/wlroots.syms" ]; then
wlrootsDir=$i
fi
if [ -f "$i/pywm/pywm.py" ]; then
sourceRoot=$i
fi
done
'';
preConfigure = ''
echo "--- Pre-configure --------------"
echo " wlrootsDir=$wlrootsDir"
echo " sourceRoot=$sourceRoot"
echo "--- ls -------------------------"
ls -al
echo "--- ls ../wlrootsDir -----------"
ls -al ../$wlrootsDir
rm -rf ./subprojects/wlroots 2> /dev/null
cp -r ../$wlrootsDir ./subprojects/wlroots
rm -rf ./build
echo "--- ls ./subprojects/wlroots ---"
ls -al ./subprojects/wlroots/
echo "--------------------------------"
'';
# END Fucking subprojects bug workaround
mesonFlags = if has_xwayland then [ "-Dxwayland=enabled" ] else [];
nativeBuildInputs = with pkgs; [
meson
ninja
pkg-config
wayland-scanner
glslang
];
preBuild = "cd ..";
buildInputs = with pkgs; [
libGL
wayland
wayland-protocols
libinput
libxkbcommon
pixman
vulkan-loader
mesa
seatd
libpng
ffmpeg
libcap
xorg.xcbutilwm
xorg.xcbutilrenderutil
xorg.xcbutilerrors
xorg.xcbutilimage
xorg.libX11
] ++ optionals has_xwayland [
xwayland
];
propagatedBuildInputs = with pkgs.python3Packages; [
imageio
numpy
pycairo
evdev
];
}
);
devShell = let
my-python = pkgs.python3;
python-with-my-packages = my-python.withPackages (ps: with ps; [
imageio
numpy
pycairo
evdev
matplotlib
python-lsp-server
(pylsp-mypy.overrideAttrs (old: { pytestCheckPhase = "true"; }))
mypy
]);
in
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
meson
ninja
pkg-config
wayland-scanner
glslang
];
buildInputs = with pkgs; [
libGL
wayland
wayland-protocols
libinput
libxkbcommon
pixman
seatd
vulkan-loader
mesa
libpng
ffmpeg
libcap
python-with-my-packages
xorg.xcbutilwm
xorg.xcbutilrenderutil
xorg.xcbutilerrors
xorg.xcbutilimage
xorg.libX11
xwayland
];
};
}
);
}