Closed sukanka closed 2 months ago
Finally, I solved this myself. Here is my patch.
diff --git a/forge.sidecar.ts b/forge.sidecar.ts
index fc34809..00d644f 100644
--- a/forge.sidecar.ts
+++ b/forge.sidecar.ts
@@ -77,23 +77,8 @@ function build(
commands.push(['npm', ['rebuild', 'mountutils', `--arch=${arch}`]]);
commands.push([
- 'pkg',
- [
- path.join(sourcesDir, 'util', 'api.js'),
- '-c',
- 'pkg-sidecar.json',
- // `--no-bytecode` so that we can cross-compile for arm64 on x64
- '--no-bytecode',
- '--public',
- '--public-packages',
- '"*"',
- // always build for host platform and node version
- // https://github.com/vercel/pkg-fetch/releases
- '--target',
- `node20-${arch}`,
- '--output',
- binPath,
- ],
+ "install",
+ ['-Dm644', '/dev/null', binPath,]
]);
});
Hello, I'm one of the maintainers of the AUR package
balena-etcher
, And I built etcher from source for archlinux utilizing systemwideelectron
andnode
.The build scripts are in AUR repo, mainly in the PKGBUILD
Below are the details:
package
commandout/
, within itbalenaEtcher-linux-*
looks like the package structure fordeb
andrpm
etcher-util
appears in bothout/balenaEtcher-linux-*/resources/
andout/sidecar
. There is also asrc
dir inout/sidecar
. From the compiling process below https://github.com/balena-io/etcher/blob/c748c2a9c022d1d61b44e70202d073b00cdbd08c/forge.sidecar.ts#L79-L98It is equivalent to
node util/api.js
. So I wrote a wrapper namedetcher-util
to replace the binary file and it works fine.Here is my problem: even though I can get rid of
etcher-util
binary in the built package, I have to build it in the building procedure. Is there any way that I can build only js scripts inout/sidecar/src
but not the final binary file?Thanks