@@ -1,17 +1,22 @@
11{ language, buildInputs ? [] }:
22
3−{ lib, buildGoModule, fetchFromGitHub, bash, pkg-config }:
3+{ lib, buildGoModule, fetchFromGitHub, bash, pkg-config, runCommand, git }:
44
5+let
6+ gitSrc = builtins.filterSource
7+ (path: type: true)
8+ ./.;
9+in
510buildGoModule rec {
6− name = "prybar-${language}";
7− version = "98148ff";
8−
9− src = fetchFromGitHub{
10− owner = "replit";
11− repo = "prybar";
12− rev = "${version}";
13− sha256 = "14l4bhdlssp22wdxx1ycz9wl64z7bf3qwpqqp3npcva969191c48";
14− };
11+ pname = "prybar-${language}";
12+
13+ revision = runCommand "get-rev" {
14+ nativeBuildInputs = [ git ];
15+ dummy = builtins.currentTime;
16+ } "GIT_DIR=${gitSrc}/.git git rev-parse --short HEAD | tr -d '\n' > $out";
17+ version = builtins.readFile revision;
18+
19+ src = ./.;
1520
1621 inherit buildInputs;
1722 nativeBuildInputs = [ pkg-config ];