2019-09-29 23:58:05 +02:00
|
|
|
{ stdenv, rustPlatform, fetchFromGitHub, makeWrapper
|
2020-03-15 11:49:34 +01:00
|
|
|
, cmake, pkg-config
|
2019-09-29 23:58:05 +02:00
|
|
|
, xorg ? null
|
2020-01-11 13:38:14 +01:00
|
|
|
, libGL ? null }:
|
2019-09-29 23:58:05 +02:00
|
|
|
|
2019-12-30 16:21:00 +01:00
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "rx";
|
2020-03-15 11:49:34 +01:00
|
|
|
version = "0.4.0";
|
2019-12-30 16:21:00 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cloudhead";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-03-15 11:49:34 +01:00
|
|
|
sha256 = "1pln65pqy39ijrld11d06klwzfhhzmrgdaxijpx9q7w9z66zmqb8";
|
2019-12-30 16:21:00 +01:00
|
|
|
};
|
|
|
|
|
2020-03-15 11:49:34 +01:00
|
|
|
cargoSha256 = "143a5x61s7ywk0ljqd10jkfvs6lrhlibkm2a9lw41wq13mgzb78j";
|
2019-12-30 16:21:00 +01:00
|
|
|
|
2020-03-15 11:49:34 +01:00
|
|
|
nativeBuildInputs = [ cmake pkg-config makeWrapper ];
|
2019-12-30 16:21:00 +01: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;
|
|
|
|
|
|
|
|
postInstall = optional stdenv.isLinux ''
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
cp $src/rx.desktop $out/share/applications
|
2020-01-11 13:38:14 +01:00
|
|
|
wrapProgram $out/bin/rx --prefix LD_LIBRARY_PATH : ${libGL}/lib
|
2019-12-30 16:21:00 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Modern and extensible pixel editor implemented in Rust";
|
2020-03-15 11:49:34 +01:00
|
|
|
homepage = "https://rx.cloudhead.io/";
|
2019-12-30 16:21:00 +01:00
|
|
|
license = licenses.gpl3;
|
2019-12-30 16:23:17 +01:00
|
|
|
maintainers = with maintainers; [ minijackson filalex77 ];
|
2019-12-30 18:31:59 +01:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2019-12-30 16:21:00 +01:00
|
|
|
};
|
|
|
|
}
|