nixpkgs/pkgs/by-name/xp/xplr/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.4 KiB
Nix
Raw Normal View History

{ lib, stdenv, rustPlatform, fetchFromGitHub }:
2021-04-20 20:28:35 +00:00
rustPlatform.buildRustPackage rec {
2021-05-08 15:05:47 +00:00
pname = "xplr";
2024-03-18 21:16:18 +00:00
version = "0.21.7";
2021-04-20 20:28:35 +00:00
2021-10-24 06:36:07 +00:00
src = fetchFromGitHub {
owner = "sayanarijit";
repo = pname;
rev = "v${version}";
2024-03-18 21:16:18 +00:00
sha256 = "sha256-ZitwO/XfNrlTFNepQ5Wyk1A7cwlNm6+26nPHdZ8Wh3c=";
2021-04-20 20:28:35 +00:00
};
2024-03-18 21:16:18 +00:00
cargoHash = "sha256-mfSVjm0s/tLjjygwu8TuKn92mFM3Ui6TEHkIzS0eEOA=";
# 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 20:28:35 +00:00
2023-09-22 22:23:32 +00:00
postInstall = ''
2023-12-26 21:04:10 +00:00
mkdir -p $out/share/applications
cp assets/desktop/xplr.desktop $out/share/applications
2023-09-22 22:23:32 +00: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 20:28:35 +00:00
meta = with lib; {
description = "A hackable, minimal, fast TUI file explorer";
mainProgram = "xplr";
2022-05-29 14:59:48 +00:00
homepage = "https://xplr.dev";
2023-08-22 15:58:36 +00:00
changelog = "https://github.com/sayanarijit/xplr/releases/tag/${src.rev}";
2021-04-20 20:28:35 +00:00
license = licenses.mit;
2023-08-22 15:58:36 +00:00
maintainers = with maintainers; [ sayanarijit suryasr007 thehedgeh0g mimame figsoda ];
2021-04-20 20:28:35 +00:00
};
}