nixpkgs/pkgs/by-name/un/unison/package.nix
Jan Tojnar eb04659fc2 treewide: wrapGAppsHook → wrapGAppsHook3
This was achieved using the following command:

    sd 'wrapGAppsHook\b' wrapGAppsHook3 (rg -l 'wrapGAppsHook\b')

And then manually reverted the following changes:

- alias in top-level.nix
- function name in wrap-gapps-hook.sh
- comment in postFixup of at-spi2-core
- comment in gtk4
- comment in preFixup of 1password-gui/linux.nix
- comment in postFixup of qgis/unwrapped-ltr.nix and qgis/unwrapped.nix
- comment in postFixup of telegram-desktop
- comment in postFixup of fwupd
- buildCommand of mongodb-compass
- postFixup of xflux-gui
- comment in a patch in kdePackages.kde-gtk-config and plasma5Packages.kde-gtk-config
- description of programs.sway.wrapperFeatures.gtk NixOS option (manual rebuild)
2024-04-27 02:23:22 +02:00

65 lines
1.8 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, ocamlPackages
, copyDesktopItems
, makeDesktopItem
, wrapGAppsHook3
, gsettings-desktop-schemas
, enableX11 ? !stdenv.isDarwin
}:
stdenv.mkDerivation (finalAttrs: {
pname = "unison";
version = "2.53.4";
src = fetchFromGitHub {
owner = "bcpierce00";
repo = "unison";
rev = "v${finalAttrs.version}";
hash = "sha256-nFT6FjlQjh6qx0fepmT4aiQj2SxA7U/as+IU9xXNok0=";
};
strictDeps = true;
# uimac requires xcode
postPatch = ''
sed -i -e 's/ macuimaybe//' src/Makefile
'';
nativeBuildInputs = [ ocamlPackages.ocaml ocamlPackages.findlib ]
++ lib.optionals enableX11 [ copyDesktopItems wrapGAppsHook3 ];
buildInputs = lib.optionals enableX11 [ gsettings-desktop-schemas ocamlPackages.lablgtk3 ];
makeFlags = [ "PREFIX=$(out)" ]
++ lib.optionals (!ocamlPackages.ocaml.nativeCompilers) [ "NATIVE=false" ];
postInstall = lib.optionalString enableX11 ''
install -D $src/icons/U.svg $out/share/icons/hicolor/scalable/apps/unison.svg
'';
dontStrip = !ocamlPackages.ocaml.nativeCompilers;
desktopItems = lib.optional enableX11 (makeDesktopItem {
name = finalAttrs.pname;
desktopName = "Unison";
comment = "Bidirectional file synchronizer";
genericName = "File synchronization tool";
exec = "unison-gui";
icon = "unison";
categories = [ "Utility" "FileTools" "GTK" ];
startupNotify = true;
startupWMClass = "Unison";
});
meta = with lib; {
homepage = "https://www.cis.upenn.edu/~bcpierce/unison/";
description = "Bidirectional file synchronizer";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ viric nevivurn ];
platforms = platforms.unix;
broken = stdenv.isDarwin && enableX11; # unison-gui and uimac are broken on darwin
mainProgram = if enableX11 then "unison-gui" else "unison";
};
})