Skip to content

Commit 7cc3683

Browse files
tailwindcss_4: 4.0.6 -> 4.0.8 (#384072)
2 parents 1a3baae + 17967b4 commit 7cc3683

File tree

2 files changed

+31
-26
lines changed

2 files changed

+31
-26
lines changed

pkgs/by-name/ta/tailwindcss_4/package.nix

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
makeWrapper,
88
}:
99
let
10-
version = "4.0.6";
10+
version = "4.0.8";
1111
inherit (stdenv.hostPlatform) system;
1212
throwSystem = throw "tailwindcss has not been packaged for ${system} yet.";
1313

@@ -22,10 +22,10 @@ let
2222

2323
hash =
2424
{
25-
aarch64-darwin = "sha256-FopnfuGYBjjQkfPHdIWacpom9WsAVRwHPQ/14waWR7s=";
26-
aarch64-linux = "sha256-y+9d53skmoSZPhbtk9vUkhKNzIE1A868Lnkw7Cot/PU=";
27-
x86_64-darwin = "sha256-rFjaDtPjJO9W6G//7Uu5CJE+pB0sqLrMByC5pv4FA4E=";
28-
x86_64-linux = "sha256-14EMXenpvPsKlnu5kebNu3MmfWwa7UYfAgEkh5EwVRM=";
25+
aarch64-darwin = "sha256-3OsBB5LGJ7vFIFs+6hZO17ixYa27SQmRpCfYPWMU2rE=";
26+
aarch64-linux = "sha256-4Ek3542HWUYWAZveyWe/Hhr/0BdxLjrvnXOTAaglCwE=";
27+
x86_64-darwin = "sha256-Er7fG/GQt74A1GHXLNKqJEW2NbAFBPr6rLm8E10HPsc=";
28+
x86_64-linux = "sha256-6mI2CWI8Eocn7G9eoTphk1cL+tR+rnKQ3VTXSVcBBPk=";
2929
}
3030
.${system} or throwSystem;
3131
in
Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
11
#!/usr/bin/env nix-shell
2-
#!nix-shell -i bash -p common-updater-scripts gnused jq nix-prefetch
3-
set -eou pipefail
2+
#!nix-shell -i bash -p curl gnused gawk nix-prefetch common-updater-scripts jq
3+
4+
set -euo pipefail
45

56
ROOT="$(dirname "$(readlink -f "$0")")"
7+
NIX_DRV="$ROOT/package.nix"
8+
if [ ! -f "$NIX_DRV" ]; then
9+
echo "ERROR: cannot find package.nix in $ROOT"
10+
exit 1
11+
fi
612

7-
CURRENT_VERSION=$(nix-instantiate --eval --strict --json -A tailwindcss.version . | jq -r .)
8-
LATEST_VERSION=$(list-git-tags --url=https://github.com/tailwindlabs/tailwindcss | rg 'v4[0-9\.]*$' | sed -e 's/^v//' | sort -V | tail -n 1)
9-
sed -i "s/version = \".*\"/version = \"${LATEST_VERSION}\"/" "$ROOT/package.nix"
13+
fetch_arch() {
14+
VER="$1"; ARCH="$2"
15+
URL="https://github.com/tailwindlabs/tailwindcss/releases/download/v${VER}/tailwindcss-${ARCH}"
16+
nix-hash --to-sri --type sha256 "$(nix-prefetch-url --type sha256 "$URL")"
17+
}
1018

11-
if [ "$CURRENT_VERSION" = "$LATEST_VERSION" ]; then
12-
echo "tailwindcss_4 already at latest version $CURRENT_VERSION, exiting"
13-
exit 0
14-
fi
19+
replace_hash() {
20+
sed -i "s#$1 = \"sha256-.\{44\}\"#$1 = \"$2\"#" "$NIX_DRV"
21+
}
1522

16-
function updatePlatform() {
17-
NIXPLAT=$1
18-
TAILWINDPLAT=$2
19-
echo "Updating tailwindcss_4 for $NIXPLAT"
23+
VER=$(list-git-tags --url=https://github.com/tailwindlabs/tailwindcss | rg 'v4[0-9\.]*$' | sed -e 's/^v//' | sort -V | tail -n 1)
2024

21-
URL="https://github.com/tailwindlabs/tailwindcss/releases/download/v${LATEST_VERSION}/tailwindcss-${TAILWINDPLAT}"
22-
HASH=$(nix hash to-sri --type sha256 "$(nix-prefetch-url --type sha256 "$URL")")
25+
LINUX_X64_HASH=$(fetch_arch "$VER" "linux-x64")
26+
LINUX_AARCH64_HASH=$(fetch_arch "$VER" "linux-arm64")
27+
DARWIN_X64_HASH=$(fetch_arch "$VER" "macos-x64")
28+
DARWIN_AARCH64_HASH=$(fetch_arch "$VER" "macos-arm64")
2329

24-
sed -i "s,$NIXPLAT = \"sha256.*\",$NIXPLAT = \"${HASH}\"," "$ROOT/package.nix"
25-
}
30+
sed -i "s/version = \".*\"/version = \"$VER\"/" "$NIX_DRV"
2631

27-
updatePlatform aarch64-darwin macos-arm64
28-
updatePlatform aarch64-linux linux-arm64
29-
updatePlatform x86_64-darwin macos-x64
30-
updatePlatform x86_64-linux linux-x64
32+
replace_hash "x86_64-linux" "$LINUX_X64_HASH"
33+
replace_hash "aarch64-linux" "$LINUX_AARCH64_HASH"
34+
replace_hash "x86_64-darwin" "$DARWIN_X64_HASH"
35+
replace_hash "aarch64-darwin" "$DARWIN_AARCH64_HASH"

0 commit comments

Comments
 (0)