mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 18:33:00 +00:00
55 lines
1.5 KiB
Nix
55 lines
1.5 KiB
Nix
{ lib
|
|
, autoPatchelfHook
|
|
, fetchurl
|
|
, gmp
|
|
, less
|
|
, makeWrapper
|
|
, ncurses6
|
|
, stdenv
|
|
, zlib
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "unison-code-manager";
|
|
version = "0.5.19";
|
|
|
|
src = if stdenv.isDarwin then
|
|
fetchurl {
|
|
url = "https://github.com/unisonweb/unison/releases/download/release/${finalAttrs.version}/ucm-macos.tar.gz";
|
|
hash = "sha256-//bjpmW45BqBHmBIj2uMahYQYjhNJ8hvGh+O/7oYQOk=";
|
|
}
|
|
else
|
|
fetchurl {
|
|
url = "https://github.com/unisonweb/unison/releases/download/release/${finalAttrs.version}/ucm-linux.tar.gz";
|
|
hash = "sha256-3WyiV6mIuo5GDpDK/KdWMvj22sZ3uph15u3v3TX5YZA=";
|
|
};
|
|
|
|
# The tarball is just the prebuilt binary, in the archive root.
|
|
sourceRoot = ".";
|
|
dontBuild = true;
|
|
dontConfigure = true;
|
|
|
|
nativeBuildInputs = [ makeWrapper ]
|
|
++ lib.optional (!stdenv.isDarwin) autoPatchelfHook;
|
|
buildInputs = lib.optionals (!stdenv.isDarwin) [ ncurses6 zlib gmp ];
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
mv ucm $out/bin
|
|
mv ui $out/ui
|
|
wrapProgram $out/bin/ucm \
|
|
--prefix PATH ":" "${lib.makeBinPath [ less ]}" \
|
|
--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 = [ maintainers.virusdave ];
|
|
platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-darwin" ];
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
|
};
|
|
})
|