refactor(nix): use neovide
from upstream
This commit is contained in:
parent
a4bbcaa73e
commit
4de0e4db4b
@ -5,7 +5,6 @@
|
||||
fetchFromGitHub = pkgs.fetchFromGitHub;
|
||||
};
|
||||
screen-cap = pkgs.callPackage ./screen-cap/default.nix { };
|
||||
neovide = pkgs.callPackage ./neovide/package.nix { };
|
||||
Fmt = pkgs.writeShellApplication {
|
||||
name = "Fmt";
|
||||
runtimeInputs = with pkgs; [
|
||||
|
@ -1,131 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
clangStdenv,
|
||||
fetchFromGitHub,
|
||||
linkFarm,
|
||||
fetchgit,
|
||||
runCommand,
|
||||
gn,
|
||||
neovim,
|
||||
ninja,
|
||||
makeWrapper,
|
||||
pkg-config,
|
||||
python3,
|
||||
removeReferencesTo,
|
||||
xcbuild,
|
||||
SDL2,
|
||||
fontconfig,
|
||||
xorg,
|
||||
stdenv,
|
||||
darwin,
|
||||
libglvnd,
|
||||
libxkbcommon,
|
||||
enableWayland ? stdenv.isLinux,
|
||||
wayland,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage.override { stdenv = clangStdenv; } rec {
|
||||
pname = "neovide";
|
||||
version = "af5924e02a2ce6b6bc71dec5096939fa0865aa6c";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "neovide";
|
||||
repo = "neovide";
|
||||
rev = version;
|
||||
hash = "sha256-XWT7Rxx0bd10lNRBVGA+wmms83rEMP7eVERVmA4pvC8=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-SWEo2lgyIj3zjQRRQtvB1lBmn+ay7leTRl04but7XsI=";
|
||||
|
||||
SKIA_SOURCE_DIR =
|
||||
let
|
||||
repo = fetchFromGitHub {
|
||||
owner = "rust-skia";
|
||||
repo = "skia";
|
||||
# see rust-skia:skia-bindings/Cargo.toml#package.metadata skia
|
||||
rev = "m125-0.72.3";
|
||||
hash = "sha256-zlHUJUXukE4CsXwwmVl3KHf9mnNPT8lC/ETEE15Gb4s=";
|
||||
};
|
||||
# The externals for skia are taken from skia/DEPS
|
||||
externals = linkFarm "skia-externals" (
|
||||
lib.mapAttrsToList (name: value: {
|
||||
inherit name;
|
||||
path = fetchgit value;
|
||||
}) (lib.importJSON ./skia-externals.json)
|
||||
);
|
||||
in
|
||||
runCommand "source" { } ''
|
||||
cp -R ${repo} $out
|
||||
chmod -R +w $out
|
||||
ln -s ${externals} $out/third_party/externals
|
||||
'';
|
||||
|
||||
SKIA_GN_COMMAND = "${gn}/bin/gn";
|
||||
SKIA_NINJA_COMMAND = "${ninja}/bin/ninja";
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
pkg-config
|
||||
python3 # skia
|
||||
removeReferencesTo
|
||||
] ++ lib.optionals stdenv.isDarwin [ xcbuild ];
|
||||
|
||||
nativeCheckInputs = [ neovim ];
|
||||
|
||||
buildInputs = [
|
||||
SDL2
|
||||
fontconfig
|
||||
rustPlatform.bindgenHook
|
||||
] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.AppKit ];
|
||||
|
||||
postFixup =
|
||||
let
|
||||
libPath = lib.makeLibraryPath (
|
||||
[
|
||||
libglvnd
|
||||
libxkbcommon
|
||||
xorg.libXcursor
|
||||
xorg.libXext
|
||||
xorg.libXrandr
|
||||
xorg.libXi
|
||||
]
|
||||
++ lib.optionals enableWayland [ wayland ]
|
||||
);
|
||||
in
|
||||
''
|
||||
# library skia embeds the path to its sources
|
||||
remove-references-to -t "$SKIA_SOURCE_DIR" \
|
||||
$out/bin/neovide
|
||||
|
||||
wrapProgram $out/bin/neovide \
|
||||
--prefix LD_LIBRARY_PATH : ${libPath}
|
||||
'';
|
||||
|
||||
postInstall =
|
||||
lib.optionalString stdenv.isDarwin ''
|
||||
mkdir -p $out/Applications
|
||||
cp -r extra/osx/Neovide.app $out/Applications
|
||||
ln -s $out/bin $out/Applications/Neovide.app/Contents/MacOS
|
||||
''
|
||||
+ lib.optionalString stdenv.isLinux ''
|
||||
for n in 16x16 32x32 48x48 256x256; do
|
||||
install -m444 -D "assets/neovide-$n.png" \
|
||||
"$out/share/icons/hicolor/$n/apps/neovide.png"
|
||||
done
|
||||
install -m444 -Dt $out/share/icons/hicolor/scalable/apps assets/neovide.svg
|
||||
install -m444 -Dt $out/share/applications assets/neovide.desktop
|
||||
'';
|
||||
|
||||
disallowedReferences = [ SKIA_SOURCE_DIR ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "This is a simple graphical user interface for Neovim";
|
||||
mainProgram = "neovide";
|
||||
homepage = "https://github.com/neovide/neovide";
|
||||
changelog = "https://github.com/neovide/neovide/releases/tag/${version}";
|
||||
license = with licenses; [ mit ];
|
||||
maintainers = with maintainers; [ ck3d ];
|
||||
platforms = platforms.linux ++ [ "aarch64-darwin" ];
|
||||
};
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
{
|
||||
"expat": {
|
||||
"url": "https://chromium.googlesource.com/external/github.com/libexpat/libexpat.git",
|
||||
"rev": "441f98d02deafd9b090aea568282b28f66a50e36",
|
||||
"sha256": "sha256-FXTDGAK03jc2wvazhRKqtsFRKZUYS/9HLpZNp4JfZJI="
|
||||
},
|
||||
"libjpeg-turbo": {
|
||||
"url": "https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git",
|
||||
"rev": "ed683925e4897a84b3bffc5c1414c85b97a129a3",
|
||||
"sha256": "sha256-DYJP3phe4OzCtRN2pMc07ITTWR8MuIlOWWg9PBsQAVw="
|
||||
},
|
||||
"icu": {
|
||||
"url": "https://chromium.googlesource.com/chromium/deps/icu.git",
|
||||
"rev": "a0718d4f121727e30b8d52c7a189ebf5ab52421f",
|
||||
"sha256": "sha256-BI3f/gf9GNDvSfXWeRHKBvznSz4mjXY8rM24kK7QvOM="
|
||||
},
|
||||
"zlib": {
|
||||
"url": "https://chromium.googlesource.com/chromium/src/third_party/zlib",
|
||||
"rev": "646b7f569718921d7d4b5b8e22572ff6c76f2596",
|
||||
"sha256": "sha256-jNj6SuTZ5/a7crtYhxW3Q/TlfRMNMfYIVxDlr7bYdzQ="
|
||||
},
|
||||
"harfbuzz": {
|
||||
"url": "https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git",
|
||||
"rev": "c053e8f29257814e11ad61493dbbe29f27656de4",
|
||||
"sha256": "sha256-D8DNcZH/oiJqWvfWFHvQ8AwQ3OrMwyZdfGmZ5y30Hvg="
|
||||
},
|
||||
"wuffs": {
|
||||
"url": "https://skia.googlesource.com/external/github.com/google/wuffs-mirror-release-c.git",
|
||||
"rev": "e3f919ccfe3ef542cfc983a82146070258fb57f8",
|
||||
"sha256": "sha256-373d2F/STcgCHEq+PO+SCHrKVOo6uO1rqqwRN5eeBCw="
|
||||
},
|
||||
"libpng": {
|
||||
"url": "https://skia.googlesource.com/third_party/libpng.git",
|
||||
"rev": "144b348e072a78e8130ed0acc452c9f039a67bf2",
|
||||
"sha256": "sha256-eTF7q7hR4S1OqV2oPQKmcHujA5Od4rGMc5879kT0SkE="
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user