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

how can I add a prebuild binary for arch here in github? #6

Open
cahmer opened this issue Sep 7, 2024 · 8 comments
Open

how can I add a prebuild binary for arch here in github? #6

cahmer opened this issue Sep 7, 2024 · 8 comments

Comments

@cahmer
Copy link
Contributor

cahmer commented Sep 7, 2024

I built the binary for arch, maybe I could simply build an AUR package but, for more simpler distribution one would need a method to install that more simple. So people could install it directly via an shell script shudder. Maybe something like AppImage or flatpak would work. AppImage would be simpler.

@moritztng
Copy link
Owner

Right now, I'm attaching the binary to the GitHub release and load it with the install script. So maybe that's the simplest solution?

@HalosGhost
Copy link

An AUR package is a really good place to start; it both gives other arch users a leg-up on building it from-source (and potentially makes it easier for other architectures (via archlinux ARM) to join in), and enables anyone who's going to build it anyway to host a repo with it.

Moreover, things like https://github.com/marketplace/actions/archlinux-pkgbuild could be used to automatically build packages as a part of the CI in the interim of a repo hosting a build.

@moritztng
Copy link
Owner

Thanks for the suggestions! I also want to make it simple for players without adding complexity in the code.
Right now the only dependencies are curl and glfw. The install script also downloads font.png and gamepad.txt. Building from source just means cloning the repo, installing the dependencies and than make.

What would be the benefits that justify the added complexity? And that would mean we have custom solutions for all future operating systems right?

@moritztng
Copy link
Owner

Oh and I also added the arch binaries. Right now, the install script detects whether the distribution is arch or debian, installs the right dependencies and downloads the correct binary.

@HalosGhost
Copy link

That's a fair question.

To some extent, Arch (and, due to some similar goals, Alpine) is an anomaly among linux distros; its package-building system (and the package format itself) is essentially just designed to take a set of build instructions and make it into a package. The only benefit of putting a PKGBUILD (standardized-format build instructions) together is to minimize work for Arch users.

If you're worried about packaging overhead, then don't do this! Even if it's not hard to put together, it does set a precedent of providing package files for a distro. And, by keeping the build process simple, you make it easy for anyone to package for most targets (especially so for Arch).

Thankfully, the AUR allows anyone to submit packages, so if someone's interested in maintaining the package for Arch, they can do so. ☺

@moritztng
Copy link
Owner

Thanks man, this response was very informative.

For now, maybe the best solution is to focus on a very good & simple install script and perhaps in the future we will have official packages?

@imbev
Copy link

imbev commented Oct 14, 2024

Thanks man, this response was very informative.

For now, maybe the best solution is to focus on a very good & simple install script and perhaps in the future we will have official packages?

The ideal packaging is a Dockerfile (server) and a Flatpak package (desktop). This will work on every server distro, every desktop distro, and completely eliminate dependency issues.

@imbev
Copy link

imbev commented Oct 15, 2024

I've created an almost working Flatpak manifest:

id: io.github.moritztng.HackerLeague
runtime: org.freedesktop.Platform
runtime-version: '24.08'
sdk: org.freedesktop.Sdk
command: hacker-league.sh
finish-args:
  - --share=ipc
  - --socket=fallback-x11
  - --socket=wayland
  - --device=dri
  - --env=LD_LIBRARY_PATH=/app/lib:/app/lib64
modules:
  - name: glfw
    buildsystem: cmake
    config-opts:
      - -DBUILD_SHARED_LIBS:BOOL=ON
    sources: 
      - type: archive
        url: https://github.com/glfw/glfw/archive/refs/tags/3.4.tar.gz
        sha256: c038d34200234d071fae9345bc455e4a8f2f544ab60150765d7704e08f3dac01

  - name: curl
    buildsystem: cmake
    sources:
      - type: archive
        url: https://github.com/curl/curl/archive/refs/tags/curl-8_10_1.tar.gz
        sha256: 5aaf131294f734756325dd99d849518c9a5060fc702517ab3064c76257dc700c

  - name: hacker-league
    buildsystem: simple
    build-commands:
      - install -Dm755 hacker-league_x86_64_debian /app/bin/hacker-league
      - install -Dm 644 gamepad.txt /app/share/gamepad.txt
      - echo "#!/usr/bin/env sh" > /app/bin/hacker-league.sh
      - echo "set -e" >> /app/bin/hacker-league.sh
      - echo "cp /app/share/gamepad.txt . || true" >> /app/bin/hacker-league.sh
      - echo "hacker-league" >> /app/bin/hacker-league.sh
      - chmod +x /app/bin/hacker-league.sh
    sources:
      - type: file
        url: https://github.com/moritztng/hacker-league/releases/download/v0.1/hacker-league_x86_64_debian
        sha256: 603bdee4561bc7d2d25376792aac7162e704996653343bad63a7c45714231303
      - type: file
        url: https://raw.githubusercontent.com/moritztng/hacker-league/cf6542de93cde484696ca21dae0d8ba4d3b06c87/gamepad.txt
        sha256: fd2a33fe2718906672120b71fc40cfb4590e262373c9d71310ba9969ea0507c5
      - type: file
        url: https://raw.githubusercontent.com/moritztng/hacker-league/cf6542de93cde484696ca21dae0d8ba4d3b06c87/font.png
        sha256: be0099bdc6912974c30f727e44fa759c2cf3973efa00f8b12258b243e4c7a8b7

However there is an error with curl:

hacker-league: /app/lib64/libcurl.so.4: no version information available (required by hacker-league)
Usage
Singleplayer: hacker-league
Multiplayer: hacker-league servers or hacker-league <IP Address> <Port>

/app/bin/hacker-league.sh: line 4:     4 Segmentation fault      (core dumped) hacker-league

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

No branches or pull requests

4 participants