From 0aded5b759aa13c420cd9572020235e3e30d79d2 Mon Sep 17 00:00:00 2001 From: Kristian Nedrevold-Hansen Date: Wed, 28 Aug 2024 21:44:27 +0200 Subject: [PATCH] bleep: init at 0.0.7 Scala build tool bleep. https://github.com/oyvindberg/bleep/releases/tag/v0.0.7 A fast modern build tool for Scala with a declarative configuration. --- pkgs/by-name/bl/bleep/package.nix | 75 +++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 pkgs/by-name/bl/bleep/package.nix diff --git a/pkgs/by-name/bl/bleep/package.nix b/pkgs/by-name/bl/bleep/package.nix new file mode 100644 index 0000000000000..190f971ffb823 --- /dev/null +++ b/pkgs/by-name/bl/bleep/package.nix @@ -0,0 +1,75 @@ +{ + stdenvNoCC, + fetchzip, + autoPatchelfHook, + installShellFiles, + makeWrapper, + lib, + zlib, +}: +let + platform = + { + x86_64-linux = "x86_64-pc-linux"; + x86_64-darwin = "x86_64-apple-darwin"; + aarch64-darwin = "arm64-apple-darwin"; + } + ."${stdenvNoCC.system}" or (throw "unsupported system ${stdenvNoCC.hostPlatform.system}"); + + hash = + { + x86_64-linux = "sha256-dB8reN5rTlY5czFH7BaRya7qBa6czAIH2NkFWZh81ek="; + x86_64-darwin = "sha256-tpUcduCPCbVVaYZZOhWdPlN6SW3LGZPWSO9bDStVDms="; + aarch64-darwin = "sha256-V8QGF3Dpuy9I6CqKsJRHBHRdaLhc4XKZkv/rI7zs+qQ="; + } + ."${stdenvNoCC.system}" or (throw "unsupported system ${stdenvNoCC.hostPlatform.system}"); +in +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "bleep"; + version = "0.0.7"; + + src = fetchzip { + url = "https://github.com/oyvindberg/bleep/releases/download/v${finalAttrs.version}/bleep-${platform}.tar.gz"; + hash = hash; + }; + + nativeBuildInputs = [ + installShellFiles + makeWrapper + ] ++ lib.optional stdenvNoCC.isLinux autoPatchelfHook; + + buildInputs = [ zlib ]; + + installPhase = '' + runHook preInstall + install -Dm755 bleep -t $out/bin/ + runHook postInstall + ''; + + dontAutoPatchelf = true; + + postFixup = + lib.optionalString stdenvNoCC.isLinux '' + autoPatchelf $out + '' + + '' + export PATH=$PATH:$out/bin + installShellCompletion --cmd bleep \ + --bash <(bleep install-tab-completions-bash --stdout) \ + --zsh <(bleep install-tab-completions-zsh --stdout) \ + ''; + + meta = { + homepage = "https://bleep.build/"; + sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; + license = lib.licenses.mit; + description = "Bleeping fast scala build tool"; + mainProgram = "bleep"; + platforms = [ + "x86_64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + maintainers = with lib.maintainers; [ kristianan ]; + }; +})