81 lines
2.1 KiB
Nix
81 lines
2.1 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchurl,
|
|
versionCheckHook,
|
|
autoPatchelfHook,
|
|
makeWrapper,
|
|
}:
|
|
let
|
|
version = "4.1.12";
|
|
inherit (stdenv.hostPlatform) system;
|
|
throwSystem = throw "tailwindcss has not been packaged for ${system} yet.";
|
|
|
|
plat =
|
|
{
|
|
aarch64-darwin = "macos-arm64";
|
|
aarch64-linux = "linux-arm64";
|
|
x86_64-darwin = "macos-x64";
|
|
x86_64-linux = "linux-x64";
|
|
}
|
|
.${system} or throwSystem;
|
|
|
|
hash =
|
|
{
|
|
aarch64-darwin = "sha256-fWm+F3a76KSeFXFNmHPQiVnDIK/w8HFNjY5tnQDZtUM=";
|
|
aarch64-linux = "sha256-GBMyl0//GzQjrXXWovHQmt8cpj6xMk2wr7xMMP8a0IY=";
|
|
x86_64-darwin = "sha256-/JNdUYE0QkcsLhsoWC/sPfIEN55T1XJJN9UW3UJa83w=";
|
|
x86_64-linux = "sha256-Xu7mbqI36umhYPozFP0M92q5k1Uamfr7Fvodtsa5Aok=";
|
|
}
|
|
.${system} or throwSystem;
|
|
in
|
|
stdenv.mkDerivation {
|
|
inherit version;
|
|
pname = "tailwindcss_4";
|
|
|
|
src = fetchurl {
|
|
url =
|
|
"https://github.com/tailwindlabs/tailwindcss/releases/download/v${version}/tailwindcss-" + plat;
|
|
inherit hash;
|
|
};
|
|
|
|
nativeBuildInputs = lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook;
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
dontUnpack = true;
|
|
dontBuild = true;
|
|
dontStrip = true;
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
install -m755 $src $out/bin/tailwindcss
|
|
'';
|
|
|
|
# libstdc++.so.6 for @parcel/watcher
|
|
postFixup = ''
|
|
wrapProgram $out/bin/tailwindcss --prefix LD_LIBRARY_PATH : ${
|
|
lib.makeLibraryPath [ stdenv.cc.cc.lib ]
|
|
}
|
|
'';
|
|
|
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
|
doInstallCheck = true;
|
|
versionCheckProgram = "${placeholder "out"}/bin/tailwindcss";
|
|
versionCheckProgramArg = "--help";
|
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
meta = {
|
|
description = "Command-line tool for the CSS framework with composable CSS classes, standalone v4 CLI";
|
|
homepage = "https://tailwindcss.com/blog/tailwindcss-v4";
|
|
license = lib.licenses.mit;
|
|
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
|
|
maintainers = with lib.maintainers; [
|
|
adamcstephens
|
|
adamjhf
|
|
];
|
|
mainProgram = "tailwindcss";
|
|
platforms = lib.platforms.darwin ++ lib.platforms.linux;
|
|
};
|
|
}
|