2022-03-06 06:53:45 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, perl
|
|
|
|
, freetype
|
|
|
|
, fontconfig
|
|
|
|
, libxkbcommon
|
|
|
|
, xcbutil
|
|
|
|
, libX11
|
|
|
|
, libXcursor
|
|
|
|
, libXrandr
|
|
|
|
, libXi
|
|
|
|
, vulkan-loader
|
|
|
|
, copyDesktopItems
|
|
|
|
, makeDesktopItem
|
2022-04-23 04:20:00 +00:00
|
|
|
, openssl
|
|
|
|
, libobjc
|
|
|
|
, Security
|
|
|
|
, CoreServices
|
|
|
|
, ApplicationServices
|
|
|
|
, Carbon
|
|
|
|
, AppKit
|
2022-03-06 06:53:45 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "lapce";
|
2022-05-13 04:20:00 +00:00
|
|
|
version = "0.1.0";
|
2022-03-06 06:53:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lapce";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-05-13 04:20:00 +00:00
|
|
|
sha256 = "sha256-KSumy7M7VNUib4CZ0ikBboEFMzDQt4xW+aUFHOi+0pA=";
|
2022-03-06 06:53:45 +00:00
|
|
|
};
|
|
|
|
|
2022-05-13 04:20:00 +00:00
|
|
|
cargoSha256 = "sha256-7SVTcH9/Ilq8HcpJJI0KFiQA076lR2CAIBwmTVgmnjE=";
|
2022-03-06 06:53:45 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
python3
|
|
|
|
perl
|
|
|
|
copyDesktopItems
|
|
|
|
];
|
|
|
|
|
2022-04-23 04:20:00 +00:00
|
|
|
# Get openssl-sys to use pkg-config
|
|
|
|
OPENSSL_NO_VENDOR = 1;
|
|
|
|
|
2022-03-06 06:53:45 +00:00
|
|
|
buildInputs = [
|
2022-04-23 04:20:00 +00:00
|
|
|
openssl
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2022-03-06 06:53:45 +00:00
|
|
|
freetype
|
|
|
|
fontconfig
|
|
|
|
libxkbcommon
|
|
|
|
xcbutil
|
|
|
|
libX11
|
|
|
|
libXcursor
|
|
|
|
libXrandr
|
|
|
|
libXi
|
|
|
|
vulkan-loader
|
2022-04-23 04:20:00 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
libobjc
|
|
|
|
Security
|
|
|
|
CoreServices
|
|
|
|
ApplicationServices
|
|
|
|
Carbon
|
|
|
|
AppKit
|
2022-03-06 06:53:45 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Add missing vulkan dependency to rpath
|
2022-04-23 04:20:00 +00:00
|
|
|
preFixup = lib.optionalString stdenv.isLinux ''
|
2022-03-06 06:53:45 +00:00
|
|
|
patchelf --add-needed ${vulkan-loader}/lib/libvulkan.so.1 $out/bin/lapce
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
install -Dm0644 $src/extra/images/logo.svg $out/share/icons/hicolor/scalable/apps/lapce.svg
|
|
|
|
'';
|
|
|
|
|
|
|
|
desktopItems = [ (makeDesktopItem {
|
|
|
|
name = "lapce";
|
|
|
|
exec = "lapce %F";
|
|
|
|
icon = "lapce";
|
|
|
|
desktopName = "Lapce";
|
|
|
|
comment = meta.description;
|
|
|
|
genericName = "Code Editor";
|
|
|
|
categories = [ "Development" "Utility" "TextEditor" ];
|
|
|
|
}) ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Lightning-fast and Powerful Code Editor written in Rust";
|
|
|
|
homepage = "https://github.com/lapce/lapce";
|
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
maintainers = with maintainers; [ elliot ];
|
|
|
|
};
|
|
|
|
}
|