Skip to content

Commit

Permalink
nix: Enable webrender x11
Browse files Browse the repository at this point in the history
  • Loading branch information
declantsien committed Jan 7, 2023
1 parent 6251cf0 commit fe8d487
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
39 changes: 20 additions & 19 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@
name = "emacs-webrender-" + version;
src = emacsWebrenderSource;
emacsVersion = "30.0.50";
version = emacsVersion + "-" + builtins.substring 0 7 emacsWebrenderSource.rev;
version = emacsVersion + "-"
+ builtins.substring 0 7 emacsWebrenderSource.rev;
# https://github.com/NixOS/nixpkgs/blob/22.11/pkgs/applications/networking/browsers/firefox/common.nix#L574
# Firefox use this.
# guix has cargo-utils to fix checksum, won't be useful on nix though
Expand Down Expand Up @@ -154,7 +155,10 @@
"--with-compress-install"
"--with-zlib"
"--with-dumping=pdumper"
] ++ lib.optionals withWebrender [ "--with-webrender" ]
] ++ lib.optionals withWebrender [
"--with-webrender"
"--enable-webrender-x11"
]

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

postFixup =
(old.postFixup or "")
+ (
if withWebrender
then
lib.concatStringsSep "\n" [
(lib.optionalString stdenv.isLinux ''
patchelf --set-rpath \
"$(patchelf --print-rpath "$out/bin/emacs-$emacsVersion"):${lib.makeLibraryPath rpathLibs}" \
"$out/bin/emacs-$emacsVersion"
patchelf --add-needed "libfontconfig.so" "$out/bin/emacs-$emacsVersion"
'')
]
else ""
);
postFixup = (old.postFixup or "") + (if withWebrender then
lib.concatStringsSep "\n" [
(lib.optionalString stdenv.isLinux ''
patchelf --set-rpath \
"$(patchelf --print-rpath "$out/bin/emacs-$emacsVersion"):${
lib.makeLibraryPath rpathLibs
}" \
"$out/bin/emacs-$emacsVersion"
patchelf --add-needed "libfontconfig.so" "$out/bin/emacs-$emacsVersion"
'')
]
else
"");
});
};
};
Expand Down
6 changes: 3 additions & 3 deletions nix/_sources/generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"name": null,
"owner": "declantsien",
"repo": "emacs-ng",
"rev": "2407f974a176839885d56f050750d4c4ce661b04",
"sha256": "sha256-jg4fbJFPiu1XNCU7Zh6L00m8iZ+4uduXIiDep95zaHA=",
"rev": "651e309a61b559719a39cb5e59c8464735523ef7",
"sha256": "sha256-rKIB2pYpv43xTIshf2MH+t3GJbeGp7sP1k3IxDrfQ0g=",
"type": "github"
},
"version": "2407f974a176839885d56f050750d4c4ce661b04"
"version": "651e309a61b559719a39cb5e59c8464735523ef7"
}
}
6 changes: 3 additions & 3 deletions nix/_sources/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
{
emacs-webrender = {
pname = "emacs-webrender";
version = "2407f974a176839885d56f050750d4c4ce661b04";
version = "651e309a61b559719a39cb5e59c8464735523ef7";
src = fetchFromGitHub ({
owner = "declantsien";
repo = "emacs-ng";
rev = "2407f974a176839885d56f050750d4c4ce661b04";
rev = "651e309a61b559719a39cb5e59c8464735523ef7";
fetchSubmodules = false;
sha256 = "sha256-jg4fbJFPiu1XNCU7Zh6L00m8iZ+4uduXIiDep95zaHA=";
sha256 = "sha256-rKIB2pYpv43xTIshf2MH+t3GJbeGp7sP1k3IxDrfQ0g=";
});
};
}

0 comments on commit fe8d487

Please sign in to comment.