nixpkgs/pkgs/by-name/un/unison/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

76 lines
1.8 KiB
Nix
Raw Normal View History

2024-11-15 12:10:50 +00:00
{
lib,
stdenv,
fetchFromGitHub,
ocamlPackages,
copyDesktopItems,
makeDesktopItem,
wrapGAppsHook3,
gsettings-desktop-schemas,
enableX11 ? !stdenv.hostPlatform.isDarwin,
2021-07-29 12:14:35 +00:00
}:
2023-06-09 23:01:06 +00:00
stdenv.mkDerivation (finalAttrs: {
pname = "unison";
version = "2.53.7";
2021-07-29 12:14:35 +00:00
2019-02-13 11:25:01 +00:00
src = fetchFromGitHub {
owner = "bcpierce00";
repo = "unison";
2023-06-09 23:01:06 +00:00
rev = "v${finalAttrs.version}";
hash = "sha256-QmYcxzsnbRDQdqkLh82OLWrLF6v3qzf1aOIcnz0kwEk=";
};
strictDeps = true;
2024-11-15 12:10:50 +00:00
nativeBuildInputs =
[
ocamlPackages.ocaml
ocamlPackages.findlib
]
++ lib.optionals enableX11 [
copyDesktopItems
wrapGAppsHook3
];
buildInputs = lib.optionals enableX11 [
gsettings-desktop-schemas
ocamlPackages.lablgtk3
];
2024-11-15 12:10:50 +00:00
makeFlags = [
"PREFIX=$(out)"
] ++ lib.optionals (!ocamlPackages.ocaml.nativeCompilers) [ "NATIVE=false" ];
2021-07-29 12:14:35 +00:00
postInstall = lib.optionalString enableX11 ''
install -D $src/icons/U.svg $out/share/icons/hicolor/scalable/apps/unison.svg
'';
2021-07-29 12:14:35 +00:00
dontStrip = !ocamlPackages.ocaml.nativeCompilers;
2021-07-29 12:14:35 +00:00
desktopItems = lib.optional enableX11 (makeDesktopItem {
2023-06-09 23:01:06 +00:00
name = finalAttrs.pname;
desktopName = "Unison";
comment = "Bidirectional file synchronizer";
genericName = "File synchronization tool";
2024-02-19 23:08:50 +00:00
exec = "unison-gui";
icon = "unison";
2024-11-15 12:10:50 +00:00
categories = [
"Utility"
"FileTools"
"GTK"
];
startupNotify = true;
startupWMClass = "Unison";
});
2024-11-15 12:10:08 +00:00
meta = {
homepage = "https://www.cis.upenn.edu/~bcpierce/unison/";
description = "Bidirectional file synchronizer";
2024-11-15 12:10:08 +00:00
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ nevivurn ];
platforms = lib.platforms.unix;
2024-02-19 23:08:50 +00:00
broken = stdenv.hostPlatform.isDarwin && enableX11; # unison-gui and uimac are broken on darwin
mainProgram = if enableX11 then "unison-gui" else "unison";
};
2023-06-09 23:01:06 +00:00
})