Merge pull request #308196 from Mic92/element-desktop
element-desktop,electron: fix cross build
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
, pkgsBuildHost
|
||||
# configurePhase:
|
||||
, gnChromium
|
||||
, symlinkJoin
|
||||
|
||||
# Build inputs:
|
||||
, libpng
|
||||
@@ -360,6 +361,14 @@ let
|
||||
${ungoogler}/utils/domain_substitution.py apply -r ${ungoogler}/domain_regex.list -f ${ungoogler}/domain_substitution.list -c ./ungoogled-domsubcache.tar.gz .
|
||||
'';
|
||||
|
||||
llvmCcAndBintools = symlinkJoin {
|
||||
name = "llvmCcAndBintools";
|
||||
paths = [
|
||||
pkgsBuildTarget.${llvmPackages_attrName}.llvm
|
||||
pkgsBuildTarget.${llvmPackages_attrName}.stdenv.cc
|
||||
];
|
||||
};
|
||||
|
||||
gnFlags = mkGnFlags ({
|
||||
# Main build and toolchain settings:
|
||||
# Create an official and optimized release build (only official builds
|
||||
@@ -426,7 +435,7 @@ let
|
||||
rtc_use_pipewire = true;
|
||||
# Disable PGO because the profile data requires a newer compiler version (LLVM 14 isn't sufficient):
|
||||
chrome_pgo_phase = 0;
|
||||
clang_base_path = "${pkgsBuildTarget.${llvmPackages_attrName}.stdenv.cc}";
|
||||
clang_base_path = "${llvmCcAndBintools}";
|
||||
use_qt = false;
|
||||
# To fix the build as we don't provide libffi_pic.a
|
||||
# (ld.lld: error: unable to find library -l:libffi_pic.a):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ lib, stdenv, fetchFromGitHub, nodejs, python3, callPackage, removeReferencesTo
|
||||
{ lib, stdenv, fetchFromGitHub, nodejs, python3, removeReferencesTo
|
||||
, pkg-config, libsecret, xcbuild, Security, AppKit, fetchNpmDeps, npmHooks }:
|
||||
|
||||
let
|
||||
@@ -31,6 +31,17 @@ in stdenv.mkDerivation rec {
|
||||
|
||||
doCheck = false;
|
||||
|
||||
postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
|
||||
pkg-config() { "''${PKG_CONFIG}" "$@"; }
|
||||
export -f pkg-config
|
||||
'';
|
||||
|
||||
# https://nodejs.org/api/os.html#osarch
|
||||
npmFlagsArray = [ "--arch=${if stdenv.hostPlatform.parsed.cpu.name == "i686" then "ia32"
|
||||
else if stdenv.hostPlatform.parsed.cpu.name == "x86_64" then "x64"
|
||||
else if stdenv.hostPlatform.parsed.cpu.name == "aarch64" then "arm64"
|
||||
else stdenv.hostPlatform.parsed.cpu.name}" ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
shopt -s extglob
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ lib, stdenv, rustPlatform, fetchFromGitHub, callPackage, sqlcipher, nodejs, python3, yarn, fixup-yarn-lock, CoreServices, fetchYarnDeps, removeReferencesTo }:
|
||||
{ lib, stdenv, rustPlatform, fetchFromGitHub, rust, sqlcipher, nodejs, python3, yarn, fixup-yarn-lock, CoreServices, fetchYarnDeps, removeReferencesTo }:
|
||||
|
||||
let
|
||||
pinData = lib.importJSON ./pin.json;
|
||||
@@ -36,7 +36,7 @@ in rustPlatform.buildRustPackage rec {
|
||||
fixup-yarn-lock yarn.lock
|
||||
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
|
||||
patchShebangs node_modules/
|
||||
node_modules/.bin/neon build --release
|
||||
node_modules/.bin/neon build --release -- --target ${rust.toRustTargetSpec stdenv.hostPlatform} -Z unstable-options --out-dir target/release
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ lib.fix (finalPackage: buildPythonPackage rec {
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
dbus # build systems checks for `dbus-run-session` in PATH
|
||||
meson
|
||||
meson-python
|
||||
pkg-config
|
||||
|
||||
Reference in New Issue
Block a user