nixpkgs/pkgs/by-name/un/unison-ucm/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

60 lines
1.8 KiB
Nix

{ lib
, autoPatchelfHook
, fetchurl
, gmp
, less
, makeWrapper
, libb2
, ncurses6
, openssl
, stdenv
, zlib
}:
stdenv.mkDerivation (finalAttrs: {
pname = "unison-code-manager";
version = "0.5.27";
src = if stdenv.hostPlatform.isDarwin then
fetchurl {
url = "https://github.com/unisonweb/unison/releases/download/release/${finalAttrs.version}/ucm-macos.tar.gz";
hash = "sha256-bmEmox+CfkGZP9GCfwDyspTult0WV+6jfQzehT33p8U=";
}
else
fetchurl {
url = "https://github.com/unisonweb/unison/releases/download/release/${finalAttrs.version}/ucm-linux.tar.gz";
hash = "sha256-js7MgzJQShy6z1QNsIRwjtZfrNOGwUA001SWlKWgMoA=";
};
# The tarball is just the prebuilt binary, in the archive root.
sourceRoot = ".";
dontBuild = true;
dontConfigure = true;
nativeBuildInputs = [ makeWrapper ]
++ lib.optional (!stdenv.hostPlatform.isDarwin) autoPatchelfHook;
buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ gmp ncurses6 zlib ];
installPhase = ''
mkdir -p $out/{bin,lib}
mv runtime $out/lib/runtime
mv ui $out/ui
mv unison $out/unison
makeWrapper $out/unison/unison $out/bin/ucm \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libb2 openssl ]} \
--prefix PATH ":" "${lib.makeBinPath [ less ]}" \
--add-flags "--runtime-path $out/lib/runtime/bin/unison-runtime" \
--set UCM_WEB_UI "$out/ui"
'';
meta = with lib; {
description = "Modern, statically-typed purely functional language";
homepage = "https://unisonweb.org/";
license = with licenses; [ mit bsd3 ];
mainProgram = "ucm";
maintainers = with maintainers; [ ceedubs sellout virusdave ];
platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-darwin" ];
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
};
})