d2: bump to latest master bump d2plugin-tala to 0.3.3 version

This commit is contained in:
Dmitriy Pleshevskiy 2023-03-16 11:13:24 +03:00
parent 360d84d045
commit 4adabd8d4f
Signed by: pleshevskiy
GPG key ID: 79C4487B44403985
3 changed files with 47 additions and 9 deletions

View file

@ -4,7 +4,7 @@
, installShellFiles
}:
let version = "2023-02-25"; in
let version = "2023-03-16"; in
buildGoModule {
pname = "d2";
inherit version;
@ -12,11 +12,11 @@ buildGoModule {
src = fetchFromGitHub {
owner = "terrastruct";
repo = "d2";
rev = "a2503328a23613609275e9c9ae981e54c1e59f32";
sha256 = "sha256-zhvKB0Prmuai26IhEYK6mqa1XdT+LJUrLNCjsnn1vsk=";
rev = "6d5f2c4f5fcdc4b9aa0086fe5c2a76ff9136d48d";
sha256 = "sha256-d8+8STBnNd+LD2rk2mQKbkurbCqEthI6nVVf4ELBeuE=";
};
vendorSha256 = "sha256-EqIRujKMqIO8XRJ2yAfLOwcDToDM2nkURqg3Sqyjqa0=";
vendorSha256 = "sha256-h2OGd/Ql4BTX0tt91lQBvmm41h2kzPgQXawJnrkxn8Y=";
ldflags = [
"-s"

View file

@ -1,10 +1,8 @@
{ system, stdenv, lib, fetchurl, installShellFiles }:
let
platform = if stdenv.isLinux then "linux" else "darwin";
arch = if lib.hasPrefix "x86_" system then "amd64" else "arm64";
version = "0.3.1";
fileName = "tala-v${version}-${platform}-${arch}.tar.gz";
rev = "0.3.3";
fileName = "tala-v${version}-linux-amd64.tar.gz";
in
stdenv.mkDerivation {
pname = "d2plugin-tala";
@ -12,7 +10,7 @@ stdenv.mkDerivation {
src = fetchurl {
url = "https://github.com/terrastruct/TALA/releases/download/v${version}/${fileName}";
sha256 = "sha256-xYHiYLow13c3WaAq7QiD0SL9LVWKAyc8E+gWJezN3L4=";
sha256 = "sha256-Qa+7X3fkyqu0kFHXFlZzO805nOgGJY4XwcJI+njp8Ro=";
};
nativeBuildInputs = [ installShellFiles ];

40
pkgs/d2/update.sh Executable file
View file

@ -0,0 +1,40 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p nix-prefetch-github gnused jq wget
function help() {
echo "Regenerates packaging data for the d2 packages."
echo "Usage: $0 <rev>"
exit 1
}
if [[ $# -gt 1 || $1 == -* ]]; then
help
fi
set -x
cd "$(dirname "$0")"
d2_version="$1"
set -euo pipefail
if [ -z "$d2_version" ]; then
help
fi
tala_version="$(wget -O- "https://api.github.com/repos/terrastruct/TALA/releases?per_page=1" | jq -r '.[0].tag_name')"
d2_hash=$(nix-prefetch-github terrastruct d2 --rev "${d2_version}" | jq -r .sha256)
d2_hash=$(nix hash to-sri --type sha256 "${d2_hash}")
tala_hash=$(nix-prefetch-url "https://github.com/terrastruct/TALA/releases/download/${tala_version}/tala-${tala_version}-linux-amd64.tar.gz")
tala_hash=$(nix hash to-sri --type sha256 "${tala_hash}")
sed -i -E -e "s#rev = \".*\"#rev = \"${d2_version}\"#" d2-unwrapped.nix
sed -i -E -e "s#sha256 = \".*\"#sha256 = \"${d2_hash}\"#" d2-unwrapped.nix
sed -i -E -e "s#version = \".*\"#version = \"$(date +%Y-%m-%d)\"#" d2-unwrapped.nix
sed -i -E -e "s#version = \".*\"#rev = \"${tala_version#v}\"#" d2plugin-tala.nix
sed -i -E -e "s#sha256 = \".*\"#sha256 = \"${tala_hash}\"#" d2plugin-tala.nix