nixpkgs/pkgs/development/compilers/unison/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.5 KiB
Nix
Raw Normal View History

{ lib
, autoPatchelfHook
, fetchurl
, gmp
, less
, makeWrapper
, ncurses6
, stdenv
, zlib
2019-08-07 06:37:46 +02:00
}:
2023-06-13 14:31:54 +02:00
stdenv.mkDerivation (finalAttrs: {
2019-08-07 06:37:46 +02:00
pname = "unison-code-manager";
2023-12-21 22:50:13 +01:00
version = "0.5.12";
2019-08-07 06:37:46 +02:00
src = if stdenv.isDarwin then
2019-08-07 06:37:46 +02:00
fetchurl {
url = "https://github.com/unisonweb/unison/releases/download/release/${finalAttrs.version}/ucm-macos.tar.gz";
2023-12-21 22:50:13 +01:00
hash = "sha256-naX80UdSAwFAGS04Zd5VyVS2KQWnotE4+mJxWYRXXNU=";
2019-08-07 06:37:46 +02:00
}
else
fetchurl {
url = "https://github.com/unisonweb/unison/releases/download/release/${finalAttrs.version}/ucm-linux.tar.gz";
2023-12-21 22:50:13 +01:00
hash = "sha256-RD6pHDQI8ssU/E8LzLXmqtedLCL5wZV/bO3KHIWiYN8=";
2019-08-07 06:37:46 +02:00
};
# The tarball is just the prebuilt binary, in the archive root.
sourceRoot = ".";
dontBuild = true;
dontConfigure = true;
nativeBuildInputs = [ makeWrapper ]
++ lib.optional (!stdenv.isDarwin) autoPatchelfHook;
2023-07-19 00:14:55 +02:00
buildInputs = lib.optionals (!stdenv.isDarwin) [ ncurses6 zlib gmp ];
2019-08-07 06:37:46 +02:00
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"
2019-08-07 06:37:46 +02:00
'';
meta = with lib; {
2019-08-07 06:37:46 +02:00
description = "Modern, statically-typed purely functional language";
homepage = "https://unisonweb.org/";
license = with licenses; [ mit bsd3 ];
2023-08-14 16:22:46 +02:00
mainProgram = "ucm";
2019-08-07 06:37:46 +02:00
maintainers = [ maintainers.virusdave ];
2022-01-29 13:04:58 +01:00
platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-darwin" ];
2023-08-14 16:22:46 +02:00
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
2019-08-07 06:37:46 +02:00
};
2023-06-13 14:31:54 +02:00
})