2021-01-15 13:21:58 +00:00
|
|
|
{ lib, stdenv, rustPlatform, fetchFromGitHub, makeWrapper
|
2020-03-15 10:49:34 +00:00
|
|
|
, cmake, pkg-config
|
2019-09-29 21:58:05 +00:00
|
|
|
, xorg ? null
|
2020-01-11 12:38:14 +00:00
|
|
|
, libGL ? null }:
|
2019-09-29 21:58:05 +00:00
|
|
|
|
2021-01-15 13:21:58 +00:00
|
|
|
with lib;
|
2019-12-30 15:21:00 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "rx";
|
2021-08-17 21:04:11 +00:00
|
|
|
version = "0.5.2";
|
2019-12-30 15:21:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cloudhead";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-08-17 21:04:11 +00:00
|
|
|
sha256 = "sha256-LTpaV/fgYUgA2M6Wz5qLHnTNywh13900g+umhgLvciM=";
|
2019-12-30 15:21:00 +00:00
|
|
|
};
|
|
|
|
|
2021-08-17 21:04:11 +00:00
|
|
|
cargoSha256 = "sha256-4hi1U4jl6QA7H8AKHlU+Hqz5iKGYHRXHDsrcqY7imkU=";
|
2019-12-30 15:21:00 +00:00
|
|
|
|
2020-03-15 10:49:34 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config makeWrapper ];
|
2019-12-30 15:21:00 +00:00
|
|
|
|
|
|
|
buildInputs = optionals stdenv.isLinux
|
|
|
|
(with xorg; [
|
|
|
|
# glfw-sys dependencies:
|
|
|
|
libX11 libXrandr libXinerama libXcursor libXi libXext
|
|
|
|
]);
|
|
|
|
|
|
|
|
# FIXME: GLFW (X11) requires DISPLAY env variable for all tests
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-08-18 00:14:20 +00:00
|
|
|
postInstall = optionalString stdenv.isLinux ''
|
2019-12-30 15:21:00 +00:00
|
|
|
mkdir -p $out/share/applications
|
|
|
|
cp $src/rx.desktop $out/share/applications
|
2020-01-11 12:38:14 +00:00
|
|
|
wrapProgram $out/bin/rx --prefix LD_LIBRARY_PATH : ${libGL}/lib
|
2019-12-30 15:21:00 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Modern and extensible pixel editor implemented in Rust";
|
2020-03-15 10:49:34 +00:00
|
|
|
homepage = "https://rx.cloudhead.io/";
|
2019-12-30 15:21:00 +00:00
|
|
|
license = licenses.gpl3;
|
2020-11-17 11:02:06 +00:00
|
|
|
maintainers = with maintainers; [ minijackson Br1ght0ne ];
|
2019-12-30 17:31:59 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2019-12-30 15:21:00 +00:00
|
|
|
};
|
|
|
|
}
|