orbit icon indicating copy to clipboard operation
orbit copied to clipboard

Package for Arch Linux available in AUR

Open mchisolm0 opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

I use CachyOS as one of my dev machines (Arch based distro), and I cannot get the Linux build working on this machine.

Describe the solution you'd like

Ideal solution

A package available in the Arch User Repository (AUR) to be easily installed by Arch and CachyOS users.

Possible alternate solution

Give build instructions for how to build from source.

Additional context

This is related to Issue #242 but I wanted to detail everything I have learned over the past few days of trying to get it working. I also wanted to offer to help get the package working for Arch and, if possible, see what it takes to get it on the AUR.

If the team prefers only offering build instructions, I am happy to document that once I have learned. I also understand if this is beyond the scope of what the team wants the project to entail.

I will document what I have found so far in the comments below and will happily help anyway possible.

mchisolm0 avatar Feb 17 '25 06:02 mchisolm0

Edit: Added link to the tutorial I tried first. Based on an online tutorial (link), I tried npm install --save-dev @electron-forge/cli. In the error message, it references the command sh -c yarn run clean && yarn run build, so I deleted the change from the first command and tried sh -c yarn run clean && yarn run build in the root directory.

After not seeing where to go, I checked the .github/workflows/build.yml file to see how the GitHub Actions builds the distributables. Based on the GitHub Actions steps:

  1. I switched to node 20 (v20.18.3)
  2. yarn install --frozen-lockfile which seemed to work.
  3. cd apps/menu-bar/electron/
  4. yarn make <---- I did this step too early // /bi/sh: line 1: electron-forge: command not found
  5. yarn <---- Note: warning " > [email protected]" has unmet peer dependency "@types/node@*". but it otherwise worked.
  6. yarn make <--- Did not work because missing rpm
  7. sudo pacman -Syu rpm-tools dpkg fakeroot because of the errors that followed
  8. I had to setup the rpm db manually with 1. sudo mkdir -p /var/lib/rpm 2. sudo rpm --initdb 3. sudo rpm --rebuilddb 4. sudo chmod -R 755 /var/lib/rpm 5. sudo chown -R root:root /var/lib/rpm
  9. Try yarn make again

What seems to be the relevant current error messages

yarn make
...
✔ Loading configuration
✔ Resolving make targets
  › Making for the following targets: ,
✔ Running package command
  ✔ Preparing to package application
  ✔ Running packaging hooks
    ✔ Running generateAssets hook
      ✔ Running generateAssets hook from forgeConfig
    ✔ Running prePackage hook
      ✔ [plugin-vite] Building vite bundles
  ✔ Packaging application
    ✔ Packaging for x64 on linux [1s]
  ✔ Running postPackage hook
