chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / gi / gitbutler / package.nix
blob68679cfcfea4d15b7065cea68df246ac44545620
2   lib,
3   rustPlatform,
4   buildGoModule,
5   stdenv,
6   fetchFromGitHub,
7   pnpm_9,
8   wrapGAppsHook3,
9   cargo-tauri,
10   darwin,
11   desktop-file-utils,
12   esbuild,
13   git,
14   glib-networking,
15   jq,
16   nodejs,
17   pkg-config,
18   libsoup,
19   moreutils,
20   openssl,
21   rust,
22   webkitgtk,
23   nix-update-script,
24   cacert,
27 rustPlatform.buildRustPackage rec {
28   pname = "gitbutler";
29   version = "0.12.16";
31   src = fetchFromGitHub {
32     owner = "gitbutlerapp";
33     repo = "gitbutler";
34     rev = "release/${version}";
35     hash = "sha256-L4PVaNb3blpLIcyA7XLc71qwUPUADclxvbOkq1Jc1no=";
36   };
38   # deactivate the upstream updater in tauri configuration & set the version
39   postPatch = ''
40     tauri_conf="crates/gitbutler-tauri/tauri.conf.release.json"
41     jq '.package.version = "${version}" | .tauri.updater.active = false' "$tauri_conf" | sponge "$tauri_conf"
42   '';
44   cargoLock = {
45     lockFile = ./Cargo.lock;
46     outputHashes = {
47       "tauri-plugin-context-menu-0.7.1" = "sha256-vKfq20hrFLmfoXO94D8HwAE3UdGcuqVZf3+tOBhLqj0=";
48       "tauri-plugin-log-0.0.0" = "sha256-gde2RS5NFA0Xap/Xb7XOeVQ/5t2Nw+j+HOwfeJmSNMU=";
49     };
50   };
52   pnpmDeps = pnpm_9.fetchDeps {
53     inherit pname version src;
54     hash = "sha256-r2PkNDvOofginL5Y0K+7Qhnsev2zle1q9qraG/ub7Wo=";
55   };
57   nativeBuildInputs = [
58     cargo-tauri.hook
59     desktop-file-utils
60     jq
61     moreutils
62     nodejs
63     pkg-config
64     pnpm_9.configHook
65     wrapGAppsHook3
66     cacert
67   ];
69   buildInputs =
70     [ openssl ]
71     ++ lib.optionals stdenv.hostPlatform.isLinux [
72       glib-networking
73       libsoup
74       webkitgtk
75     ]
76     ++ lib.optionals stdenv.hostPlatform.isDarwin (
77       with darwin.apple_sdk.frameworks;
78       [
79         AppKit
80         CoreServices
81         Security
82         WebKit
83       ]
84     );
86   # extended release configuration
87   tauriBuildFlags = [ "--config crates/gitbutler-tauri/tauri.conf.release.json" ];
89   env = {
90     # make sure `crates/gitbutler-tauri/inject-git-binaries.sh` can find our
91     # target dir
92     # https://github.com/gitbutlerapp/gitbutler/blob/56b64d778042d0e93fa362f808c35a7f095ab1d1/crates/gitbutler-tauri/inject-git-binaries.sh#L10C10-L10C26
93     TRIPLE_OVERRIDE = rust.envVars.rustHostPlatformSpec;
95     # `pnpm`'s `fetchDeps` and `configHook` uses a specific version of pnpm, not upstream's
96     COREPACK_ENABLE_STRICT = 0;
98     # disable turbo telemetry
99     TURBO_TELEMETRY_DEBUG = 1;
101     # we depend on nightly features
102     RUSTC_BOOTSTRAP = 1;
104     # we also need to have `tracing` support in `tokio` for `console-subscriber`
105     RUSTFLAGS = "--cfg tokio_unstable";
107     ESBUILD_BINARY_PATH = lib.getExe (
108       esbuild.override {
109         buildGoModule =
110           args:
111           buildGoModule (
112             args
113             // rec {
114               version = "0.20.2";
115               src = fetchFromGitHub {
116                 owner = "evanw";
117                 repo = "esbuild";
118                 rev = "v${version}";
119                 hash = "sha256-h/Vqwax4B4nehRP9TaYbdixAZdb1hx373dNxNHvDrtY=";
120               };
122               vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
123             }
124           );
125       }
126     );
128     # Needed to get openssl-sys to use pkgconfig.
129     OPENSSL_NO_VENDOR = true;
130   };
132   preBuild = ''
133     pushd packages/ui
134     pnpm package
135     popd
136   '';
138   postInstall =
139     lib.optionalString stdenv.hostPlatform.isDarwin ''
140       mv $out/Applications/GitButler.app/Contents/MacOS/GitButler $out/bin/git-butler
141       ln -s $out/bin/git-butler $out/Applications/GitButler.app/Contents/MacOS/GitButler
142     ''
143     + lib.optionalString stdenv.hostPlatform.isLinux ''
144       desktop-file-edit \
145         --set-comment "A Git client for simultaneous branches on top of your existing workflow." \
146         --set-key="Keywords" --set-value="git;" \
147         --set-key="StartupWMClass" --set-value="GitButler" \
148         $out/share/applications/git-butler.desktop
149     '';
151   # the `gitbutler-git` crate's checks do not support release mode
152   checkType = "debug";
154   nativeCheckInputs = [ git ];
156   passthru = {
157     updateScript = nix-update-script {
158       extraArgs = [
159         "--version-regex"
160         "release/(.*)"
161       ];
162     };
163   };
165   meta = {
166     description = "Git client for simultaneous branches on top of your existing workflow";
167     homepage = "https://gitbutler.com";
168     changelog = "https://github.com/gitbutlerapp/gitbutler/releases/tag/release/${version}";
169     mainProgram = "git-butler";
170     license = lib.licenses.fsl11Mit;
171     maintainers = with lib.maintainers; [
172       getchoo
173       techknowlogick
174     ];
175     platforms = lib.platforms.linux ++ lib.platforms.darwin;
176   };