2021-07-29 12:14:35 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, ocamlPackages
|
|
|
|
, copyDesktopItems
|
|
|
|
, makeDesktopItem
|
2024-04-26 20:24:03 +00:00
|
|
|
, wrapGAppsHook3
|
2023-02-01 11:05:21 +00:00
|
|
|
, gsettings-desktop-schemas
|
2024-02-19 23:08:50 +00:00
|
|
|
, enableX11 ? !stdenv.isDarwin
|
2021-07-29 12:14:35 +00:00
|
|
|
}:
|
2008-06-04 14:24:28 +00:00
|
|
|
|
2023-06-09 23:01:06 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "unison";
|
2024-05-07 03:17:29 +00:00
|
|
|
version = "2.53.5";
|
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}";
|
2024-05-07 03:17:29 +00:00
|
|
|
hash = "sha256-XCdK38jG7tRI+/Zk72JVY8a/pPJF6KVaf8l2s3hgxLs=";
|
2007-08-10 08:21:31 +00:00
|
|
|
};
|
|
|
|
|
2022-04-04 11:57:15 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2024-02-19 23:08:50 +00:00
|
|
|
# uimac requires xcode
|
|
|
|
postPatch = ''
|
|
|
|
sed -i -e 's/ macuimaybe//' src/Makefile
|
2017-02-03 23:37:31 +00:00
|
|
|
'';
|
2011-01-03 18:43:16 +00:00
|
|
|
|
2024-02-19 23:08:50 +00:00
|
|
|
nativeBuildInputs = [ ocamlPackages.ocaml ocamlPackages.findlib ]
|
2024-04-26 20:24:03 +00:00
|
|
|
++ lib.optionals enableX11 [ copyDesktopItems wrapGAppsHook3 ];
|
2024-02-19 23:08:50 +00:00
|
|
|
buildInputs = lib.optionals enableX11 [ gsettings-desktop-schemas ocamlPackages.lablgtk3 ];
|
2011-01-03 18:43:16 +00:00
|
|
|
|
2024-02-19 23:08:50 +00:00
|
|
|
makeFlags = [ "PREFIX=$(out)" ]
|
|
|
|
++ lib.optionals (!ocamlPackages.ocaml.nativeCompilers) [ "NATIVE=false" ];
|
2011-01-03 18:43:16 +00:00
|
|
|
|
2021-07-29 12:14:35 +00:00
|
|
|
postInstall = lib.optionalString enableX11 ''
|
2021-07-23 05:18:56 +00:00
|
|
|
install -D $src/icons/U.svg $out/share/icons/hicolor/scalable/apps/unison.svg
|
|
|
|
'';
|
2008-06-04 14:24:28 +00:00
|
|
|
|
2021-07-29 12:14:35 +00:00
|
|
|
dontStrip = !ocamlPackages.ocaml.nativeCompilers;
|
2011-01-03 20:52:49 +00:00
|
|
|
|
2021-07-29 12:14:35 +00:00
|
|
|
desktopItems = lib.optional enableX11 (makeDesktopItem {
|
2023-06-09 23:01:06 +00:00
|
|
|
name = finalAttrs.pname;
|
2021-07-23 05:18:56 +00:00
|
|
|
desktopName = "Unison";
|
|
|
|
comment = "Bidirectional file synchronizer";
|
|
|
|
genericName = "File synchronization tool";
|
2024-02-19 23:08:50 +00:00
|
|
|
exec = "unison-gui";
|
2021-07-23 05:18:56 +00:00
|
|
|
icon = "unison";
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "Utility" "FileTools" "GTK" ];
|
|
|
|
startupNotify = true;
|
|
|
|
startupWMClass = "Unison";
|
2021-07-23 05:18:56 +00:00
|
|
|
});
|
|
|
|
|
2021-07-29 12:14:35 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.cis.upenn.edu/~bcpierce/unison/";
|
2010-01-15 15:09:46 +00:00
|
|
|
description = "Bidirectional file synchronizer";
|
2021-07-29 12:14:35 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2024-02-19 23:08:50 +00:00
|
|
|
maintainers = with maintainers; [ viric nevivurn ];
|
2021-07-29 12:14:35 +00:00
|
|
|
platforms = platforms.unix;
|
2024-02-19 23:08:50 +00:00
|
|
|
broken = stdenv.isDarwin && enableX11; # unison-gui and uimac are broken on darwin
|
|
|
|
mainProgram = if enableX11 then "unison-gui" else "unison";
|
2010-01-15 15:09:46 +00:00
|
|
|
};
|
2023-06-09 23:01:06 +00:00
|
|
|
})
|