8 , gsettings-desktop-schemas
9 , enableX11 ? !stdenv.hostPlatform.isDarwin
12 stdenv.mkDerivation (finalAttrs: {
16 src = fetchFromGitHub {
19 rev = "v${finalAttrs.version}";
20 hash = "sha256-XCdK38jG7tRI+/Zk72JVY8a/pPJF6KVaf8l2s3hgxLs=";
25 # uimac requires xcode
27 sed -i -e 's/ macuimaybe//' src/Makefile
30 nativeBuildInputs = [ ocamlPackages.ocaml ocamlPackages.findlib ]
31 ++ lib.optionals enableX11 [ copyDesktopItems wrapGAppsHook3 ];
32 buildInputs = lib.optionals enableX11 [ gsettings-desktop-schemas ocamlPackages.lablgtk3 ];
34 makeFlags = [ "PREFIX=$(out)" ]
35 ++ lib.optionals (!ocamlPackages.ocaml.nativeCompilers) [ "NATIVE=false" ];
37 postInstall = lib.optionalString enableX11 ''
38 install -D $src/icons/U.svg $out/share/icons/hicolor/scalable/apps/unison.svg
41 dontStrip = !ocamlPackages.ocaml.nativeCompilers;
43 desktopItems = lib.optional enableX11 (makeDesktopItem {
44 name = finalAttrs.pname;
45 desktopName = "Unison";
46 comment = "Bidirectional file synchronizer";
47 genericName = "File synchronization tool";
50 categories = [ "Utility" "FileTools" "GTK" ];
52 startupWMClass = "Unison";
56 homepage = "https://www.cis.upenn.edu/~bcpierce/unison/";
57 description = "Bidirectional file synchronizer";
58 license = licenses.gpl3Plus;
59 maintainers = with maintainers; [ nevivurn ];
60 platforms = platforms.unix;
61 broken = stdenv.hostPlatform.isDarwin && enableX11; # unison-gui and uimac are broken on darwin
62 mainProgram = if enableX11 then "unison-gui" else "unison";