Skip to content

Commit 64dc4bb

Browse files
committed
More debug options for non macOs builds
1 parent a039611 commit 64dc4bb

File tree

5 files changed

+97
-393
lines changed

5 files changed

+97
-393
lines changed

backend/custom_build.mjs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@ import { execSync } from 'child_process';
22
import fs from 'fs';
33
import path from 'path';
44

5-
// Function to change the rpath of the binary
6-
function changeRpath(binaryPath) {
7-
try {
8-
// execSync(`install_name_tool -change "@rpath/libafv_native.dylib" "@loader_path/afv/libafv_native.dylib" ${binaryPath}`);
9-
// execSync(`install_name_tool -add_rpath "@loader_path/afv/" ${binaryPath}`);
10-
console.log('Rpath changed successfully!');
11-
} catch (error) {
12-
console.error('Error changing rpath:', error.message);
13-
}
14-
}
5+
// // Function to change the rpath of the binary
6+
// function changeRpath(binaryPath) {
7+
// try {
8+
// execSync(`install_name_tool -change "@rpath/libafv_native.dylib" "@executable_path/libafv_native.dylib" ${binaryPath}`);
9+
// console.log('Rpath changed successfully!');
10+
// } catch (error) {
11+
// console.error('Error changing rpath:', error.message);
12+
// }
13+
// }
1514

1615
// Function to copy DLL files
1716
function copyDLLs() {
@@ -52,9 +51,9 @@ const libraryPath = process.platform === 'darwin' ? 'build/Release/libafv_native
5251
const certificate = 'Developer ID Application';
5352

5453
// Change the rpath of the binary
55-
if (process.platform === 'darwin' || process.platform === 'linux') {
56-
changeRpath(binaryPath);
57-
}
54+
// if (process.platform === 'darwin' || process.platform === 'linux') {
55+
// changeRpath(binaryPath);
56+
// }
5857

5958
// Codesign the binary on macOS
6059
if (process.platform === 'darwin') {

forge.config.ts

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,31 +67,19 @@ const config: ForgeConfig = {
6767
hooks: {
6868
packageAfterExtract: async (forgeConfig, buildPath) => {
6969
console.info("Packages built at:", buildPath);
70-
71-
console.log("Subdirectories of buildPath:");
72-
const subdirectories = fs.readdirSync(buildPath, { withFileTypes: true })
73-
.filter((dirent) => dirent.isDirectory())
74-
.map((dirent) => dirent.name);
75-
76-
subdirectories.forEach((subdirectory) => {
77-
console.log(subdirectory);
78-
const subdirectoryPath = path.join(buildPath, subdirectory);
79-
const subSubdirectories = fs.readdirSync(subdirectoryPath, { withFileTypes: true })
70+
const recursiveSubdirectories = (dirPath: string) => {
71+
const subdirectories = fs.readdirSync(dirPath, { withFileTypes: true })
8072
.filter((dirent) => dirent.isDirectory())
8173
.map((dirent) => dirent.name);
8274

83-
subSubdirectories.forEach((subSubdirectory) => {
84-
console.log(` ${subSubdirectory}`);
85-
const subSubdirectoryPath = path.join(subdirectoryPath, subSubdirectory);
86-
const subSubSubdirectories = fs.readdirSync(subSubdirectoryPath, { withFileTypes: true })
87-
.filter((dirent) => dirent.isDirectory())
88-
.map((dirent) => dirent.name);
89-
90-
subSubSubdirectories.forEach((subSubSubdirectory) => {
91-
console.log(` ${subSubSubdirectory}`);
92-
});
75+
subdirectories.forEach((subdirectory) => {
76+
const subdirectoryPath = path.join(dirPath, subdirectory);
77+
console.log(subdirectoryPath);
78+
recursiveSubdirectories(subdirectoryPath);
9379
});
94-
});
80+
};
81+
82+
recursiveSubdirectories(buildPath);
9583

9684
try {
9785
if (process.platform === "darwin") {
@@ -116,7 +104,13 @@ const config: ForgeConfig = {
116104
console.log("file found at", trackAudioAfvPath);
117105
console.log(
118106
"Copied libafv_native.dylib to",
119-
path.join(buildPath, "afv", "libafv_native.dylib")
107+
path.join(
108+
buildPath,
109+
"Electron.app",
110+
"Contents",
111+
"Frameworks",
112+
"libafv_native.dylib"
113+
)
120114
);
121115
}
122116

0 commit comments

Comments
 (0)