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
|
2024-06-05 15:53:02 +00:00
|
|
|
, libb2
|
2023-08-04 22:07:22 +00:00
|
|
|
, ncurses6
|
2024-06-05 15:53:02 +00:00
|
|
|
, openssl
|
2023-08-04 22:07:22 +00:00
|
|
|
, 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";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "0.5.26";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
src = if stdenv.hostPlatform.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";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-RF2Q5sCxT9F3IGM/8UP6bEe9sOjtpMVYHREuAPOzh8g=";
|
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";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-t0rc1f4PfjHRu/tzoW8sJ/6R0KBbYQPiWHqsIaqc+SY=";
|
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 ]
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optional (!stdenv.hostPlatform.isDarwin) autoPatchelfHook;
|
|
|
|
buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ gmp ncurses6 zlib ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2024-06-05 15:53:02 +00:00
|
|
|
mkdir -p $out/{bin,lib}
|
|
|
|
mv runtime $out/lib/runtime
|
2021-10-28 06:52:43 +00:00
|
|
|
mv ui $out/ui
|
2024-06-05 15:53:02 +00:00
|
|
|
mv unison $out/unison
|
|
|
|
makeWrapper $out/unison/unison $out/bin/ucm \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libb2 openssl ]} \
|
2021-10-28 06:52:43 +00:00
|
|
|
--prefix PATH ":" "${lib.makeBinPath [ less ]}" \
|
2024-06-05 15:53:02 +00:00
|
|
|
--add-flags "--runtime-path $out/lib/runtime/bin/unison-runtime" \
|
2021-10-28 06:52:43 +00:00
|
|
|
--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 ];
|
2023-08-22 20:05:09 +00:00
|
|
|
mainProgram = "ucm";
|
2024-06-05 15:53:02 +00:00
|
|
|
maintainers = with maintainers; [ ceedubs sellout virusdave ];
|
2022-02-10 20:34:41 +00:00
|
|
|
platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-darwin" ];
|
2023-08-22 20:05:09 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
})
|