Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help fix AUR packages #6550

Open
xiota opened this issue May 1, 2024 · 8 comments
Open

Help fix AUR packages #6550

xiota opened this issue May 1, 2024 · 8 comments

Comments

@xiota
Copy link

xiota commented May 1, 2024

The AUR packages aur/gdevelop and aur/gdevelop-git are in unusable state.

In early March, @arthuro555 posted messages saying, "I'd like to help maintain & update this package, could I be added as a co-maintainer?" However, after taking ownership of aur/gdevelop-git and being made comaintainer of aur/gdevelop, has not yet contributed updates to either package.

I understand upstream developers are not necessarily interested in helping with downstream packaging, but improved documentation or access to the scripts used to make the release appimage would be helpful.

@arthuro555
Copy link
Contributor

Hey! I've been working on a new pkgbuild but have met an issue, that being that the emscripten build inexplicably fails when configured by emconfigure in the fakeroot environement. I've sought advice of a debian and a fedora packager I knew and they were as clueless as I am. I can use a prebuilt version of the wasm GDevelop library, but it bothers me to include a prebuilt binary instead of building them from source :/

Another issue I've been having is that running GDevelop with the system wide installation of electron causes it to be falsely thinking it is running the dev version of GDevelop, and fail to load as no dev server is running. I still got it to technically work by patching the source files to to replace the check with a hardcoded const isDev = false;, but that is an incredibly ugly hack that could break anytime :/

I was thinking it wasn't worth uploading the new pkgbuild yet, until I figure these out, but even after over 30h of work & testing I couldn't find the source of the emscripten build failure.

@xiota
Copy link
Author

xiota commented May 1, 2024

This seems like a complicated application to package. Is the script that's used to make the release appimage available for examination? Or is the procedure documented somewhere? If not, would you mind providing an overview of the steps needed to put this package together?

@arthuro555
Copy link
Contributor

Building an app image is, appart from the WASM build part I can't get to work, straightforward:

  1. Clone GDevelop and emsdk repositories
  2. Run npm install in GDevelop.js
  3. Run the script in the emsdk repo to install the version of emsdk documented in the readme of GDevelop.js
  4. Enter the emsdk environment
  5. Run nom run build in GDevelop.js
  6. Go to newIDE/electron-app
  7. Run npm run build -- -l AppImage
  8. Get the app image at newIDE/electron-app/dist/GDevelop-xxxxxx.appimage

@4ian
Copy link
Owner

4ian commented May 2, 2024

You can also check the CI doing the full build of the app (which is mostly what arthuro555 explained) here:

- run:
name: Install GDevelop.js dependencies and build it
command: cd GDevelop.js && npm install && cd ..
# Build GDevelop.js (and run tests to ensure it works)
- run:
name: Build GDevelop.js
# Use "--runInBand" as it's faster and avoid deadlocks on CircleCI Linux machines (probably because limited in processes number).
command: cd GDevelop.js && source ../emsdk/emsdk_env.sh && npm run build && npm test -- --runInBand && cd ..
# GDevelop IDE dependencies (after building GDevelop.js to avoid downloading a pre-built version)
- run:
name: Install GDevelop IDE dependencies
command: cd newIDE/app && npm install && cd ../electron-app && npm install
- save_cache:
paths:
- newIDE/electron-app/node_modules
- newIDE/app/node_modules
- GDevelop.js/node_modules
key: gd-linux-nodejs-dependencies-{{ checksum "newIDE/app/package.json" }}-{{ checksum "newIDE/electron-app/package.json" }}-{{ checksum "GDevelop.js/package.json" }}
# Build GDevelop IDE (seems like we need to allow Node.js to use more space than usual)
- run:
name: Build GDevelop IDE
command: export NODE_OPTIONS="--max-old-space-size=7168" && cd newIDE/electron-app && npm run build -- --linux --publish=never

(+ a bit of setup before to install packages)

@xiota
Copy link
Author

xiota commented May 2, 2024

That's the build script I was unable to find before. I was looking inside the .github directory.

Where I got stuck is the wrong copy of clang is run. Complains that wasm architecture does not exist.

@arthuro555
Copy link
Contributor

arthuro555 commented May 2, 2024

