2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, autoPatchelfHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, ncurses5, zlib, gmp
|
2020-12-03 08:41:04 +00:00
|
|
|
, makeWrapper
|
|
|
|
, less
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "unison-code-manager";
|
2022-11-04 12:27:35 +00:00
|
|
|
milestone_id = "M4c";
|
2020-04-24 23:36:52 +00:00
|
|
|
version = "1.0.${milestone_id}-alpha";
|
|
|
|
|
|
|
|
src = if (stdenv.isDarwin) then
|
|
|
|
fetchurl {
|
2021-06-28 23:13:55 +00:00
|
|
|
url = "https://github.com/unisonweb/unison/releases/download/release/${milestone_id}/ucm-macos.tar.gz";
|
2022-11-04 12:27:35 +00:00
|
|
|
sha256 = "sha256-mkzIC/cPkpH0obEBqkvvKVh74LaV6jkfyEMLHmJn/nE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
fetchurl {
|
2021-06-28 23:13:55 +00:00
|
|
|
url = "https://github.com/unisonweb/unison/releases/download/release/${milestone_id}/ucm-linux.tar.gz";
|
2022-11-04 12:27:35 +00:00
|
|
|
sha256 = "sha256-LfT/pMOvfBAwew6NW0VNvuB5c1AC7b+qKraP25+kytg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# The tarball is just the prebuilt binary, in the archive root.
|
|
|
|
sourceRoot = ".";
|
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ] ++ (lib.optional (!stdenv.isDarwin) autoPatchelfHook);
|
|
|
|
buildInputs = lib.optionals (!stdenv.isDarwin) [ ncurses5 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" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|