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

Flatpak #44

Open
JakobDev opened this issue Jun 27, 2023 · 0 comments
Open

Flatpak #44

JakobDev opened this issue Jun 27, 2023 · 0 comments

Comments

@JakobDev
Copy link

I've created a Flatpak for OCEmu. If you don't know, what a Flatpak is, think of it as Docker, but for Linux Desktop Programs. That means, any Linux User can install OCEmu without needing to deal with luarocks. It can also be uploaded to Flathub.

Here are the needed files. Put they in the same directory with the given name.

io.github.zenith391.OCEmu.yaml

id: io.github.zenith391.OCEmu
runtime: org.freedesktop.Platform
runtime-version: '22.08'
sdk: org.freedesktop.Sdk
command: ocemu
finish-args:
  - --socket=fallback-x11
  - --socket=wayland
  - --device=all
  - --share=ipc
  - --share=network
  - --socket=pulseaudio

modules:
  - shared-modules/lua5.3/lua-5.3.5.json

  - name: luarocks
    buildsystem: autotools
    sources:
      - type: git
        url: https://github.com/luarocks/luarocks.git
        tag: v3.9.2
        commit: b5a1b7de2ab8a0d3eb2c517af1de6f73e48fbe23
    cleanup:
      - /bin
      - /etc

  - luarocks-packages.yaml

  - name: ocemu
    buildsystem: simple
    build-commands:
      - cd luaffifb && luarocks make
      - mkdir .p $FLATPAK_DEST/ocemu
      - cp -r ./src/* $FLATPAK_DEST/ocemu
      - cp -r OpenComputers/src/main/resources/assets/opencomputers/lua $FLATPAK_DEST/ocemu
      - cp -r OpenComputers/src/main/resources/assets/opencomputers/loot $FLATPAK_DEST/ocemu
      - cp OpenComputers/src/main/resources/assets/opencomputers/font.hex $FLATPAK_DEST/ocemu
      - cp $FLATPAK_DEST/bin/lua $FLATPAK_DEST/bin/lua5.3
      - install -Dm755 ocemu.sh $FLATPAK_DEST/bin/ocemu
      - install -Dm644 icon.png $FLATPAK_DEST/share/icons/hicolor/256x256/apps/$FLATPAK_ID.png
      - desktop-file-edit --set-icon=$FLATPAK_ID --remove-key Path --set-comment "OpenComputers Emulator in Lua" --set-key Exec --set-value ocemu OCEmu.desktop
      - install -Dm644 OCEmu.desktop $FLATPAK_DEST/share/applications/$FLATPAK_ID.desktop
    sources:
      - type: git
        url: https://github.com/zenith391/OCEmu.git
        commit: 0dd3789abd567881f25d72cb5ebc2b2a2560f4f3

      - type: git
        url: https://github.com/MightyPirates/OpenComputers.git
        tag: 1.12.2-forge/1.8.2
        commit: b4abbf991c20a2e66ee54089bf080d8e7e46f426
        dest: OpenComputers

      - type: script
        dest-filename: ocemu.sh
        commands:
          - cd /app/ocemu
          - exec lua5.3 ./boot.lua

luarocks-packages.yaml

build-commands: []
buildsystem: simple
modules:
- build-commands:
  - luarocks build --tree $FLATPAK_DEST luafilesystem-1.8.0-1.src.rock
  buildsystem: simple
  name: luarocks-package-luafilesystem
  sources:
  - sha256: 576270a55752894254c2cba0d49d73595d37ec4ea8a75e557fdae7aff80e19cf
    type: file
    url: https://luarocks.org/luafilesystem-1.8.0-1.src.rock
- build-commands:
  - luarocks build --tree $FLATPAK_DEST luautf8-0.1.5-2.src.rock
  buildsystem: simple
  name: luarocks-package-luautf8
  sources:
  - sha256: 68bd8e3c3e20f98fceb9e20d5a7a50168202c22eb45b87eff3247a0608f465ae
    type: file
    url: https://luarocks.org/luautf8-0.1.5-2.src.rock
- build-commands:
  - luarocks build --tree $FLATPAK_DEST luasocket-3.1.0-1.src.rock
  buildsystem: simple
  name: luarocks-package-luasocket
  sources:
  - sha256: f4a207f50a3f99ad65def8e29c54ac9aac668b216476f7fae3fae92413398ed2
    type: file
    url: https://luarocks.org/luasocket-3.1.0-1.src.rock
- build-commands:
  - luarocks build --tree $FLATPAK_DEST luasec-1.3.1-1.src.rock
  buildsystem: simple
  name: luarocks-package-luasec
  sources:
  - sha256: 234353b695cdec264b22e6ff5472f4f7f70cd10a9b65f6fd4ad65652c786bb20
    type: file
    url: https://luarocks.org/luasec-1.3.1-1.src.rock
name: luarocks-packages

You also need to clone the shared-modules repo.

Here are instructions how to build

Tell me, if you're intrested

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

1 participant