mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-03 13:30:36 +00:00
but: init at 0.22.3
Assisted-by: opencode (GLM 5.3-flash) but: add maintainer
This commit is contained in:
88
pkgs/by-name/bu/but/package.nix
Normal file
88
pkgs/by-name/bu/but/package.nix
Normal file
@@ -0,0 +1,88 @@
|
||||
{
|
||||
lib,
|
||||
nix-update-script,
|
||||
openssl,
|
||||
makeWrapper,
|
||||
git,
|
||||
dbus,
|
||||
pkg-config,
|
||||
fetchFromGitHub,
|
||||
rustPlatform,
|
||||
}:
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
__structuredAttrs = true;
|
||||
pname = "but";
|
||||
version = "0.22.3";
|
||||
src = fetchFromGitHub {
|
||||
owner = "gitbutlerapp";
|
||||
repo = "gitbutler";
|
||||
tag = "release/${finalAttrs.version}";
|
||||
hash = "sha256-nW3yCbpbIhawLQVV+DptzGYiFBSKcyAP89NtDWHJM+0=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-XRc2yok9K7f/vRAqgO78JUq/U36XSiUeOINupfOOSjw=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
makeWrapper
|
||||
];
|
||||
buildInputs = [
|
||||
openssl
|
||||
dbus
|
||||
];
|
||||
|
||||
nativeCheckInputs = [ git ];
|
||||
|
||||
postFixup = ''
|
||||
wrapProgram $out/bin/${finalAttrs.pname} \
|
||||
--prefix PATH : ${lib.makeBinPath [ git ]}
|
||||
'';
|
||||
|
||||
env = {
|
||||
OPENSSL_NO_VENDOR = true; # tell openssl-sys: use system OpenSSL, never vendor
|
||||
VERSION = finalAttrs.version;
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
# gix-testtools execve's fixture scripts directly; their `#!/usr/bin/env bash`
|
||||
# shebang can't resolve in the nix sandbox (no /usr/bin), so point them at
|
||||
# the actual bash from the build environment.
|
||||
patchShebangs crates/but/tests/fixtures/scenario/*.sh
|
||||
'';
|
||||
|
||||
cargoBuildFlags = [
|
||||
"-p"
|
||||
"but"
|
||||
];
|
||||
buildFeatures = [ "packaged-but-distribution" ];
|
||||
|
||||
cargoTestFlags = [
|
||||
"-p"
|
||||
"but"
|
||||
];
|
||||
checkFlags = lib.concatMap (t: [ "--skip=${t}" ]) [
|
||||
# TUI SVG snapshots resolve the system file-opener (xdg-open → desktop
|
||||
# associations; e.g. Thunar on Xfce) instead of upstream's fixture opener.
|
||||
"command::legacy::status::tui::tests::open_tests::"
|
||||
# These tests rely on builtin programs that only exist in debug builds
|
||||
# (#[cfg(debug_assertions)] in but-api/src/open/program.rs), while nixpkgs
|
||||
# runs the test suite with --profile release (matching what ships).
|
||||
"command::open::"
|
||||
];
|
||||
passthru.updateScript = nix-update-script {
|
||||
extraArgs = [
|
||||
"--version-regex"
|
||||
"release/(.*)"
|
||||
];
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "GitButler CLI for virtual branches and stacked diffs";
|
||||
homepage = "https://gitbutler.com";
|
||||
changelog = "https://github.com/gitbutlerapp/gitbutler/releases/tag/release/${finalAttrs.version}";
|
||||
license = lib.licenses.fsl11Mit;
|
||||
mainProgram = "but";
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = with lib.maintainers; [ parry-97 ];
|
||||
};
|
||||
})
|
||||
Reference in New Issue
Block a user