Skip to content

Commit fe8d487

Browse files
committed
nix: Enable webrender x11
1 parent 6251cf0 commit fe8d487

File tree

3 files changed

+26
-25
lines changed

3 files changed

+26
-25
lines changed

flake.nix

+20-19
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@
119119
name = "emacs-webrender-" + version;
120120
src = emacsWebrenderSource;
121121
emacsVersion = "30.0.50";
122-
version = emacsVersion + "-" + builtins.substring 0 7 emacsWebrenderSource.rev;
122+
version = emacsVersion + "-"
123+
+ builtins.substring 0 7 emacsWebrenderSource.rev;
123124
# https://github.com/NixOS/nixpkgs/blob/22.11/pkgs/applications/networking/browsers/firefox/common.nix#L574
124125
# Firefox use this.
125126
# guix has cargo-utils to fix checksum, won't be useful on nix though
@@ -154,7 +155,10 @@
154155
"--with-compress-install"
155156
"--with-zlib"
156157
"--with-dumping=pdumper"
157-
] ++ lib.optionals withWebrender [ "--with-webrender" ]
158+
] ++ lib.optionals withWebrender [
159+
"--with-webrender"
160+
"--enable-webrender-x11"
161+
]
158162

159163
++ lib.optionals (stdenv.isDarwin && withWebrender)
160164
[ "--disable-webrender-self-contained" ]
@@ -174,8 +178,7 @@
174178
custom-llvmPackages.libclang
175179
final.rust-bin.nightly."${locked-date}".default
176180
git
177-
] ++ lib.optionals withWebrender
178-
([python3] ++ rpathLibs)
181+
] ++ lib.optionals withWebrender ([ python3 ] ++ rpathLibs)
179182
++ lib.optionals stdenv.isDarwin
180183
(with darwin.apple_sdk.frameworks;
181184
with darwin;
@@ -198,21 +201,19 @@
198201
dontPatchShebangs =
199202
true; # straight_watch_callback.py: unsupported interpreter directive "#!/usr/bin/env -S python3 -u"
200203

201-
postFixup =
202-
(old.postFixup or "")
203-
+ (
204-
if withWebrender
205-
then
206-
lib.concatStringsSep "\n" [
207-
(lib.optionalString stdenv.isLinux ''
208-
patchelf --set-rpath \
209-
"$(patchelf --print-rpath "$out/bin/emacs-$emacsVersion"):${lib.makeLibraryPath rpathLibs}" \
210-
"$out/bin/emacs-$emacsVersion"
211-
patchelf --add-needed "libfontconfig.so" "$out/bin/emacs-$emacsVersion"
212-
'')
213-
]
214-
else ""
215-
);
204+
postFixup = (old.postFixup or "") + (if withWebrender then
205+
lib.concatStringsSep "\n" [
206+
(lib.optionalString stdenv.isLinux ''
207+
patchelf --set-rpath \
208+
"$(patchelf --print-rpath "$out/bin/emacs-$emacsVersion"):${
209+
lib.makeLibraryPath rpathLibs
210+
}" \
211+
"$out/bin/emacs-$emacsVersion"
212+
patchelf --add-needed "libfontconfig.so" "$out/bin/emacs-$emacsVersion"
213+
'')
214+
]
215+
else
216+
"");
216217
});
217218
};
218219
};

nix/_sources/generated.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"name": null,
1313
"owner": "declantsien",
1414
"repo": "emacs-ng",
15-
"rev": "2407f974a176839885d56f050750d4c4ce661b04",
16-
"sha256": "sha256-jg4fbJFPiu1XNCU7Zh6L00m8iZ+4uduXIiDep95zaHA=",
15+
"rev": "651e309a61b559719a39cb5e59c8464735523ef7",
16+
"sha256": "sha256-rKIB2pYpv43xTIshf2MH+t3GJbeGp7sP1k3IxDrfQ0g=",
1717
"type": "github"
1818
},
19-
"version": "2407f974a176839885d56f050750d4c4ce661b04"
19+
"version": "651e309a61b559719a39cb5e59c8464735523ef7"
2020
}
2121
}

nix/_sources/generated.nix

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
{
44
emacs-webrender = {
55
pname = "emacs-webrender";
6-
version = "2407f974a176839885d56f050750d4c4ce661b04";
6+
version = "651e309a61b559719a39cb5e59c8464735523ef7";
77
src = fetchFromGitHub ({
88
owner = "declantsien";
99
repo = "emacs-ng";
10-
rev = "2407f974a176839885d56f050750d4c4ce661b04";
10+
rev = "651e309a61b559719a39cb5e59c8464735523ef7";
1111
fetchSubmodules = false;
12-
sha256 = "sha256-jg4fbJFPiu1XNCU7Zh6L00m8iZ+4uduXIiDep95zaHA=";
12+
sha256 = "sha256-rKIB2pYpv43xTIshf2MH+t3GJbeGp7sP1k3IxDrfQ0g=";
1313
});
1414
};
1515
}

0 commit comments

Comments
 (0)