summary refs log tree commit diff
path: root/pkgs/applications/graphics
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2020-01-02 21:41:13 +0100
committerFrederik Rietdijk <fridh@fridh.nl>2020-01-02 21:41:13 +0100
commitf08e3e38d4bf983480fcde77911136bab70d8e80 (patch)
tree6286ff43b53a5df79fcfcf31d22443a18f0455ee /pkgs/applications/graphics
parentbdfb1bd01b2da393a3cdf567764a79e418f2b62e (diff)
parent129c73802fdddacb20cf194bd2968d73ebced590 (diff)
downloadnixpkgs-f08e3e38d4bf983480fcde77911136bab70d8e80.tar
nixpkgs-f08e3e38d4bf983480fcde77911136bab70d8e80.tar.gz
nixpkgs-f08e3e38d4bf983480fcde77911136bab70d8e80.tar.bz2
nixpkgs-f08e3e38d4bf983480fcde77911136bab70d8e80.tar.lz
nixpkgs-f08e3e38d4bf983480fcde77911136bab70d8e80.tar.xz
nixpkgs-f08e3e38d4bf983480fcde77911136bab70d8e80.tar.zst
nixpkgs-f08e3e38d4bf983480fcde77911136bab70d8e80.zip
Merge master into staging-next
Diffstat (limited to 'pkgs/applications/graphics')
-rw-r--r--pkgs/applications/graphics/rx/default.nix93
1 files changed, 40 insertions, 53 deletions
diff --git a/pkgs/applications/graphics/rx/default.nix b/pkgs/applications/graphics/rx/default.nix
index 4e8519d17b6..cc5d00d64ec 100644
--- a/pkgs/applications/graphics/rx/default.nix
+++ b/pkgs/applications/graphics/rx/default.nix
@@ -3,56 +3,43 @@
 , xorg ? null
 , vulkan-loader ? null }:
 
-assert stdenv.isLinux -> xorg != null;
-assert stdenv.isLinux -> vulkan-loader != null;
-
-let
-    graphicsBackend = if stdenv.isDarwin then "metal" else "vulkan";
-in
-  with stdenv.lib;
-  rustPlatform.buildRustPackage rec {
-    pname = "rx";
-    version = "0.2.0";
-
-    src = fetchFromGitHub {
-      owner = "cloudhead";
-      repo = pname;
-      rev = "v${version}";
-      sha256 = "0f6cw8zqr45bprj8ibhp89bb2a077g4zinfrdn943csdmh47qzcl";
-    };
-
-    cargoSha256 = "05bqsw0nw24xysq86qa3hx9b5ncf50wfxsgpy388yrs2dfnphwlx";
-
-    nativeBuildInputs = [ cmake pkgconfig makeWrapper ];
-
-    buildInputs = optionals stdenv.isLinux
-    (with xorg; [
-      # glfw-sys dependencies:
-      libX11 libXrandr libXinerama libXcursor libXi libXext
-    ]);
-
-    cargoBuildFlags = [ "--features=${graphicsBackend}" ];
-
-    # TODO: better to factor that into the rust platform
-    checkPhase = ''
-      runHook preCheck
-      echo "Running cargo test"
-      cargo test --features=${graphicsBackend}
-      runHook postCheck
-    '';
-
-    postInstall = optional stdenv.isLinux ''
-      mkdir -p $out/share/applications
-      cp $src/rx.desktop $out/share/applications
-      wrapProgram $out/bin/rx --prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib
-    '';
-
-    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;
-    };
-  }
+with stdenv.lib;
+
+rustPlatform.buildRustPackage rec {
+  pname = "rx";
+  version = "0.3.0";
+
+  src = fetchFromGitHub {
+    owner = "cloudhead";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0mhpq9x54d884ydmfv1358sgc4jc7bghfx2y0k7p879hyyxr52v1";
+  };
+
+  cargoSha256 = "0fnrgijfkvapj1yyy9grnqh2vkciisf029af0gfwyzsxzdi62gg5";
+
+  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
+    wrapProgram $out/bin/rx --prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib
+  '';
+
+  meta = {
+    description = "Modern and extensible pixel editor implemented in Rust";
+    homepage = "https://cloudhead.io/rx/";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ minijackson filalex77 ];
+    platforms = [ "x86_64-linux" ];
+  };
+}