1- { lib
2- , stdenv
3- , fetchFromGitHub
4- , nix-update-script
5- , rustPlatform
6- , cmake
7- , pkg-config
8- , perl
9- , python3
10- , fontconfig
11- , glib
12- , gtk3
13- , openssl
14- , libGL
15- , libobjc
16- , libxkbcommon
17- , Security
18- , CoreServices
19- , ApplicationServices
20- , Carbon
21- , AppKit
22- , wrapGAppsHook3
23- , wayland
24- , gobject-introspection
25- , xorg
1+ {
2+ lib ,
3+ stdenv ,
4+ fetchFromGitHub ,
5+ nix-update-script ,
6+ rustPlatform ,
7+ cmake ,
8+ pkg-config ,
9+ perl ,
10+ python3 ,
11+ fontconfig ,
12+ glib ,
13+ gtk3 ,
14+ openssl ,
15+ libGL ,
16+ libobjc ,
17+ libxkbcommon ,
18+ wrapGAppsHook3 ,
19+ wayland ,
20+ gobject-introspection ,
21+ xorg ,
22+ apple-sdk_11 ,
2623} :
2724let
2825 rpathLibs = lib . optionals stdenv . hostPlatform . isLinux [
@@ -85,33 +82,37 @@ rustPlatform.buildRustPackage rec {
8582 gobject-introspection
8683 ] ;
8784
88- buildInputs = rpathLibs ++ [
89- glib
90- gtk3
91- openssl
92- ] ++ lib . optionals stdenv . hostPlatform . isLinux [
93- fontconfig
94- ] ++ lib . optionals stdenv . hostPlatform . isDarwin [
95- libobjc
96- Security
97- CoreServices
98- ApplicationServices
99- Carbon
100- AppKit
101- ] ;
85+ buildInputs =
86+ rpathLibs
87+ ++ [
88+ glib
89+ gtk3
90+ openssl
91+ ]
92+ ++ lib . optionals stdenv . hostPlatform . isLinux [
93+ fontconfig
94+ ]
95+ ++ lib . optionals stdenv . hostPlatform . isDarwin [
96+ libobjc
97+ apple-sdk_11
98+ ] ;
10299
103- postInstall = if stdenv . hostPlatform . isLinux then ''
104- install -Dm0644 $src/extra/images/logo.svg $out/share/icons/hicolor/scalable/apps/dev.lapce.lapce.svg
105- install -Dm0644 $src/extra/linux/dev.lapce.lapce.desktop $out/share/applications/lapce.desktop
100+ postInstall =
101+ if stdenv . hostPlatform . isLinux then
102+ ''
103+ install -Dm0644 $src/extra/images/logo.svg $out/share/icons/hicolor/scalable/apps/dev.lapce.lapce.svg
104+ install -Dm0644 $src/extra/linux/dev.lapce.lapce.desktop $out/share/applications/lapce.desktop
106105
107- $STRIP -S $out/bin/lapce
106+ $STRIP -S $out/bin/lapce
108107
109- patchelf --add-rpath "${ lib . makeLibraryPath rpathLibs } " $out/bin/lapce
110- '' else ''
111- mkdir $out/Applications
112- cp -r extra/macos/Lapce.app $out/Applications
113- ln -s $out/bin $out/Applications/Lapce.app/Contents/MacOS
114- '' ;
108+ patchelf --add-rpath "${ lib . makeLibraryPath rpathLibs } " $out/bin/lapce
109+ ''
110+ else
111+ ''
112+ mkdir $out/Applications
113+ cp -r extra/macos/Lapce.app $out/Applications
114+ ln -s $out/bin $out/Applications/Lapce.app/Contents/MacOS
115+ '' ;
115116
116117 dontPatchELF = true ;
117118
@@ -124,7 +125,5 @@ rustPlatform.buildRustPackage rec {
124125 license = with licenses ; [ asl20 ] ;
125126 maintainers = with maintainers ; [ elliot ] ;
126127 mainProgram = "lapce" ;
127- # Undefined symbols for architecture x86_64: "_NSPasteboardTypeFileURL"
128- broken = stdenv . hostPlatform . isDarwin && stdenv . hostPlatform . isx86_64 ;
129128 } ;
130129}
0 commit comments