9 gsettings-desktop-schemas,
10 enableX11 ? !stdenv.hostPlatform.isDarwin,
13 stdenv.mkDerivation (finalAttrs: {
17 src = fetchFromGitHub {
20 rev = "v${finalAttrs.version}";
21 hash = "sha256-QmYcxzsnbRDQdqkLh82OLWrLF6v3qzf1aOIcnz0kwEk=";
31 ++ lib.optionals enableX11 [
35 buildInputs = lib.optionals enableX11 [
36 gsettings-desktop-schemas
37 ocamlPackages.lablgtk3
42 ] ++ lib.optionals (!ocamlPackages.ocaml.nativeCompilers) [ "NATIVE=false" ];
44 postInstall = lib.optionalString enableX11 ''
45 install -D $src/icons/U.svg $out/share/icons/hicolor/scalable/apps/unison.svg
48 dontStrip = !ocamlPackages.ocaml.nativeCompilers;
50 desktopItems = lib.optional enableX11 (makeDesktopItem {
51 name = finalAttrs.pname;
52 desktopName = "Unison";
53 comment = "Bidirectional file synchronizer";
54 genericName = "File synchronization tool";
63 startupWMClass = "Unison";
67 homepage = "https://www.cis.upenn.edu/~bcpierce/unison/";
68 description = "Bidirectional file synchronizer";
69 license = lib.licenses.gpl3Plus;
70 maintainers = with lib.maintainers; [ nevivurn ];
71 platforms = lib.platforms.unix;
72 broken = stdenv.hostPlatform.isDarwin && enableX11; # unison-gui and uimac are broken on darwin
73 mainProgram = if enableX11 then "unison-gui" else "unison";