Skip to content

Commit

Permalink
Deb packaging (#457)
Browse files Browse the repository at this point in the history
* Deb packaging

* Add icons and desktop file

* Try this

* This should fix the icon

* Address comments

* Better category

* Capitalize VMClass

* Also try to cover raspbian

* Try to fix

* Remove sed bak

* Clean
  • Loading branch information
kivutar authored Aug 16, 2021
1 parent ba35d63 commit 89c1722
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 3 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ jobs:
- run: sudo apt-get update -q
- run: sudo apt-get install libopenal-dev xorg-dev libgl1-mesa-dev -y --allow-unauthenticated
- run: OS=Linux ARCH=x86_64 VERSION=$VERSION make tar
- run: make deb_defaults
- run: go build
- run: OS=Linux ARCH=x86_64 VERSION=$VERSION make deb
- run: sha256sum Ludo-Linux-x86_64-${VERSION}.tar.gz > Ludo-Linux-x86_64-${VERSION}.tar.gz.sha256

- name: Upload Release Asset
uses: alexellis/upload-assets@0.2.2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["./Ludo-*.tar.gz*"]'
asset_paths: '["./Ludo-*.tar.gz*", "./*.deb"]'

build_linux_arm:
runs-on: ubuntu-18.04
Expand All @@ -52,14 +55,17 @@ jobs:
- run: export PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig/
- run: GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc go build -v
- run: OS=Linux ARCH=arm VERSION=$VERSION make tar
- run: make deb_defaults
- run: GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc go build -v
- run: OS=Linux ARCH=arm VERSION=$VERSION make deb
- run: sha256sum Ludo-Linux-arm-${VERSION}.tar.gz > Ludo-Linux-arm-${VERSION}.tar.gz.sha256

- name: Upload Release Asset
uses: alexellis/upload-assets@0.2.2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["./Ludo-*.tar.gz*"]'
asset_paths: '["./Ludo-*.tar.gz*", "./*.deb"]'

build_osx:
runs-on: macos-latest
Expand Down
33 changes: 32 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,36 @@ tar: ludo $(SOBJS)
cp -r cores $(BUNDLENAME)/
tar -zcf $(BUNDLENAME).tar.gz $(BUNDLENAME)\

# For Debian

DEB_ARCH = amd64
ifeq ($(ARCH), arm)
DEB_ARCH = armhf
endif

deb_defaults:
sed -i.bak 's/"\.\/assets"/"\/usr\/local\/share\/ludo\/assets"/' settings/defaults.go
sed -i.bak 's/"\.\/database"/"\/usr\/local\/share\/ludo\/database"/' settings/defaults.go
sed -i.bak 's/"\.\/cores"/"\/usr\/local\/lib\/ludo\/cores"/' settings/defaults.go

deb: ludo $(SOBJS)
mkdir -p ludo_$(VERSION)-1_$(DEB_ARCH)/DEBIAN
mkdir -p ludo_$(VERSION)-1_$(DEB_ARCH)/usr/local/bin
mkdir -p ludo_$(VERSION)-1_$(DEB_ARCH)/usr/local/share/ludo
mkdir -p ludo_$(VERSION)-1_$(DEB_ARCH)/usr/local/lib/ludo
mkdir -p ludo_$(VERSION)-1_$(DEB_ARCH)/usr/local/share/applications
mkdir -p ludo_$(VERSION)-1_$(DEB_ARCH)/usr/share/icons/hicolor/1024x1024/apps/
cp ludo ludo_$(VERSION)-1_$(DEB_ARCH)/usr/local/bin
cp -r database ludo_$(VERSION)-1_$(DEB_ARCH)/usr/local/share/ludo
cp -r assets ludo_$(VERSION)-1_$(DEB_ARCH)/usr/local/share/ludo
cp -r cores ludo_$(VERSION)-1_$(DEB_ARCH)/usr/local/lib/ludo
cp assets/icon.png ludo_$(VERSION)-1_$(DEB_ARCH)/usr/share/icons/hicolor/1024x1024/apps/ludo.png
cp ludo.desktop ludo_$(VERSION)-1_$(DEB_ARCH)/usr/local/share/applications
cp control ludo_$(VERSION)-1_$(DEB_ARCH)/DEBIAN
sed -i.bak 's/VERSION/$(VERSION)/' ludo_$(VERSION)-1_$(DEB_ARCH)/DEBIAN/control
sed -i.bak 's/ARCH/$(DEB_ARCH)/' ludo_$(VERSION)-1_$(DEB_ARCH)/DEBIAN/control
rm ludo_$(VERSION)-1_$(DEB_ARCH)/DEBIAN/control.bak
dpkg-deb --build ludo_$(VERSION)-1_$(DEB_ARCH)

clean:
rm -rf Ludo.app ludo wc *.dmg $(BUNDLENAME)-* cores/
rm -rf Ludo.app ludo wc *.dmg *.deb $(BUNDLENAME)-* cores/
10 changes: 10 additions & 0 deletions control
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Package: ludo
Version: VERSION
Architecture: ARCH
Depends: libc6, libopenal1, libgl1
Maintainer: Jean-André Santoni jean.andre.santoni@gmail.com
Section: games
Priority: optional
Homepage: https://ludo.libretro.com
Description: ludo
A minimalist frontend for emulators
12 changes: 12 additions & 0 deletions ludo.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Desktop Entry]
Name=Ludo
Icon=ludo
GenericName=A minimalist frontend for emulators
Exec=ludo
Terminal=false
StartupNotify=false
StartupWMClass=Ludo
Type=Application
Categories=Game;Emulator;
Keywords=libretro;emulator;
PrefersNonDefaultGPU=true

0 comments on commit 89c1722

Please sign in to comment.