✔ Running preMake hook
❯ Making distributables
  ✖ Making a rpm distributable for linux/x64
    › Command failed with a non-zero return code (1):
      rpmbuild -bb /tmp/electron-installer--11221-XBkEtDZl4U6W/expo-orbit_2.0.1_x86_64/SPECS/expo-orbit.spec --target x86_64-none-linux --define _topdir
      /tmp/electron-installer--11221-XBkEtDZl4U6W/expo-orbit_2.0.1_x86_64
      Executing(%mkbuilddir): /bin/sh -e /var/tmp/rpm-tmp.7IXIKA
      Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.h5AvGl
      RPM build errors:
      Building target platforms: x86_64-none-linux
      Building for target x86_64-none-linux
      + umask 022
      + cd /tmp/electron-installer--11221-XBkEtDZl4U6W/expo-orbit_2.0.1_x86_64/BUILD/expo-orbit-2.0.1-build
      + test -d /tmp/electron-installer--11221-XBkEtDZl4U6W/expo-orbit_2.0.1_x86_64/BUILD/expo-orbit-2.0.1-build
      + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w /tmp/electron-installer--11221-XBkEtDZl4U6W/expo-orbit_2.0.1_x86_64/BUILD/expo-orbit-2.0.1-build
      + /usr/bin/rm -rf /tmp/electron-installer--11221-XBkEtDZl4U6W/expo-orbit_2.0.1_x86_64/BUILD/expo-orbit-2.0.1-build
      + /usr/bin/mkdir -p /tmp/electron-installer--11221-XBkEtDZl4U6W/expo-orbit_2.0.1_x86_64/BUILD/expo-orbit-2.0.1-build
      + /usr/bin/mkdir -p /tmp/electron-installer--11221-XBkEtDZl4U6W/expo-orbit_2.0.1_x86_64/BUILD/expo-orbit-2.0.1-build/SPECPARTS
      + RPM_EC=0
      ++ jobs -p
      + exit 0
      + umask 022
      + cd /tmp/electron-installer--11221-XBkEtDZl4U6W/expo-orbit_2.0.1_x86_64/BUILD/expo-orbit-2.0.1-build
      + /usr/bin/rm -rf /tmp/electron-installer--11221-XBkEtDZl4U6W/expo-orbit_2.0.1_x86_64/BUILD/expo-orbit-2.0.1-build/BUILDROOT
      + /usr/bin/mkdir -p /tmp/electron-installer--11221-XBkEtDZl4U6W/expo-orbit_2.0.1_x86_64/BUILD/expo-orbit-2.0.1-build
      + /usr/bin/mkdir /tmp/electron-installer--11221-XBkEtDZl4U6W/expo-orbit_2.0.1_x86_64/BUILD/expo-orbit-2.0.1-build/BUILDROOT
      + mkdir -p /tmp/electron-installer--11221-XBkEtDZl4U6W/expo-orbit_2.0.1_x86_64/BUILD/expo-orbit-2.0.1-build/BUILDROOT/usr/
      + cp -r 'usr/*' /tmp/electron-installer--11221-XBkEtDZl4U6W/expo-orbit_2.0.1_x86_64/BUILD/expo-orbit-2.0.1-build/BUILDROOT/usr/
      cp: cannot stat 'usr/*': No such file or directory
      error: Bad exit status from /var/tmp/rpm-tmp.h5AvGl (%install)
      Bad exit status from /var/tmp/rpm-tmp.h5AvGl (%install)
  ✖ Making a deb distributable for linux/x64
◼ Running postMake hook

The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
Running custom pre-make command: yarn export-web
(!) invalid "base" option: "./dist". The value can only be an absolute URL, "./", or an empty string.
vite v5.4.11 building for production...
vite v5.4.11 building for production...
...
An unhandled rejection has occurred inside Forge:
Error: Command failed with a non-zero return code (1):
rpmbuild -bb /tmp/electron-installer--11221-XBkEtDZl4U6W/expo-orbit_2.0.1_x86_64/SPECS/expo-orbit.spec --target x86_64-none-linux --define _topdir /tmp/electron-installer--11221-XBkEtDZl4U6W/expo-orbit_2.0.1_x86_64
Executing(%mkbuilddir): /bin/sh -e /var/tmp/rpm-tmp.7IXIKA
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.h5AvGl
...
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I have omitted much of the output, but I can share it if you want. ... is where I omitted lines of output.

Any guidance on what my next steps should be or that this is not what the team wants is appreciated.

mchisolm0 avatar Feb 17 '25 06:02 mchisolm0

Update: I was able to get Expo Orbit working with the following instructions for CachyOS and Arch Linux. Would the team be willing for me to work on seeing how to get a package reliably in the AUR?

Install from rpm file in expo/orbit releases

Followed this guide

  1. Install rpm with sudo pacman -Syu rpm-tools
  2. Make a temp directory for build files with mkdir -p tmp/orbit
  3. Move into the directory with cd temp/orbit
  4. Get the latest rpm release for Orbit with curl -L "https://github.com/expo/orbit/releases/download/expo-orbit-v2.0.1/expo-orbit-2.0.1-1.x86_64.rpm" -o expo-orbit-2.0.1-1.x86_64.rpm
  5. Make a build file named PKGBUILD in the tmp/orbit directory (the one I made is shown below)
pkgname=expo-orbit
pkgver=2.0.1
pkgrel=1
pkgdesc="Accelerate your development workflow with one-click build launches and simulator management"
arch=('x86_64')

depends=()
optdepends=()

source=("expo-orbit-2.0.1-1.x86_64.rpm")

sha256sums=('SKIP')

package() {
        find $srcdir/ -mindepth 1 -maxdepth 1 -type d | xargs cp -r -t "$pkgdir"
}
  1. Make package with makepkg -si
  2. Check the package was made correctly with ls -l /usr/bin/expo-orbit --> Should give output like -rwxr-xr-x 1 root root 55223672 Jun 21 21:39 /usr/bin/expo-orbit

mchisolm0 avatar Feb 19 '25 17:02 mchisolm0