2020-12-28 20:14:17 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, installShellFiles
|
|
|
|
, makeWrapper
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, libGL
|
|
|
|
, libX11
|
|
|
|
, libXcursor
|
|
|
|
, libXi
|
|
|
|
, libXrandr
|
|
|
|
, libXxf86vm
|
|
|
|
, libxcb
|
|
|
|
, libxkbcommon
|
|
|
|
, wayland
|
|
|
|
, AppKit
|
|
|
|
, CoreGraphics
|
|
|
|
, CoreServices
|
|
|
|
, Foundation
|
|
|
|
, OpenGL
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
rpathLibs = [
|
|
|
|
libGL
|
|
|
|
libX11
|
|
|
|
libXcursor
|
|
|
|
libXi
|
|
|
|
libXrandr
|
|
|
|
libXxf86vm
|
|
|
|
libxcb
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
libxkbcommon
|
|
|
|
wayland
|
|
|
|
];
|
|
|
|
in
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "emulsion";
|
2021-05-09 03:58:23 +00:00
|
|
|
version = "9.0";
|
2020-12-28 20:14:17 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ArturKovacs";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-05-09 03:58:23 +00:00
|
|
|
sha256 = "sha256-Cdi+PQDHxMQG7t7iwDi6UWfDwQjjA2yiOf9p/ahBlOw=";
|
2020-12-28 20:14:17 +00:00
|
|
|
};
|
|
|
|
|
2021-05-09 03:58:23 +00:00
|
|
|
cargoSha256 = "sha256-2wiLamnGqACx1r4WJbWPCN3tvhww/rRWz8fcvAbjYE0=";
|
2020-12-28 20:14:17 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
makeWrapper
|
|
|
|
pkg-config
|
|
|
|
python3
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = rpathLibs ++ lib.optionals stdenv.isDarwin [
|
|
|
|
AppKit
|
|
|
|
CoreGraphics
|
|
|
|
CoreServices
|
|
|
|
Foundation
|
|
|
|
OpenGL
|
|
|
|
];
|
|
|
|
|
2021-05-07 18:26:15 +00:00
|
|
|
postFixup = lib.optionalString stdenv.isLinux ''
|
|
|
|
patchelf --set-rpath "${lib.makeLibraryPath rpathLibs}" $out/bin/emulsion
|
2020-12-28 20:14:17 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A fast and minimalistic image viewer";
|
|
|
|
homepage = "https://arturkovacs.github.io/emulsion-website/";
|
|
|
|
maintainers = [ maintainers.magnetophon ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|