2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, autoPatchelfHook
|
|
|
|
, fetchurl
|
|
|
|
, gmp
|
2020-12-03 08:41:04 +00:00
|
|
|
, less
|
2023-08-04 22:07:22 +00:00
|
|
|
, makeWrapper
|
|
|
|
, ncurses6
|
|
|
|
, stdenv
|
|
|
|
, zlib
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "unison-code-manager";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "M5b";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
src = if stdenv.isDarwin then
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchurl {
|
2023-08-04 22:07:22 +00:00
|
|
|
url = "https://github.com/unisonweb/unison/releases/download/release/${finalAttrs.version}/ucm-macos.tar.gz";
|
|
|
|
hash = "sha256-Uknt1NrywmGs8YovlnN8TU8iaYgT1jeYP4SQCuK1u+I=";
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
fetchurl {
|
2023-08-04 22:07:22 +00:00
|
|
|
url = "https://github.com/unisonweb/unison/releases/download/release/${finalAttrs.version}/ucm-linux.tar.gz";
|
|
|
|
hash = "sha256-CZLGA4fFFysxHkwedC8RBLmHWwr3BM8xqps7hN3TC/g=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# The tarball is just the prebuilt binary, in the archive root.
|
|
|
|
sourceRoot = ".";
|
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ]
|
|
|
|
++ lib.optional (!stdenv.isDarwin) autoPatchelfHook;
|
|
|
|
buildInputs = lib.optionals (!stdenv.isDarwin) [ ncurses6 zlib gmp ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mv ucm $out/bin
|
2021-10-28 06:52:43 +00:00
|
|
|
mv ui $out/ui
|
|
|
|
wrapProgram $out/bin/ucm \
|
|
|
|
--prefix PATH ":" "${lib.makeBinPath [ less ]}" \
|
|
|
|
--set UCM_WEB_UI "$out/ui"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Modern, statically-typed purely functional language";
|
|
|
|
homepage = "https://unisonweb.org/";
|
|
|
|
license = with licenses; [ mit bsd3 ];
|
|
|
|
maintainers = [ maintainers.virusdave ];
|
2022-02-10 20:34:41 +00:00
|
|
|
platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-darwin" ];
|
2023-07-15 17:15:38 +00:00
|
|
|
mainProgram = "ucm";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
})
|