mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-25 07:16:02 +00:00
Revert "feat: Advanced Video Editor Implementation, Native WGC Integration, and AI Auto-Captions"
This commit is contained in:
@@ -25,13 +25,6 @@ function findCmake() {
|
||||
// not on PATH
|
||||
}
|
||||
|
||||
// Local .cmake_ext path
|
||||
const localCmake = path.join(projectRoot, ".cmake_ext", "cmake-4.3.0-windows-x86_64", "bin", "cmake.exe");
|
||||
if (existsSync(localCmake)) {
|
||||
return `"${localCmake}"`;
|
||||
}
|
||||
|
||||
// Standalone CMake paths
|
||||
const standaloneCmakePaths = [
|
||||
path.join("C:", "Program Files", "CMake", "bin", "cmake.exe"),
|
||||
path.join("C:", "Program Files (x86)", "CMake", "bin", "cmake.exe"),
|
||||
@@ -42,7 +35,7 @@ function findCmake() {
|
||||
}
|
||||
}
|
||||
|
||||
// VS 2022/2019 bundled CMake
|
||||
// VS 2022 bundled CMake
|
||||
const vsRoots = [
|
||||
path.join("C:", "Program Files", "Microsoft Visual Studio"),
|
||||
path.join("C:", "Program Files (x86)", "Microsoft Visual Studio"),
|
||||
|
||||
@@ -137,12 +137,6 @@ function findCmake() {
|
||||
}
|
||||
|
||||
if (process.platform === "win32") {
|
||||
// Local .cmake_ext path
|
||||
const localCmake = path.join(projectRoot, ".cmake_ext", "cmake-4.3.0-windows-x86_64", "bin", "cmake.exe");
|
||||
if (existsSync(localCmake)) {
|
||||
return localCmake;
|
||||
}
|
||||
|
||||
const vsEditions = ["Community", "Professional", "Enterprise", "BuildTools"];
|
||||
for (const edition of vsEditions) {
|
||||
const cmakePath = path.join(
|
||||
@@ -242,7 +236,7 @@ async function ensureSourceTree() {
|
||||
}
|
||||
|
||||
ensureTarAvailable();
|
||||
execFileSync("tar", ["-xzf", path.relative(projectRoot, archivePath), "-C", path.relative(projectRoot, extractRoot)], { stdio: "inherit" });
|
||||
execFileSync("tar", ["-xzf", archivePath, "-C", extractRoot], { stdio: "inherit" });
|
||||
|
||||
if (!existsSync(path.join(extractedSourceDir, "CMakeLists.txt"))) {
|
||||
throw new Error(
|
||||
|
||||
@@ -1,136 +1,127 @@
|
||||
import { execSync } from "node:child_process";
|
||||
import { mkdirSync, existsSync, rmSync } from "node:fs";
|
||||
import path from "node:path";
|
||||
import { execSync } from 'node:child_process';
|
||||
import { mkdirSync, existsSync, rmSync } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
const projectRoot = process.cwd();
|
||||
const sourceDir = path.join(projectRoot, "electron", "native", "wgc-capture");
|
||||
const buildDir = path.join(sourceDir, "build");
|
||||
const sourceDir = path.join(projectRoot, 'electron', 'native', 'wgc-capture');
|
||||
const buildDir = path.join(sourceDir, 'build');
|
||||
|
||||
if (process.platform !== "win32") {
|
||||
console.log("[build-windows-capture] Skipping native Windows capture build: host platform is not Windows.");
|
||||
process.exit(0);
|
||||
if (process.platform !== 'win32') {
|
||||
console.log('[build-windows-capture] Skipping native Windows capture build: host platform is not Windows.');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (!existsSync(path.join(sourceDir, "CMakeLists.txt"))) {
|
||||
console.error("[build-windows-capture] CMakeLists.txt not found at", sourceDir);
|
||||
process.exit(1);
|
||||
if (!existsSync(path.join(sourceDir, 'CMakeLists.txt'))) {
|
||||
console.error('[build-windows-capture] CMakeLists.txt not found at', sourceDir);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
function findCmake() {
|
||||
// Check PATH first
|
||||
try {
|
||||
execSync("cmake --version", { stdio: "pipe" });
|
||||
return "cmake";
|
||||
} catch {
|
||||
// not on PATH
|
||||
}
|
||||
// Check PATH first
|
||||
try {
|
||||
execSync('cmake --version', { stdio: 'pipe' });
|
||||
return 'cmake';
|
||||
} catch {
|
||||
// not on PATH
|
||||
}
|
||||
|
||||
// Local .cmake_ext path
|
||||
const localCmake = path.join(projectRoot, ".cmake_ext", "cmake-4.3.0-windows-x86_64", "bin", "cmake.exe");
|
||||
if (existsSync(localCmake)) {
|
||||
return `"${localCmake}"`;
|
||||
}
|
||||
const standaloneCmakePaths = [
|
||||
path.join('C:', 'Program Files', 'CMake', 'bin', 'cmake.exe'),
|
||||
path.join('C:', 'Program Files (x86)', 'CMake', 'bin', 'cmake.exe'),
|
||||
];
|
||||
for (const cmakePath of standaloneCmakePaths) {
|
||||
if (existsSync(cmakePath)) {
|
||||
return `"${cmakePath}"`;
|
||||
}
|
||||
}
|
||||
|
||||
// Standalone CMake paths
|
||||
const standaloneCmakePaths = [
|
||||
path.join("C:", "Program Files", "CMake", "bin", "cmake.exe"),
|
||||
path.join("C:", "Program Files (x86)", "CMake", "bin", "cmake.exe"),
|
||||
];
|
||||
for (const cmakePath of standaloneCmakePaths) {
|
||||
if (existsSync(cmakePath)) {
|
||||
return `"${cmakePath}"`;
|
||||
}
|
||||
}
|
||||
// VS 2022 bundled CMake
|
||||
const vsRoots = [
|
||||
path.join('C:', 'Program Files', 'Microsoft Visual Studio'),
|
||||
path.join('C:', 'Program Files (x86)', 'Microsoft Visual Studio'),
|
||||
];
|
||||
const vsEditions = ['Community', 'Professional', 'Enterprise', 'BuildTools'];
|
||||
const vsVersions = ['2022', '2019'];
|
||||
for (const root of vsRoots) {
|
||||
for (const version of vsVersions) {
|
||||
for (const edition of vsEditions) {
|
||||
const cmakePath = path.join(
|
||||
root,
|
||||
version,
|
||||
edition,
|
||||
'Common7',
|
||||
'IDE',
|
||||
'CommonExtensions',
|
||||
'Microsoft',
|
||||
'CMake',
|
||||
'CMake',
|
||||
'bin',
|
||||
'cmake.exe'
|
||||
);
|
||||
if (existsSync(cmakePath)) {
|
||||
return `"${cmakePath}"`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// VS 2022/2019 bundled CMake
|
||||
const vsRoots = [
|
||||
path.join("C:", "Program Files", "Microsoft Visual Studio"),
|
||||
path.join("C:", "Program Files (x86)", "Microsoft Visual Studio"),
|
||||
];
|
||||
const vsEditions = ["Community", "Professional", "Enterprise", "BuildTools"];
|
||||
const vsVersions = ["2022", "2019"];
|
||||
for (const root of vsRoots) {
|
||||
for (const version of vsVersions) {
|
||||
for (const edition of vsEditions) {
|
||||
const cmakePath = path.join(
|
||||
root,
|
||||
version,
|
||||
edition,
|
||||
"Common7",
|
||||
"IDE",
|
||||
"CommonExtensions",
|
||||
"Microsoft",
|
||||
"CMake",
|
||||
"CMake",
|
||||
"bin",
|
||||
"cmake.exe",
|
||||
);
|
||||
if (existsSync(cmakePath)) {
|
||||
return `"${cmakePath}"`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
|
||||
const cmake = findCmake();
|
||||
if (!cmake) {
|
||||
console.error(
|
||||
"[build-windows-capture] CMake not found. Install Visual Studio with C++ CMake tools or standalone CMake.",
|
||||
);
|
||||
process.exit(1);
|
||||
console.error('[build-windows-capture] CMake not found. Install Visual Studio with C++ CMake tools or standalone CMake.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
mkdirSync(buildDir, { recursive: true });
|
||||
const cacheFile = path.join(buildDir, "CMakeCache.txt");
|
||||
const cacheDir = path.join(buildDir, "CMakeFiles");
|
||||
const cacheFile = path.join(buildDir, 'CMakeCache.txt');
|
||||
const cacheDir = path.join(buildDir, 'CMakeFiles');
|
||||
|
||||
function clearCmakeCache() {
|
||||
rmSync(cacheFile, { force: true });
|
||||
rmSync(cacheDir, { recursive: true, force: true });
|
||||
rmSync(cacheFile, { force: true });
|
||||
rmSync(cacheDir, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
console.log("[build-windows-capture] Configuring CMake...");
|
||||
console.log('[build-windows-capture] Configuring CMake...');
|
||||
try {
|
||||
clearCmakeCache();
|
||||
execSync(`${cmake} .. -G "Visual Studio 17 2022" -A x64`, {
|
||||
cwd: buildDir,
|
||||
stdio: "inherit",
|
||||
timeout: 120000,
|
||||
});
|
||||
clearCmakeCache();
|
||||
execSync(`${cmake} .. -G "Visual Studio 17 2022" -A x64`, {
|
||||
cwd: buildDir,
|
||||
stdio: 'inherit',
|
||||
timeout: 120000,
|
||||
});
|
||||
} catch {
|
||||
console.log("[build-windows-capture] VS 2022 generator not found, trying VS 2019...");
|
||||
try {
|
||||
clearCmakeCache();
|
||||
execSync(`${cmake} .. -G "Visual Studio 16 2019" -A x64`, {
|
||||
cwd: buildDir,
|
||||
stdio: "inherit",
|
||||
timeout: 120000,
|
||||
});
|
||||
} catch (innerError) {
|
||||
console.error("[build-windows-capture] CMake configure failed:", innerError.message);
|
||||
process.exit(1);
|
||||
}
|
||||
console.log('[build-windows-capture] VS 2022 generator not found, trying VS 2019...');
|
||||
try {
|
||||
clearCmakeCache();
|
||||
execSync(`${cmake} .. -G "Visual Studio 16 2019" -A x64`, {
|
||||
cwd: buildDir,
|
||||
stdio: 'inherit',
|
||||
timeout: 120000,
|
||||
});
|
||||
} catch (innerError) {
|
||||
console.error('[build-windows-capture] CMake configure failed:', innerError.message);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
console.log("[build-windows-capture] Building native Windows capture helper...");
|
||||
console.log('[build-windows-capture] Building native Windows capture helper...');
|
||||
try {
|
||||
execSync(`${cmake} --build . --config Release`, {
|
||||
cwd: buildDir,
|
||||
stdio: "inherit",
|
||||
timeout: 300000,
|
||||
});
|
||||
execSync(`${cmake} --build . --config Release`, {
|
||||
cwd: buildDir,
|
||||
stdio: 'inherit',
|
||||
timeout: 300000,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("[build-windows-capture] Build failed:", error.message);
|
||||
process.exit(1);
|
||||
console.error('[build-windows-capture] Build failed:', error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const exePath = path.join(buildDir, "Release", "wgc-capture.exe");
|
||||
const exePath = path.join(buildDir, 'Release', 'wgc-capture.exe');
|
||||
if (existsSync(exePath)) {
|
||||
console.log(`[build-windows-capture] Built successfully: ${exePath}`);
|
||||
console.log(`[build-windows-capture] Built successfully: ${exePath}`);
|
||||
} else {
|
||||
console.error("[build-windows-capture] Expected exe not found at", exePath);
|
||||
process.exit(1);
|
||||
console.error('[build-windows-capture] Expected exe not found at', exePath);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user