Giter VIP home page Giter VIP logo

electron's Introduction

electron for riscv64

This repo is a fork of electron with riscv64 support added.

Status: Work In Progress

Note: A performance regression is fixed recently and only the latest versions and v29.4.0 are rebuilt. Please upgrade if you still using other versions.

Releases are published in https://github.com/riscv-forks/electron-riscv-releases

Repo Organization

Branches with riscv64 support have a suffix of -riscv. e.g. main-riscv, 28-x-y-riscv, v29.1.1-riscv.

Necessary Toolchains for cross-compilation

  • Debian riscv sysroot
  • Clang toolchain
  • Rust toolchain

Prebuilt toolchains are available in GitHub Releases. They can also be built from source by corresponding scripts, e.g. //tools/rust/build_rust.py.

Note: To build the sysroot, please checkout chromium 121.0.6167.90 source code and apply the patch. The sysroot creator patch is not maintained in electron patches.

Toolchain issues:

Build Instruction

This repo supports both building in RISC-V environment and cross-compiling from a x86-64 host.

Cross-Compile

Host Environment

Debian bookworm.

Getting the Source

First, install depot_tools and add it to PATH.

Then, get the source code:

$ mkdir electron && cd electron
$ gclient config --name "src/electron" --unmanaged https://github.com/riscv-forks/electron@BRANCH_NAME_HERE
$ gclient sync --with_branch_heads --with_tags

Toolchain Preparation

Download and unpack riscv64 sysroot:

mkdir build/linux/debian_sid_riscv64-sysroot
tar xf ../debian_sid_riscv64_sysroot.tar.xz --directory=build/linux/debian_sid_riscv64-sysroot
mkdir -p third_party/llvm-build-tools/
ln -s ../../build/linux/debian_sid_riscv64-sysroot third_party/llvm-build-tools/debian_sid_riscv64_sysroot

Download and unpack clang toolchain built with riscv64 support:

cd third_party/llvm-build/Release+Asserts
tar xf <path to clang-xxx.tar.xz>

Download and unpack rust toolchain built with fixes:

cd third_party/
tar xf <path to rust-toolchain-xxx.tar.xz>
cp rust-toolchain/{,INSTALLED_}VERSION

Run GN:

./buildtools/linux64/gn gen out/Release-riscv64 --args="import(\"//electron/build/args/release.gn\") target_cpu = \"riscv64\" is_clang = true"

Run ninja:

ninja -C out/Release-riscv64/ electron

Generate Dist Zip:

electron/script/strip-binaries.py -d out/Release-riscv64 --target-cpu riscv64
ninja -C out/Release-riscv64 electron:electron_dist_zip

Build on RISC-V

Arch Linux riscv64 is building electron on riscv64.

The patch of Arch Linux's PKGBUILD is available here for reference: https://github.com/felixonmars/archriscv-packages/blob/master/electron28/riscv64.patch

TODOs

  • Upstream more patches.
  • Set up CI to automatically create riscv branches from upstream tags.

electron's People

Contributors

kxxt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.