2019-09-29 22:58:05 +01:00
|
|
|
{ stdenv, rustPlatform, fetchFromGitHub, makeWrapper
|
|
|
|
, cmake, pkgconfig
|
|
|
|
, xorg ? null
|
2020-01-11 12:38:14 +00:00
|
|
|
, libGL ? null }:
|
2019-09-29 22:58:05 +01:00
|
|
|
|
2019-12-30 15:21:00 +00:00
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "rx";
|
2020-01-11 12:38:14 +00:00
|
|
|
version = "0.3.1";
|
2019-12-30 15:21:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cloudhead";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-01-11 12:38:14 +00:00
|
|
|
sha256 = "1byaxbhd3q49473kcdd52rvn3xq7bmy8bdx3pz0jiw96bclzhcgq";
|
2019-12-30 15:21:00 +00:00
|
|
|
};
|
|
|
|
|
2020-01-11 12:38:14 +00:00
|
|
|
cargoSha256 = "173jfjvdag97f6jvfg366hjk9v3cz301cbzpcahy51rbf1cip1w1";
|
2019-12-30 15:21:00 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkgconfig makeWrapper ];
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
postInstall = optional stdenv.isLinux ''
|
|
|
|
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";
|
|
|
|
homepage = "https://cloudhead.io/rx/";
|
|
|
|
license = licenses.gpl3;
|
2019-12-30 15:23:17 +00:00
|
|
|
maintainers = with maintainers; [ minijackson filalex77 ];
|
2019-12-30 17:31:59 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2019-12-30 15:21:00 +00:00
|
|
|
};
|
|
|
|
}
|