Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-butler: init at 0.11.7 #311361

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/licenses.nix
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,11 @@ in mkLicense lset) ({
fullName = "Unspecified free software license";
};

fsl11Mit = {
fullName = "Functional Source License, Version 1.1, MIT Future License";
spdxId = "FSL-1.1-MIT";
};

ftl = {
spdxId = "FTL";
fullName = "Freetype Project License";
Expand Down
78 changes: 78 additions & 0 deletions pkgs/by-name/gi/git-butler/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{ lib, stdenv, fetchurl, fetchzip, appimageTools, undmg }:
let
pname = "git-butler";
version = "0.11.7";

build_version = "889";

src = {
x86_64-darwin = fetchurl {
urls = let
base_url =
"https://releases.gitbutler.com/releases/release/${version}-${build_version}/macos/x86_64/GitButler_${version}_x64.dmg";
in [ base_url "https://web.archive.org/web/20240522095316/${base_url}" ];
hash = "sha256-5mpcrwZ+BogmbEE/jAlOFvo5KA58IGV/peQFxveY9o8=";
};
aarch64-darwin = fetchurl {
urls = let
base_url =
"https://releases.gitbutler.com/releases/release/${version}-${build_version}/macos/aarch64/GitButler_${version}_aarch64.dmg";
in [ base_url "https://web.archive.org/web/20240522102156/${base_url}" ];
hash = "sha256-uej3EEbG21EKdjRHJE9cgvRrU3dZclf9KQt7L6Ggz0U=";
};
x86_64-linux = fetchzip {
urls = let
base_url =
"https://releases.gitbutler.com/releases/release/${version}-${build_version}/linux/x86_64/git-butler_${version}_amd64.AppImage.tar.gz";
in [ base_url "https://web.archive.org/web/20240522102215/${base_url}" ];
hash = "sha256-XuqyhaE1gi04m7F1V/Ca82aUpL8H8H6fnnPTiEX9oBY=";
};
}.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");

meta = {
description =
"A Git client for simultaneous branches on top of your existing workflow.";
mainProgram = "git-butler";
homepage = "https://gitbutler.com/";
changelog =
"https://discord.com/channels/1060193121130000425/1183737922785116161";
platforms = [ "aarch64-darwin" "x86_64-darwin" "x86_64-linux" ];
DataHearth marked this conversation as resolved.
Show resolved Hide resolved
license = lib.licenses.fsl11Mit;
maintainers = with lib.maintainers; [ DataHearth ];
};
in if stdenv.isDarwin then
stdenv.mkDerivation {
inherit pname version src meta;

sourceRoot = ".";

nativeBuildInputs = [ undmg ];

installPhase = ''
runHook preInstall

mkdir -p "$out/Applications"
mv Gitbutler.app $out/Applications/

runHook postInstall
'';
}
else
let appImageFile = "${src}/git-butler_${version}_amd64.AppImage";
in appimageTools.wrapType2 {
inherit pname version meta;
src = appImageFile;

extraPkgs = pkgs: appimageTools.defaultFhsEnvArgs.multiPkgs pkgs;

extraInstallCommands = let
appimageContents = appimageTools.extractType2 {
inherit pname version;
src = appImageFile;
};
in ''
# Install .desktop files
install -Dm444 ${appimageContents}/git-butler.desktop -t $out/share/applications
install -Dm444 ${appimageContents}/git-butler.png -t $out/share/pixmaps
'';
}