Here's my current PKGBUILD for the gdevelop package:

# Maintainer: Arthur Pacaud <[email protected]>
# Maintainer: Popolon <[email protected]>
# Contributor: Paulequilibrio
# Contributor: JKA Network <[email protected]>
# Contributor: Todor Imreorov for github <[email protected]>

pkgname=gdevelop
pkgver=5.3.195
pkgrel=1
pkgdesc="A full featured, open source game development software, allowing to create HTML5 and native games without knowing a programming language. All the game logic is made thanks to an intuitive and powerful event based system."
arch=('x86_64')
url=https://gdevelop.io
license=('MIT')
groups=()
provides=("gdevelop=${pkgver}")
conflicts=('gdevelop-bin' 'gdevelop-git')
makedepends=('npm' 'git' 'jq')
depends=('electron')
source=("gdevelop::git+https://github.com/4ian/GDevelop.git#tag=v${pkgver}"
  'emsdk::git+https://github.com/emscripten-core/emsdk.git'
  'gdevelop.desktop'
  'gdevelop.sh')
sha256sums=('SKIP'
  'SKIP'
  '81de9743eb30435302e429263b9bdcf6c3a8b36c52e29b87d9cd2d69be07b9e2'
  '8bcced9dacea29a0db4072365dd0df07f10fd29d2595700557b0a7c73a498645')

prepare() {
  "$srcdir/emsdk/emsdk" install 3.1.21
  "$srcdir/emsdk/emsdk" activate 3.1.21
}

build() {
  source "$srcdir/emsdk/emsdk_env.sh"

# CMake has a wrong output when running in fakeroot for some reason,
# so using prebuilt WASM instead of rebuilding it ourselves for now.
<<emsdk_build
  cd "$srcdir/gdevelop/GDevelop.js"
  npm install
  npm run build
emsdk_build

  cd "$srcdir/gdevelop/newIDE/app"
  npm install
  npx -y update-browserslist-db@latest

  cd "$srcdir/gdevelop/newIDE/electron-app"

  local electronVer="$(</usr/lib/electron/version)"
  local package="$(jq ".devDependencies.electron = \"$electronVer\"" package.json)"
  echo -E "${package}" > package.json

  npm install
  npm run build -- --linux --x64 --dir -c.electronDist="/usr/lib/electron" -c.electronVersion="$electronVer"
}

package() {
  mkdir -p "${pkgdir}/usr/share/gdevelop/"
  cp -dpr --no-preserve=ownership "$srcdir/gdevelop/newIDE/electron-app/dist/linux-unpacked/resources/" "${pkgdir}/usr/share/gdevelop/"
  chmod -R 755 "${pkgdir}/usr/share/gdevelop/"
  install -D -m 755 "$srcdir/gdevelop.sh" "${pkgdir}/usr/bin/gdevelop"
  install -D -m 644 "$srcdir/gdevelop.desktop" "${pkgdir}/usr/share/applications/gdevelop.desktop"
}

gdevelop.sh:

#!/bin/bash
exec "electron" "/usr/share/gdevelop/resources/app.asar" "$@"

@arthuro555
Copy link
Contributor

Notes:

  • The part that builds GDevelop.js is commented out which causes downloading a prebuilt binary from the CI
  • While it asks for the electron package, it won't actually run on the latest electron version. I believe the last working version was electron 27? Didn't update the pkgbuild yet, not sure if this isnt something we should address with a PR here
  • I did the patching of isDev manually by modifying the asar file, not included in the pkgbuild and ideally should be addressed with a PR here or a change in the way the app is ran

@xiota
Copy link
Author

xiota commented May 7, 2024

@arthuro555 I haven't tried your PKGBUILD. I've been trying to use extra/emscripten (3.1.55). My last attempt failed after the following:

  cd "$srcdir/$_pkgsrc/GDevelop.js"
  npm install --no-audit --no-fund --prefer-offline
  npm run build

With the error:

[ 96%] Linking CXX executable libGD.js
.../GDevelop-5.3.201/Binaries/Output/Release_Emscripten/libGDCore.bc:1:2: error: expected integer
    1 | !<arch>
      |  ^
1 error generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants