Merge pull request #204670 from figsoda/neovide

neovide: drop python2, clean up
This commit is contained in:
figsoda 2022-12-05 15:04:03 -05:00 committed by GitHub
commit aaf173db6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 64 deletions

View File

@ -1,40 +1,34 @@
{ rustPlatform { lib
, runCommand , rustPlatform
, lib , clangStdenv
, fetchFromGitHub , fetchFromGitHub
, linkFarm
, fetchgit , fetchgit
, fetchurl , runCommand
, gn
, ninja
, makeWrapper , makeWrapper
, pkg-config , pkg-config
, python2
, python3 , python3
, openssl , removeReferencesTo
, xcbuild
, SDL2 , SDL2
, fontconfig , fontconfig
, freetype , xorg
, ninja , stdenv
, gn , darwin
, llvmPackages
, makeFontsConf
, libglvnd , libglvnd
, libxkbcommon , libxkbcommon
, stdenv
, enableWayland ? stdenv.isLinux , enableWayland ? stdenv.isLinux
, wayland , wayland
, xorg
, xcbuild
, Security
, ApplicationServices
, AppKit
, Carbon
, removeReferencesTo
}: }:
rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage.override { stdenv = clangStdenv; } rec {
pname = "neovide"; pname = "neovide";
version = "0.10.3"; version = "0.10.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "Kethku"; owner = "neovide";
repo = "neovide"; repo = "neovide";
rev = version; rev = version;
sha256 = "sha256-CcBiCcfOJzuq0DnokTUHpMdo7Ry29ugQ+N7Hk0R+cQE="; sha256 = "sha256-CcBiCcfOJzuq0DnokTUHpMdo7Ry29ugQ+N7Hk0R+cQE=";
@ -52,35 +46,24 @@ rustPlatform.buildRustPackage rec {
sha256 = "sha256-w5dw/lGm40gKkHPR1ji/L82Oa808Kuh8qaCeiqBLkLw="; sha256 = "sha256-w5dw/lGm40gKkHPR1ji/L82Oa808Kuh8qaCeiqBLkLw=";
}; };
# The externals for skia are taken from skia/DEPS # The externals for skia are taken from skia/DEPS
externals = lib.mapAttrs (n: fetchgit) (lib.importJSON ./skia-externals.json); externals = linkFarm "skia-externals" (lib.mapAttrsToList
(name: value: { inherit name; path = fetchgit value; })
(lib.importJSON ./skia-externals.json));
in in
runCommand "source" {} ( runCommand "source" { } ''
'' cp -R ${repo} $out
cp -R ${repo} $out chmod -R +w $out
chmod -R +w $out ln -s ${externals} $out/third_party/externals
''
;
mkdir -p $out/third_party/externals
cd $out/third_party/externals
'' + (builtins.concatStringsSep "\n" (lib.mapAttrsToList (name: value: "cp -ra ${value} ${name}") externals))
);
SKIA_NINJA_COMMAND = "${ninja}/bin/ninja";
SKIA_GN_COMMAND = "${gn}/bin/gn"; SKIA_GN_COMMAND = "${gn}/bin/gn";
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; SKIA_NINJA_COMMAND = "${ninja}/bin/ninja";
preConfigure = ''
unset CC CXX
'';
# test needs a valid fontconfig file
FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ ]; };
nativeBuildInputs = [ nativeBuildInputs = [
pkg-config
makeWrapper makeWrapper
python2 # skia-bindings pkg-config
python3 # rust-xcb python3 # skia
llvmPackages.clang # skia
removeReferencesTo removeReferencesTo
] ++ lib.optionals stdenv.isDarwin [ xcbuild ]; ] ++ lib.optionals stdenv.isDarwin [ xcbuild ];
@ -91,21 +74,12 @@ rustPlatform.buildRustPackage rec {
doCheck = false; doCheck = false;
buildInputs = [ buildInputs = [
openssl
SDL2 SDL2
(fontconfig.overrideAttrs (old: { fontconfig
propagatedBuildInputs = [ rustPlatform.bindgenHook
# skia is not compatible with freetype 2.11.0 ] ++ lib.optionals stdenv.isDarwin [
(freetype.overrideAttrs (old: rec { darwin.apple_sdk.frameworks.AppKit
version = "2.10.4"; ];
src = fetchurl {
url = "mirror://savannah/${old.pname}/${old.pname}-${version}.tar.xz";
sha256 = "112pyy215chg7f7fmp2l9374chhhpihbh8wgpj5nj6avj3c59a46";
};
}))
];
}))
] ++ lib.optionals stdenv.isDarwin [ Security ApplicationServices Carbon AppKit ];
postFixup = let postFixup = let
libPath = lib.makeLibraryPath ([ libPath = lib.makeLibraryPath ([
@ -138,10 +112,9 @@ rustPlatform.buildRustPackage rec {
meta = with lib; { meta = with lib; {
description = "This is a simple graphical user interface for Neovim."; description = "This is a simple graphical user interface for Neovim.";
homepage = "https://github.com/Kethku/neovide"; homepage = "https://github.com/neovide/neovide";
changelog = "https://github.com/neovide/neovide/releases/tag/${version}";
license = with licenses; [ mit ]; license = with licenses; [ mit ];
maintainers = with maintainers; [ ck3d ]; maintainers = with maintainers; [ ck3d ];
platforms = platforms.all;
mainProgram = "neovide";
}; };
} }

View File

@ -32782,9 +32782,7 @@ with pkgs;
gnvim = callPackage ../applications/editors/neovim/gnvim/wrapper.nix { }; gnvim = callPackage ../applications/editors/neovim/gnvim/wrapper.nix { };
neovide = callPackage ../applications/editors/neovim/neovide { neovide = callPackage ../applications/editors/neovim/neovide { };
inherit (darwin.apple_sdk.frameworks) Security ApplicationServices Carbon AppKit;
};
neovim-remote = callPackage ../applications/editors/neovim/neovim-remote.nix { }; neovim-remote = callPackage ../applications/editors/neovim/neovim-remote.nix { };