mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-18 23:44:59 +01:00
Add FreeBSD support (#1163)
Co-authored-by: Hiroki Tagato <tagattie@gmail.com>
This commit is contained in:
parent
2b61ea82ec
commit
a0f92941fc
@ -81,6 +81,10 @@ export default class HakEnv {
|
|||||||
return this.target.platform === "linux";
|
return this.target.platform === "linux";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public isFreeBSD(): boolean {
|
||||||
|
return this.target.platform === "freebsd";
|
||||||
|
}
|
||||||
|
|
||||||
public getTargetArch(): Arch {
|
public getTargetArch(): Arch {
|
||||||
return this.target.arch;
|
return this.target.arch;
|
||||||
}
|
}
|
||||||
@ -102,6 +106,6 @@ export default class HakEnv {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public wantsStaticSqlCipher(): boolean {
|
public wantsStaticSqlCipher(): boolean {
|
||||||
return !this.isLinux() || process.env.SQLCIPHER_BUNDLED == "1";
|
return !(this.isLinux() || this.isFreeBSD()) || process.env.SQLCIPHER_BUNDLED == "1";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,9 @@ export type TargetId =
|
|||||||
| "i686-pc-windows-msvc"
|
| "i686-pc-windows-msvc"
|
||||||
| "x86_64-pc-windows-msvc"
|
| "x86_64-pc-windows-msvc"
|
||||||
| "aarch64-pc-windows-msvc"
|
| "aarch64-pc-windows-msvc"
|
||||||
|
| "i686-unknown-freebsd"
|
||||||
|
| "x86_64-unknown-freebsd"
|
||||||
|
| "aarch64-unknown-freebsd"
|
||||||
| "i686-unknown-linux-musl"
|
| "i686-unknown-linux-musl"
|
||||||
| "i686-unknown-linux-gnu"
|
| "i686-unknown-linux-gnu"
|
||||||
| "x86_64-unknown-linux-musl"
|
| "x86_64-unknown-linux-musl"
|
||||||
@ -36,7 +39,7 @@ export type TargetId =
|
|||||||
| "powerpc64le-unknown-linux-gnu";
|
| "powerpc64le-unknown-linux-gnu";
|
||||||
|
|
||||||
// Values are expected to match those used in `process.platform`.
|
// Values are expected to match those used in `process.platform`.
|
||||||
export type Platform = "darwin" | "linux" | "win32";
|
export type Platform = "darwin" | "freebsd" | "linux" | "win32";
|
||||||
|
|
||||||
// Values are expected to match those used in `process.arch`.
|
// Values are expected to match those used in `process.arch`.
|
||||||
export type Arch = "arm64" | "ia32" | "x64" | "ppc64" | "universal";
|
export type Arch = "arm64" | "ia32" | "x64" | "ppc64" | "universal";
|
||||||
@ -106,6 +109,24 @@ const aarch64WindowsMsvc: WindowsTarget = {
|
|||||||
vcVarsArch: "arm64",
|
vcVarsArch: "arm64",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const i686UnknownFreebsd: Target = {
|
||||||
|
id: "i686-unknown-freebsd",
|
||||||
|
platform: "freebsd",
|
||||||
|
arch: "ia32",
|
||||||
|
};
|
||||||
|
|
||||||
|
const x8664UnknownFreebsd: Target = {
|
||||||
|
id: "x86_64-unknown-freebsd",
|
||||||
|
platform: "freebsd",
|
||||||
|
arch: "x64",
|
||||||
|
};
|
||||||
|
|
||||||
|
const aarch64UnknownFreebsd: Target = {
|
||||||
|
id: "aarch64-unknown-freebsd",
|
||||||
|
platform: "freebsd",
|
||||||
|
arch: "arm64",
|
||||||
|
};
|
||||||
|
|
||||||
const x8664UnknownLinuxGnu: LinuxTarget = {
|
const x8664UnknownLinuxGnu: LinuxTarget = {
|
||||||
id: "x86_64-unknown-linux-gnu",
|
id: "x86_64-unknown-linux-gnu",
|
||||||
platform: "linux",
|
platform: "linux",
|
||||||
@ -171,6 +192,10 @@ export const TARGETS: Record<TargetId, Target> = {
|
|||||||
"i686-pc-windows-msvc": i686PcWindowsMsvc,
|
"i686-pc-windows-msvc": i686PcWindowsMsvc,
|
||||||
"x86_64-pc-windows-msvc": x8664PcWindowsMsvc,
|
"x86_64-pc-windows-msvc": x8664PcWindowsMsvc,
|
||||||
"aarch64-pc-windows-msvc": aarch64WindowsMsvc,
|
"aarch64-pc-windows-msvc": aarch64WindowsMsvc,
|
||||||
|
// FreeBSD
|
||||||
|
"i686-unknown-freebsd": i686UnknownFreebsd,
|
||||||
|
"x86_64-unknown-freebsd": x8664UnknownFreebsd,
|
||||||
|
"aarch64-unknown-freebsd": aarch64UnknownFreebsd,
|
||||||
// Linux
|
// Linux
|
||||||
"i686-unknown-linux-musl": i686UnknownLinuxMusl,
|
"i686-unknown-linux-musl": i686UnknownLinuxMusl,
|
||||||
"i686-unknown-linux-gnu": i686UnknownLinuxGnu,
|
"i686-unknown-linux-gnu": i686UnknownLinuxGnu,
|
||||||
|
Loading…
Reference in New Issue
Block a user