2023-07-27 11:28:27 +02:00
|
|
|
{ lib
|
|
|
|
, autoPatchelfHook
|
|
|
|
, fetchurl
|
|
|
|
, gmp
|
2020-11-24 22:41:36 +01:00
|
|
|
, less
|
2023-07-27 11:28:27 +02:00
|
|
|
, 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
|
|
|
|
2023-07-27 11:28:27 +02:00
|
|
|
src = if stdenv.isDarwin then
|
2019-08-07 06:37:46 +02:00
|
|
|
fetchurl {
|
2023-07-27 11:28:27 +02:00
|
|
|
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 {
|
2023-07-27 11:28:27 +02:00
|
|
|
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;
|
|
|
|
|
2023-07-27 11:28:27 +02:00
|
|
|
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
|
2021-10-24 18:43:17 +02:00
|
|
|
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
|
|
|
'';
|
|
|
|
|
2021-01-22 12:25:31 +01:00
|
|
|
meta = with lib; {
|
2019-08-07 06:37:46 +02:00
|
|
|
description = "Modern, statically-typed purely functional language";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://unisonweb.org/";
|
2019-11-14 00:50:09 +01:00
|
|
|
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
|
|
|
})
|