nixpkgs/pkgs/by-name/oc/oculante/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

91 lines
1.7 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
cmake,
pkg-config,
openssl,
fontconfig,
nasm,
libX11,
libXcursor,
libXrandr,
libXi,
libGL,
libxkbcommon,
wayland,
stdenv,
gtk3,
darwin,
perl,
wrapGAppsHook3,
}:
rustPlatform.buildRustPackage rec {
pname = "oculante";
version = "0.9.1";
src = fetchFromGitHub {
owner = "woelper";
repo = "oculante";
rev = version;
hash = "sha256-6jow0ektqmEcwFEaJgPqhJPs8LlYmPRLE+zqk1T4wDk=";
};
cargoHash = "sha256-0e4FoWhZwq6as0JYHGj1zoAOSr71ztqtWJEY3QXDs9s=";
nativeBuildInputs = [
cmake
pkg-config
nasm
perl
wrapGAppsHook3
];
buildInputs =
[
openssl
fontconfig
]
++ lib.optionals stdenv.hostPlatform.isLinux [
libGL
libX11
libXcursor
libXi
libXrandr
gtk3
libxkbcommon
wayland
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.libobjc
];
checkFlags = [
"--skip=bench"
"--skip=tests::net" # requires network access
"--skip=tests::flathub"
];
postInstall = ''
install -Dm444 $src/res/icons/icon.png -t $out/share/icons/hicolor/128x128/apps/
install -Dm444 $src/res/oculante.desktop -t $out/share/applications
wrapProgram $out/bin/oculante \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libGL ]}
'';
meta = with lib; {
broken = stdenv.hostPlatform.isDarwin;
description = "Minimalistic crossplatform image viewer written in Rust";
homepage = "https://github.com/woelper/oculante";
changelog = "https://github.com/woelper/oculante/blob/${version}/CHANGELOG.md";
license = licenses.mit;
mainProgram = "oculante";
maintainers = with maintainers; [
dit7ya
figsoda
];
};
}