2021-01-22 11:25:31 +00:00
|
|
|
{ lib, stdenv, fetchurl, autoPatchelfHook
|
2019-08-07 05:37:46 +01:00
|
|
|
, ncurses5, zlib, gmp
|
2020-11-24 21:41:36 +00:00
|
|
|
, makeWrapper
|
|
|
|
, less
|
2019-08-07 05:37:46 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "unison-code-manager";
|
2021-06-09 21:50:01 +01:00
|
|
|
milestone_id = "M2g";
|
2019-08-07 05:37:46 +01:00
|
|
|
version = "1.0.${milestone_id}-alpha";
|
|
|
|
|
|
|
|
src = if (stdenv.isDarwin) then
|
|
|
|
fetchurl {
|
2021-06-09 21:50:01 +01:00
|
|
|
url = "https://github.com/unisonweb/unison/releases/download/release/${milestone_id}/ucm-macos.tar.gz";
|
|
|
|
sha256 = "1ib9pdzrfpzbi35fpwm9ym621nlydplvzgbhnyd86dbwbv3i9sga";
|
2019-08-07 05:37:46 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
fetchurl {
|
2021-06-09 21:50:01 +01:00
|
|
|
url = "https://github.com/unisonweb/unison/releases/download/release/${milestone_id}/ucm-linux.tar.gz";
|
|
|
|
sha256 = "004jx7q657mkcrvilk4lfkp8xcpl2bjflpn9m2p7jzlrlk97v9nj";
|
2019-08-07 05:37:46 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# The tarball is just the prebuilt binary, in the archive root.
|
|
|
|
sourceRoot = ".";
|
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
|
2021-01-22 11:25:31 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ] ++ (lib.optional (!stdenv.isDarwin) autoPatchelfHook);
|
|
|
|
buildInputs = lib.optionals (!stdenv.isDarwin) [ ncurses5 zlib gmp ];
|
2019-08-07 05:37:46 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mv ucm $out/bin
|
2021-01-22 11:25:31 +00:00
|
|
|
wrapProgram $out/bin/ucm --prefix PATH ":" "${lib.makeBinPath [ less ]}";
|
2019-08-07 05:37:46 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2019-08-07 05:37:46 +01:00
|
|
|
description = "Modern, statically-typed purely functional language";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://unisonweb.org/";
|
2019-11-13 23:50:09 +00:00
|
|
|
license = with licenses; [ mit bsd3 ];
|
2019-08-07 05:37:46 +01:00
|
|
|
maintainers = [ maintainers.virusdave ];
|
|
|
|
platforms = [ "x86_64-darwin" "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|