commit
ee562e5413
@ -3,56 +3,43 @@
|
|||||||
, xorg ? null
|
, xorg ? null
|
||||||
, vulkan-loader ? null }:
|
, vulkan-loader ? null }:
|
||||||
|
|
||||||
assert stdenv.isLinux -> xorg != null;
|
with stdenv.lib;
|
||||||
assert stdenv.isLinux -> vulkan-loader != null;
|
|
||||||
|
|
||||||
let
|
rustPlatform.buildRustPackage rec {
|
||||||
graphicsBackend = if stdenv.isDarwin then "metal" else "vulkan";
|
pname = "rx";
|
||||||
in
|
version = "0.3.0";
|
||||||
with stdenv.lib;
|
|
||||||
rustPlatform.buildRustPackage rec {
|
|
||||||
pname = "rx";
|
|
||||||
version = "0.2.0";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "cloudhead";
|
owner = "cloudhead";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "0f6cw8zqr45bprj8ibhp89bb2a077g4zinfrdn943csdmh47qzcl";
|
sha256 = "0mhpq9x54d884ydmfv1358sgc4jc7bghfx2y0k7p879hyyxr52v1";
|
||||||
};
|
};
|
||||||
|
|
||||||
cargoSha256 = "05bqsw0nw24xysq86qa3hx9b5ncf50wfxsgpy388yrs2dfnphwlx";
|
cargoSha256 = "0fnrgijfkvapj1yyy9grnqh2vkciisf029af0gfwyzsxzdi62gg5";
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake pkgconfig makeWrapper ];
|
nativeBuildInputs = [ cmake pkgconfig makeWrapper ];
|
||||||
|
|
||||||
buildInputs = optionals stdenv.isLinux
|
buildInputs = optionals stdenv.isLinux
|
||||||
(with xorg; [
|
(with xorg; [
|
||||||
# glfw-sys dependencies:
|
# glfw-sys dependencies:
|
||||||
libX11 libXrandr libXinerama libXcursor libXi libXext
|
libX11 libXrandr libXinerama libXcursor libXi libXext
|
||||||
]);
|
]);
|
||||||
|
|
||||||
cargoBuildFlags = [ "--features=${graphicsBackend}" ];
|
# FIXME: GLFW (X11) requires DISPLAY env variable for all tests
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
# TODO: better to factor that into the rust platform
|
postInstall = optional stdenv.isLinux ''
|
||||||
checkPhase = ''
|
mkdir -p $out/share/applications
|
||||||
runHook preCheck
|
cp $src/rx.desktop $out/share/applications
|
||||||
echo "Running cargo test"
|
wrapProgram $out/bin/rx --prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib
|
||||||
cargo test --features=${graphicsBackend}
|
'';
|
||||||
runHook postCheck
|
|
||||||
'';
|
|
||||||
|
|
||||||
postInstall = optional stdenv.isLinux ''
|
meta = {
|
||||||
mkdir -p $out/share/applications
|
description = "Modern and extensible pixel editor implemented in Rust";
|
||||||
cp $src/rx.desktop $out/share/applications
|
homepage = "https://cloudhead.io/rx/";
|
||||||
wrapProgram $out/bin/rx --prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib
|
license = licenses.gpl3;
|
||||||
'';
|
maintainers = with maintainers; [ minijackson filalex77 ];
|
||||||
|
platforms = [ "x86_64-linux" ];
|
||||||
meta = {
|
};
|
||||||
description = "Modern and extensible pixel editor implemented in Rust";
|
}
|
||||||
homepage = "https://cloudhead.io/rx/";
|
|
||||||
license = licenses.gpl3;
|
|
||||||
maintainers = with maintainers; [ minijackson ];
|
|
||||||
platforms = with platforms; (linux ++ darwin ++ windows);
|
|
||||||
inherit version;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user