nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 113 lines 2.4 kB view raw
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 libxkbcommon, 17 wrapGAppsHook3, 18 wayland, 19 gobject-introspection, 20 libxxf86vm, 21 libxrandr, 22 libxi, 23 libxcursor, 24 libx11, 25 libxcb, 26}: 27let 28 rpathLibs = lib.optionals stdenv.hostPlatform.isLinux [ 29 libGL 30 libxkbcommon 31 libx11 32 libxcursor 33 libxi 34 libxrandr 35 libxxf86vm 36 libxcb 37 wayland 38 ]; 39in 40rustPlatform.buildRustPackage rec { 41 pname = "lapce"; 42 version = "0.4.6"; 43 44 src = fetchFromGitHub { 45 owner = "lapce"; 46 repo = "lapce"; 47 tag = "v${version}"; 48 sha256 = "sha256-D5DEmMkCAkMiMMzYP8FoVIUeT2CDOepUWUlUqWSaUnM="; 49 }; 50 51 cargoHash = "sha256-BFaR8jWdET2nInBkKZhnoqLCB1dnXH3pywkD1Cv5SuE="; 52 53 env = { 54 # Get openssl-sys to use pkg-config 55 OPENSSL_NO_VENDOR = 1; 56 57 # This variable is read by build script, so that Lapce editor knows its version 58 RELEASE_TAG_NAME = "v${version}"; 59 }; 60 61 postPatch = '' 62 substituteInPlace lapce-app/Cargo.toml --replace ", \"updater\"" "" 63 ''; 64 65 nativeBuildInputs = [ 66 cmake 67 pkg-config 68 perl 69 python3 70 wrapGAppsHook3 # FIX: No GSettings schemas are installed on the system 71 gobject-introspection 72 ]; 73 74 buildInputs = 75 rpathLibs 76 ++ [ 77 glib 78 gtk3 79 openssl 80 ] 81 ++ lib.optionals stdenv.hostPlatform.isLinux [ 82 fontconfig 83 ]; 84 85 postInstall = 86 if stdenv.hostPlatform.isLinux then 87 '' 88 install -Dm0644 $src/extra/images/logo.svg $out/share/icons/hicolor/scalable/apps/dev.lapce.lapce.svg 89 install -Dm0644 $src/extra/linux/dev.lapce.lapce.desktop $out/share/applications/lapce.desktop 90 91 $STRIP -S $out/bin/lapce 92 93 patchelf --add-rpath "${lib.makeLibraryPath rpathLibs}" $out/bin/lapce 94 '' 95 else 96 '' 97 mkdir $out/Applications 98 cp -r extra/macos/Lapce.app $out/Applications 99 ln -s $out/bin $out/Applications/Lapce.app/Contents/MacOS 100 ''; 101 102 dontPatchELF = true; 103 104 passthru.updateScript = nix-update-script { }; 105 106 meta = { 107 description = "Lightning-fast and Powerful Code Editor written in Rust"; 108 homepage = "https://github.com/lapce/lapce"; 109 changelog = "https://github.com/lapce/lapce/releases/tag/v${version}"; 110 license = with lib.licenses; [ asl20 ]; 111 mainProgram = "lapce"; 112 }; 113}