2023-08-22 17:57:51 +02:00
|
|
|
{ lib, stdenv, rustPlatform, fetchFromGitHub }:
|
2021-04-20 22:28:35 +02:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2021-05-08 17:05:47 +02:00
|
|
|
pname = "xplr";
|
2024-01-04 06:23:15 +01:00
|
|
|
version = "0.21.5";
|
2021-04-20 22:28:35 +02:00
|
|
|
|
2021-10-24 08:36:07 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sayanarijit";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-01-04 06:23:15 +01:00
|
|
|
sha256 = "sha256-Ofr9xJH/wVlBJ1n1MMecSP8SltYwjdhb7tmkTsOMoX8=";
|
2021-04-20 22:28:35 +02:00
|
|
|
};
|
|
|
|
|
2024-01-04 06:23:15 +01:00
|
|
|
cargoHash = "sha256-1wzqWGp0qPn2sQ1v0+6NAxvIxqCIVuN0WwpNddj71Xc=";
|
2023-04-23 18:27:50 +02:00
|
|
|
|
2023-08-22 17:57:51 +02:00
|
|
|
# fixes `thread 'main' panicked at 'cannot find strip'` on x86_64-darwin
|
|
|
|
env = lib.optionalAttrs (stdenv.isx86_64 && stdenv.isDarwin) {
|
|
|
|
TARGET_STRIP = "${stdenv.cc.targetPrefix}strip";
|
|
|
|
};
|
|
|
|
|
|
|
|
# error: linker `aarch64-linux-gnu-gcc` not found
|
|
|
|
postPatch = ''
|
|
|
|
rm .cargo/config
|
|
|
|
'';
|
2021-04-20 22:28:35 +02:00
|
|
|
|
2023-09-23 00:23:32 +02:00
|
|
|
postInstall = ''
|
2023-12-26 22:04:10 +01:00
|
|
|
mkdir -p $out/share/applications
|
|
|
|
cp assets/desktop/xplr.desktop $out/share/applications
|
2023-09-23 00:23:32 +02:00
|
|
|
|
|
|
|
mkdir -p $out/share/icons/hicolor/scalable/apps
|
|
|
|
cp assets/icon/xplr.svg $out/share/icons/hicolor/scalable/apps
|
|
|
|
|
|
|
|
for size in 16 32 64 128; do
|
|
|
|
icon_dir=$out/share/icons/hicolor/''${size}x$size/apps
|
|
|
|
mkdir -p $icon_dir
|
|
|
|
cp assets/icon/xplr$size.png $icon_dir/xplr.png
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-04-20 22:28:35 +02:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A hackable, minimal, fast TUI file explorer";
|
2022-05-29 16:59:48 +02:00
|
|
|
homepage = "https://xplr.dev";
|
2023-08-22 17:58:36 +02:00
|
|
|
changelog = "https://github.com/sayanarijit/xplr/releases/tag/${src.rev}";
|
2021-04-20 22:28:35 +02:00
|
|
|
license = licenses.mit;
|
2023-08-22 17:58:36 +02:00
|
|
|
maintainers = with maintainers; [ sayanarijit suryasr007 thehedgeh0g mimame figsoda ];
|
2021-04-20 22:28:35 +02:00
|
|
|
};
|
|
|
|
}
|