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.

65 lines
1.8 KiB
Nix
Raw Normal View History

2021-07-29 12:14:35 +00:00
{ lib
, stdenv
, fetchFromGitHub
, ocamlPackages
, copyDesktopItems
, makeDesktopItem
, wrapGAppsHook3
, gsettings-desktop-schemas
2024-02-19 23:08:50 +00:00
, enableX11 ? !stdenv.isDarwin
2021-07-29 12:14:35 +00:00
}:
2023-06-09 23:01:06 +00:00
stdenv.mkDerivation (finalAttrs: {
pname = "unison";
2024-02-19 23:08:50 +00:00
version = "2.53.4";
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-02-19 23:08:50 +00:00
hash = "sha256-nFT6FjlQjh6qx0fepmT4aiQj2SxA7U/as+IU9xXNok0=";
};
strictDeps = true;
2024-02-19 23:08:50 +00:00
# uimac requires xcode
postPatch = ''
sed -i -e 's/ macuimaybe//' src/Makefile
'';
2024-02-19 23:08:50 +00:00
nativeBuildInputs = [ ocamlPackages.ocaml ocamlPackages.findlib ]
++ lib.optionals enableX11 [ copyDesktopItems wrapGAppsHook3 ];
2024-02-19 23:08:50 +00:00
buildInputs = lib.optionals enableX11 [ gsettings-desktop-schemas ocamlPackages.lablgtk3 ];
2024-02-19 23:08: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";
categories = [ "Utility" "FileTools" "GTK" ];
startupNotify = true;
startupWMClass = "Unison";
});
2021-07-29 12:14:35 +00:00
meta = with lib; {
homepage = "https://www.cis.upenn.edu/~bcpierce/unison/";
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";
};
2023-06-09 23:01:06 +00:00
})