Browse Source

enfin un appimage qui marche!

master
Gabriel Pariat 2 years ago
parent
commit
23880f5a1f
  1. 6
      .gitignore
  2. 95
      AppImageBuilder.yml
  3. 0
      Makefile
  4. 18
      build-appimage.sh
  5. 3
      client/client.asd
  6. 2
      client/src/constants.lisp
  7. 3
      client/src/gui/text.lisp
  8. 3
      client/src/package.lisp
  9. BIN
      icon.png
  10. 4
      init.lisp
  11. 3
      server/server.asd
  12. 3
      server/src/package.lisp
  13. 3
      server/src/server.lisp

6
.gitignore vendored

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
AppDir/
appimage-builder-cache
system-index.txt
*.tar.gz
bin/
*.AppImage

95
AppImageBuilder.yml

@ -0,0 +1,95 @@ @@ -0,0 +1,95 @@
# appimage-builder recipe see https://appimage-builder.readthedocs.io for details
version: 1
AppDir:
path: /home/gabriel/pariatech/games/pong/AppDir
app_info:
id: com.pariatech.pong
name: Pariatech's Pong
icon: icon
version: latest
exec: usr/bin/sbcl
exec_args: "--core \"$APPDIR/usr/bin/client\""
apt:
arch:
- amd64
allow_unauthenticated: true
sources:
- sourceline: deb http://ftp.us.debian.org/debian unstable main contrib non-free
include:
- libffi6:amd64
- libxcursor1:amd64
- libxdmcp6:amd64
- libxext6:amd64
- libxfixes3:amd64
- libxi6:amd64
- libxinerama1:amd64
- libxrandr2:amd64
- libxrender1:amd64
- libxxf86vm1:amd64
- libzstd1:amd64
- nvidia-driver-bin
- sbcl
- cl-quicklisp
files:
include:
- /lib/x86_64-linux-gnu/libGLX.so.0
- /lib/x86_64-linux-gnu/libGLX_nvidia.so.0
- /lib/x86_64-linux-gnu/libGLdispatch.so.0
- /lib/x86_64-linux-gnu/libX11.so.6
- /lib/x86_64-linux-gnu/libXau.so.6
- /lib/x86_64-linux-gnu/libXcursor.so.1
- /lib/x86_64-linux-gnu/libXdmcp.so.6
- /lib/x86_64-linux-gnu/libXext.so.6
- /lib/x86_64-linux-gnu/libXfixes.so.3
- /lib/x86_64-linux-gnu/libXi.so.6
- /lib/x86_64-linux-gnu/libXinerama.so.1
- /lib/x86_64-linux-gnu/libXrandr.so.2
- /lib/x86_64-linux-gnu/libXrender.so.1
- /lib/x86_64-linux-gnu/libXxf86vm.so.1
- /lib/x86_64-linux-gnu/libbsd.so.0
- /lib/x86_64-linux-gnu/libffi.so.6
- /lib/x86_64-linux-gnu/libmd.so.0
- /lib/x86_64-linux-gnu/libnvidia-glcore.so.510.85.02
- /lib/x86_64-linux-gnu/libnvidia-glsi.so.510.85.02
- /lib/x86_64-linux-gnu/libnvidia-tls.so.510.85.02
- /lib/x86_64-linux-gnu/libzstd.so.1
- /usr/lib/locale/locale-archive
- /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
- /usr/lib/x86_64-linux-gnu/libc.so.6
- /usr/lib/x86_64-linux-gnu/libdl.so.2
- /usr/lib/x86_64-linux-gnu/libm.so.6
- /usr/lib/x86_64-linux-gnu/libpthread.so.0
- /usr/lib/x86_64-linux-gnu/librt.so.1
- /usr/local/lib/libraylib.so
- /usr/local/lib/libraylib.so.4.2.0
- client/assets/ComicMono.ttf
exclude:
- usr/share/man
- usr/share/doc/*/README.*
- usr/share/doc/*/changelog.*
- usr/share/doc/*/NEWS.*
- usr/share/doc/*/TODO.*
test:
fedora-30:
image: appimagecrafters/tests-env:fedora-30
command: ./AppRun
use_host_x: true
debian-stable:
image: appimagecrafters/tests-env:debian-stable
command: ./AppRun
use_host_x: true
archlinux-latest:
image: appimagecrafters/tests-env:archlinux-latest
command: ./AppRun
use_host_x: true
centos-7:
image: appimagecrafters/tests-env:centos-7
command: ./AppRun
use_host_x: true
ubuntu-xenial:
image: appimagecrafters/tests-env:ubuntu-xenial
command: ./AppRun
use_host_x: true
AppImage:
arch: x86_64
update-information: guess

