1- { lib
2- , rustPlatform
3- , clangStdenv
4- , fetchFromGitHub
5- , linkFarm
6- , fetchgit
7- , runCommand
8- , gn
9- , neovim
10- , ninja
11- , makeWrapper
12- , pkg-config
13- , python3
14- , removeReferencesTo
15- , apple-sdk_11
16- , cctools
17- , SDL2
18- , fontconfig
19- , xorg
20- , stdenv
21- , libglvnd
22- , libxkbcommon
23- , enableWayland ? stdenv . hostPlatform . isLinux
24- , wayland
1+ {
2+ lib ,
3+ rustPlatform ,
4+ clangStdenv ,
5+ fetchFromGitHub ,
6+ linkFarm ,
7+ fetchgit ,
8+ runCommand ,
9+ gn ,
10+ neovim ,
11+ ninja ,
12+ makeWrapper ,
13+ pkg-config ,
14+ python3 ,
15+ removeReferencesTo ,
16+ apple-sdk_11 ,
17+ cctools ,
18+ SDL2 ,
19+ fontconfig ,
20+ xorg ,
21+ stdenv ,
22+ libglvnd ,
23+ libxkbcommon ,
24+ enableWayland ? stdenv . hostPlatform . isLinux ,
25+ wayland ,
2526} :
2627
2728rustPlatform . buildRustPackage . override { stdenv = clangStdenv ; } rec {
@@ -47,16 +48,18 @@ rustPlatform.buildRustPackage.override { stdenv = clangStdenv; } rec {
4748 hash = "sha256-4l6ekAJy+pG27hBGT6A6LLRwbsyKinJf6PP6mMHwaAs=" ;
4849 } ;
4950 # The externals for skia are taken from skia/DEPS
50- externals = linkFarm "skia-externals" ( lib . mapAttrsToList
51- ( name : value : { inherit name ; path = fetchgit value ; } )
52- ( lib . importJSON ./skia-externals.json ) ) ;
51+ externals = linkFarm "skia-externals" (
52+ lib . mapAttrsToList ( name : value : {
53+ inherit name ;
54+ path = fetchgit value ;
55+ } ) ( lib . importJSON ./skia-externals.json )
56+ ) ;
5357 in
5458 runCommand "source" { } ''
5559 cp -R ${ repo } $out
5660 chmod -R +w $out
5761 ln -s ${ externals } $out/third_party/externals
58- ''
59- ;
62+ '' ;
6063
6164 SKIA_GN_COMMAND = "${ gn } /bin/gn" ;
6265 SKIA_NINJA_COMMAND = "${ ninja } /bin/ninja" ;
@@ -77,16 +80,21 @@ rustPlatform.buildRustPackage.override { stdenv = clangStdenv; } rec {
7780 rustPlatform . bindgenHook
7881 ] ++ lib . optionals stdenv . hostPlatform . isDarwin [ apple-sdk_11 ] ;
7982
80- postFixup = let
81- libPath = lib . makeLibraryPath ( [
82- libglvnd
83- libxkbcommon
84- xorg . libXcursor
85- xorg . libXext
86- xorg . libXrandr
87- xorg . libXi
88- ] ++ lib . optionals enableWayland [ wayland ] ) ;
89- in ''
83+ postFixup =
84+ let
85+ libPath = lib . makeLibraryPath (
86+ [
87+ libglvnd
88+ libxkbcommon
89+ xorg . libXcursor
90+ xorg . libXext
91+ xorg . libXrandr
92+ xorg . libXi
93+ ]
94+ ++ lib . optionals enableWayland [ wayland ]
95+ ) ;
96+ in
97+ ''
9098 # library skia embeds the path to its sources
9199 remove-references-to -t "$SKIA_SOURCE_DIR" \
92100 $out/bin/neovide
@@ -95,18 +103,20 @@ rustPlatform.buildRustPackage.override { stdenv = clangStdenv; } rec {
95103 --prefix LD_LIBRARY_PATH : ${ libPath }
96104 '' ;
97105
98- postInstall = lib . optionalString stdenv . hostPlatform . isDarwin ''
99- mkdir -p $out/Applications
100- cp -r extra/osx/Neovide.app $out/Applications
101- ln -s $out/bin $out/Applications/Neovide.app/Contents/MacOS
102- '' + lib . optionalString stdenv . hostPlatform . isLinux ''
103- for n in 16x16 32x32 48x48 256x256; do
104- install -m444 -D "assets/neovide-$n.png" \
105- "$out/share/icons/hicolor/$n/apps/neovide.png"
106- done
107- install -m444 -Dt $out/share/icons/hicolor/scalable/apps assets/neovide.svg
108- install -m444 -Dt $out/share/applications assets/neovide.desktop
109- '' ;
106+ postInstall =
107+ lib . optionalString stdenv . hostPlatform . isDarwin ''
108+ mkdir -p $out/Applications
109+ cp -r extra/osx/Neovide.app $out/Applications
110+ ln -s $out/bin $out/Applications/Neovide.app/Contents/MacOS
111+ ''
112+ + lib . optionalString stdenv . hostPlatform . isLinux ''
113+ for n in 16x16 32x32 48x48 256x256; do
114+ install -m444 -D "assets/neovide-$n.png" \
115+ "$out/share/icons/hicolor/$n/apps/neovide.png"
116+ done
117+ install -m444 -Dt $out/share/icons/hicolor/scalable/apps assets/neovide.svg
118+ install -m444 -Dt $out/share/applications assets/neovide.desktop
119+ '' ;
110120
111121 disallowedReferences = [ SKIA_SOURCE_DIR ] ;
112122
0 commit comments