tinyxxd: 1.3.11 -> 1.3.14 (#502903)

This commit is contained in:
Philip Taron
2026-03-25 20:37:42 +00:00
committed by GitHub
3 changed files with 24 additions and 4 deletions
+2 -2
View File
@@ -1,5 +1,6 @@
{
lib,
buildPackages,
stdenv,
fetchFromGitHub,
ffmpeg-full,
@@ -8,7 +9,6 @@
nasm,
ninja,
testers,
xxd,
}:
stdenv.mkDerivation (finalAttrs: {
@@ -28,7 +28,7 @@ stdenv.mkDerivation (finalAttrs: {
meson
ninja
nasm
xxd
(buildPackages.callPackage ./xxd.nix { })
];
postPatch = lib.optionalString stdenv.hostPlatform.isFreeBSD ''
+20
View File
@@ -0,0 +1,20 @@
# Minimal `xxd --include` replacement for embedding binary files as C arrays.
# Used instead of tinyxxd to avoid ~22k rebuilds via libaom -> ffmpeg -> everything.
{ writeShellScriptBin }:
writeShellScriptBin "xxd" ''
if [ "$1" != "--include" ]; then
echo "xxd: only --include mode is supported" >&2
exit 1
fi
input="$2"
output="$3"
# Match real xxd behavior: derive variable name from the full path
varname=$(echo "$input" | sed 's/[^a-zA-Z0-9_]/_/g')
{
printf 'unsigned char %s[] = {\n' "$varname"
od -An -tx1 -v "$input" | sed 's/ */ /g; s/^ //; s/ $//; s/ /, 0x/g; s/^/ 0x/; s/$/,/'
printf '};\n'
printf 'unsigned int %s_len = %d;\n' "$varname" "$(wc -c < "$input")"
} > "$output"
''
+2 -2
View File
@@ -8,13 +8,13 @@
stdenv.mkDerivation (finalAttrs: {
pname = "tinyxxd";
version = "1.3.11";
version = "1.3.14";
src = fetchFromGitHub {
repo = "tinyxxd";
owner = "xyproto";
rev = "v${finalAttrs.version}";
hash = "sha256-zM0KRQggDc45eeeZZ6nAI/5sm7NtF1XGucIJV4O1AJs=";
hash = "sha256-iN7i5XtGfvtRX8MA2IWiPsS2PYkmKTrztfvgLtoIq2o=";
};
nativeBuildInputs = [ installShellFiles ];