18
build-appimage.sh

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
#!/bin/sh
rm -rf $PWD/AppDir/
mkdir -p $PWD/AppDir/usr/bin
mkdir -p $PWD/AppDir/usr/share/icons
cp $PWD/icon.png $PWD/AppDir/usr/share/icons/
sbcl --load "init.lisp" --eval "(asdf:make \"client\")" --eval "(quit)"
appimage-builder --skip-tests --skip-appimage
cp $PWD/bin/client $PWD/AppDir/usr/bin/
appimage-builder --skip-script --skip-build --skip-tests
tar -pzcvf Pariatech\'s\ Pong-latest-x86_64.tar.gz Pariatech\'s\ Pong-latest-x86_64.AppImage client/assets/

3
client/client.asd

@ -7,6 +7,9 @@ @@ -7,6 +7,9 @@
:version "0.0.1"
:serial t
:depends-on ("game" "cl-raylib" "3d-vectors" "usocket" "bordeaux-threads" "str")
:build-operation "program-op"
:build-pathname "../../bin/client"
:entry-point "pong.client:main"
:pathname "src"
:components
((:file "package")

2
client/src/constants.lisp

@ -14,4 +14,4 @@ @@ -14,4 +14,4 @@
(defparameter *menu-online-join* "Join Game")
(defparameter *score-txt-size* 32)
(defparameter *score-padding* 20)
(defparameter *score-font* "client/assets/ComicMono.ttf")
(defparameter *score-font* *menu-font*)

3
client/src/gui/text.lisp

@ -1,6 +1,5 @@ @@ -1,6 +1,5 @@
(in-package #:gui)
(defclass text (element)
((w :initarg :w :initform 0.0 :reader w)
(h :initarg :h :initform 0.0 :reader h)
@ -15,7 +14,7 @@ @@ -15,7 +14,7 @@
(setf (gethash font *fonts*) (make-hash-table)))))
(or (gethash font-size font-family)
(setf (gethash font-size font-family)
(r:load-font-ex font font-size (cffi:null-pointer) 0)))))
(r:load-font-ex (format nil "~a~a" (uiop/os:getcwd) font) font-size (cffi:null-pointer) 0)))))
(defmethod draw ((text text))
(with-slots (font font-size text screen-x screen-y color spacing visible) text

3
client/src/package.lisp

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
(defpackage :pong.client
(:use :cl)
(:local-nicknames (:r :raylib)
(:v :3d-vectors)))
(:v :3d-vectors))
(:export #:main))

BIN
icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

4
init.lisp

@ -9,5 +9,5 @@ @@ -9,5 +9,5 @@
(pushnew #P"/usr/local/lib/" cffi:*foreign-library-directories*)
(ql:quickload "client")
(in-package :pong.client)
;; (ql:quickload "client")
;; (in-package :pong.client)

3
server/server.asd

@ -7,6 +7,9 @@ @@ -7,6 +7,9 @@
:version "0.0.1"
:serial t
:depends-on ("game" "usocket" "bordeaux-threads")
:build-operation "program-op"
:build-pathname "../../AppDir/usr/bin/server"
:entry-point "pong.server:main"
:pathname "src"
:components
((:file "package")

3
server/src/package.lisp

@ -1,3 +1,4 @@ @@ -1,3 +1,4 @@
(defpackage :pong.server
(:use :cl)
(:nicknames :s))
(:nicknames :s)
(:export #:main))

3
server/src/server.lisp

@ -184,4 +184,7 @@ @@ -184,4 +184,7 @@
;; (start-server 54321)
;; (stop-server)
(defun main ()
(unwind-protect (start-server 54321)
(stop-server)))

Loading…
Cancel
Save