fix(packages): correct pname typo, add missing category, add sed warning, fix indent
- graphify: fix pname typo graphifyy -> graphify - container-use: add missing passthru.category - radar: add brittleness warning on postPatch sed block - freebuff: fix extractNpmPkg indentation
This commit is contained in:
@@ -34,6 +34,7 @@ buildGoModule rec {
|
|||||||
];
|
];
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
|
category = "AI Coding Agents";
|
||||||
updateScript = [
|
updateScript = [
|
||||||
"nix-update"
|
"nix-update"
|
||||||
"--flake"
|
"--flake"
|
||||||
|
|||||||
@@ -59,74 +59,77 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
src = freebuffSrc;
|
src = freebuffSrc;
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper patchelf ];
|
nativeBuildInputs = [
|
||||||
|
makeWrapper
|
||||||
|
patchelf
|
||||||
|
];
|
||||||
|
|
||||||
dontStrip = true;
|
dontStrip = true;
|
||||||
dontPatchelf = true;
|
dontPatchelf = true;
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
# Extract and patch the pre-built binary for NixOS compatibility
|
# Extract and patch the pre-built binary for NixOS compatibility
|
||||||
mkdir -p "$out/bin" /tmp/fb-engine
|
mkdir -p "$out/bin" /tmp/fb-engine
|
||||||
tar xzf "${binarySrc}" -C /tmp/fb-engine --strip-components=0
|
tar xzf "${binarySrc}" -C /tmp/fb-engine --strip-components=0
|
||||||
cp /tmp/fb-engine/freebuff "$out/bin/freebuff-engine"
|
cp /tmp/fb-engine/freebuff "$out/bin/freebuff-engine"
|
||||||
chmod 755 "$out/bin/freebuff-engine"
|
chmod 755 "$out/bin/freebuff-engine"
|
||||||
|
|
||||||
patchelf \
|
patchelf \
|
||||||
--set-interpreter "${glibc}/lib/ld-linux-x86-64.so.2" \
|
--set-interpreter "${glibc}/lib/ld-linux-x86-64.so.2" \
|
||||||
--set-rpath "${glibc}/lib:" \
|
--set-rpath "${glibc}/lib:" \
|
||||||
"$out/bin/freebuff-engine"
|
"$out/bin/freebuff-engine"
|
||||||
|
|
||||||
if [ -f /tmp/fb-engine/tree-sitter.wasm ]; then
|
if [ -f /tmp/fb-engine/tree-sitter.wasm ]; then
|
||||||
cp /tmp/fb-engine/tree-sitter.wasm "$out/bin/"
|
cp /tmp/fb-engine/tree-sitter.wasm "$out/bin/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -rf /tmp/fb-engine
|
rm -rf /tmp/fb-engine
|
||||||
|
|
||||||
# Extract npm dependencies from pre-fetched tarballs
|
# Extract npm dependencies from pre-fetched tarballs
|
||||||
extractNpmPkg() {
|
extractNpmPkg() {
|
||||||
local src="$1" target="$2"
|
local src="$1" target="$2"
|
||||||
mkdir -p "$target"
|
mkdir -p "$target"
|
||||||
tar xzf "$src" -C "$target" --strip-components=1
|
tar xzf "$src" -C "$target" --strip-components=1
|
||||||
|
}
|
||||||
|
|
||||||
|
mkdir -p "$out/lib/node_modules/tar"
|
||||||
|
mkdir -p "$out/lib/node_modules/chownr"
|
||||||
|
mkdir -p "$out/lib/node_modules/minipass"
|
||||||
|
mkdir -p "$out/lib/node_modules/minizlib"
|
||||||
|
mkdir -p "$out/lib/node_modules/yallist"
|
||||||
|
mkdir -p "$out/lib/node_modules/@isaacs/fs-minipass"
|
||||||
|
|
||||||
|
extractNpmPkg "${pkgTar}" "$out/lib/node_modules/tar"
|
||||||
|
extractNpmPkg "${pkgChownr}" "$out/lib/node_modules/chownr"
|
||||||
|
extractNpmPkg "${pkgMinipass}" "$out/lib/node_modules/minipass"
|
||||||
|
extractNpmPkg "${pkgMinizlib}" "$out/lib/node_modules/minizlib"
|
||||||
|
extractNpmPkg "${pkgYallist}" "$out/lib/node_modules/yallist"
|
||||||
|
extractNpmPkg "${pkgFsMinipass}" "$out/lib/node_modules/@isaacs/fs-minipass"
|
||||||
|
|
||||||
|
# Launcher: run the patched engine directly from nix-store
|
||||||
|
cat > "$out/bin/launcher.js" << LAUNCHER_EOF
|
||||||
|
#!/usr/bin/env node
|
||||||
|
const { spawn } = require('child_process');
|
||||||
|
const TERMINAL_RESET = '\x1b[?1049l\x1b[?1000l\x1b[?1002l\x1b[?1003l\x1b[?1006l\x1b[?2004l\x1b[?25h';
|
||||||
|
const engine = '${placeholder "out"}/bin/freebuff-engine';
|
||||||
|
|
||||||
|
function reset() {
|
||||||
|
try { if (process.stdin.isTTY && process.stdin.setRawMode) process.stdin.setRawMode(false); } catch(e){}
|
||||||
|
try { if (process.stdout.isTTY) process.stdout.write(TERMINAL_RESET); } catch(e){}
|
||||||
}
|
}
|
||||||
|
|
||||||
mkdir -p "$out/lib/node_modules/tar"
|
const child = spawn(engine, process.argv.slice(2), { stdio: 'inherit' });
|
||||||
mkdir -p "$out/lib/node_modules/chownr"
|
child.on('exit', (code, signal) => { reset(); process.exit(signal ? 1 : code || 0); });
|
||||||
mkdir -p "$out/lib/node_modules/minipass"
|
child.on('error', (e) => { console.error('Failed to start freebuff:', e.message); process.exit(1); });
|
||||||
mkdir -p "$out/lib/node_modules/minizlib"
|
LAUNCHER_EOF
|
||||||
mkdir -p "$out/lib/node_modules/yallist"
|
|
||||||
mkdir -p "$out/lib/node_modules/@isaacs/fs-minipass"
|
|
||||||
|
|
||||||
extractNpmPkg "${pkgTar}" "$out/lib/node_modules/tar"
|
makeWrapper "${nodejs}/bin/node" "$out/bin/freebuff" \
|
||||||
extractNpmPkg "${pkgChownr}" "$out/lib/node_modules/chownr"
|
--set NODE_PATH "$out/lib/node_modules" \
|
||||||
extractNpmPkg "${pkgMinipass}" "$out/lib/node_modules/minipass"
|
--add-flags "$out/bin/launcher.js"
|
||||||
extractNpmPkg "${pkgMinizlib}" "$out/lib/node_modules/minizlib"
|
|
||||||
extractNpmPkg "${pkgYallist}" "$out/lib/node_modules/yallist"
|
|
||||||
extractNpmPkg "${pkgFsMinipass}" "$out/lib/node_modules/@isaacs/fs-minipass"
|
|
||||||
|
|
||||||
# Launcher: run the patched engine directly from nix-store
|
runHook postInstall
|
||||||
cat > "$out/bin/launcher.js" << LAUNCHER_EOF
|
|
||||||
#!/usr/bin/env node
|
|
||||||
const { spawn } = require('child_process');
|
|
||||||
const TERMINAL_RESET = '\x1b[?1049l\x1b[?1000l\x1b[?1002l\x1b[?1003l\x1b[?1006l\x1b[?2004l\x1b[?25h';
|
|
||||||
const engine = '${placeholder "out"}/bin/freebuff-engine';
|
|
||||||
|
|
||||||
function reset() {
|
|
||||||
try { if (process.stdin.isTTY && process.stdin.setRawMode) process.stdin.setRawMode(false); } catch(e){}
|
|
||||||
try { if (process.stdout.isTTY) process.stdout.write(TERMINAL_RESET); } catch(e){}
|
|
||||||
}
|
|
||||||
|
|
||||||
const child = spawn(engine, process.argv.slice(2), { stdio: 'inherit' });
|
|
||||||
child.on('exit', (code, signal) => { reset(); process.exit(signal ? 1 : code || 0); });
|
|
||||||
child.on('error', (e) => { console.error('Failed to start freebuff:', e.message); process.exit(1); });
|
|
||||||
LAUNCHER_EOF
|
|
||||||
|
|
||||||
makeWrapper "${nodejs}/bin/node" "$out/bin/freebuff" \
|
|
||||||
--set NODE_PATH "$out/lib/node_modules" \
|
|
||||||
--add-flags "$out/bin/launcher.js"
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
python3Packages.buildPythonApplication rec {
|
python3Packages.buildPythonApplication rec {
|
||||||
pname = "graphifyy";
|
pname = "graphify";
|
||||||
version = "0.7.10";
|
version = "0.7.10";
|
||||||
pyproject = true;
|
pyproject = true;
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ let
|
|||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
# Fix missing resolved URLs for packages under web/node_modules/
|
# Fix missing resolved URLs for packages under web/node_modules/
|
||||||
|
# WARNING: This sed is version-specific — if upstream bumps a
|
||||||
|
# transitive dep version, the patterns silently fail and the
|
||||||
|
# build breaks. Update resolved/integrity values when bumping radar.
|
||||||
# that are actually external npm packages (not workspace links).
|
# that are actually external npm packages (not workspace links).
|
||||||
# Insert "resolved" and "integrity" after the "version" field
|
# Insert "resolved" and "integrity" after the "version" field
|
||||||
# for each affected package using sed.
|
# for each affected package using sed.
|
||||||
|
|||||||
Reference in New Issue
Block a user