From 23880f5a1fab43e3a83043ddd77929f728a6b2fa Mon Sep 17 00:00:00 2001 From: Gabriel Pariat Date: Mon, 14 Nov 2022 06:12:54 -0500 Subject: [PATCH] enfin un appimage qui marche! --- .gitignore | 6 +++ AppImageBuilder.yml | 95 ++++++++++++++++++++++++++++++++++++++ Makefile | 0 build-appimage.sh | 18 ++++++++ client/client.asd | 3 ++ client/src/constants.lisp | 2 +- client/src/gui/text.lisp | 3 +- client/src/package.lisp | 3 +- icon.png | Bin 0 -> 1359 bytes init.lisp | 4 +- server/server.asd | 3 ++ server/src/package.lisp | 3 +- server/src/server.lisp | 3 ++ 13 files changed, 136 insertions(+), 7 deletions(-) create mode 100644 .gitignore create mode 100644 AppImageBuilder.yml delete mode 100644 Makefile create mode 100755 build-appimage.sh create mode 100644 icon.png diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a0b8319 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +AppDir/ +appimage-builder-cache +system-index.txt +*.tar.gz +bin/ +*.AppImage \ No newline at end of file diff --git a/AppImageBuilder.yml b/AppImageBuilder.yml new file mode 100644 index 0000000..794c760 --- /dev/null +++ b/AppImageBuilder.yml @@ -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 diff --git a/Makefile b/Makefile deleted file mode 100644 index e69de29..0000000 diff --git a/build-appimage.sh b/build-appimage.sh new file mode 100755 index 0000000..266ac54 --- /dev/null +++ b/build-appimage.sh @@ -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/ diff --git a/client/client.asd b/client/client.asd index 846a23f..7e69818 100644 --- a/client/client.asd +++ b/client/client.asd @@ -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") diff --git a/client/src/constants.lisp b/client/src/constants.lisp index 981119a..a77f47f 100644 --- a/client/src/constants.lisp +++ b/client/src/constants.lisp @@ -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*) diff --git a/client/src/gui/text.lisp b/client/src/gui/text.lisp index a769621..1ac704b 100644 --- a/client/src/gui/text.lisp +++ b/client/src/gui/text.lisp @@ -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 @@ (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 diff --git a/client/src/package.lisp b/client/src/package.lisp index ff4bcae..0a12af9 100644 --- a/client/src/package.lisp +++ b/client/src/package.lisp @@ -1,4 +1,5 @@ (defpackage :pong.client (:use :cl) (:local-nicknames (:r :raylib) - (:v :3d-vectors))) + (:v :3d-vectors)) + (:export #:main)) diff --git a/icon.png b/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f08d051f4e65fb7124dbd5f6f9443bd8226dc886 GIT binary patch literal 1359 zcmV-V1+e;wP)EX>4Tx04R}tkv&MmKpe$iTSd_phjtKg$WWau6u)rPDionYs1;guFuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|=;Wm6A|?JWDYS_3;J6>}?mh0_0scmXsb*IkP&La) zClf+8w<`3!q8}lIF@?CqOnpuiQ}7&L_we!cF2=LG&;2<x%k;EdFAVPqQ8p^1^LX1|86ccIMPk8u;9KT2|nOtQs zax9<<6_Voz|AXJ%nuUpRHz}9^x?gPjV+82g1)6o+{yw(t<_QpZ2ClTWzuEw1K1r{) zwdfHrunk;Xw>5bWxZD8-pLEHP94SE4Unl_YXY@@uAbbn-t+~Cm_Hp_EWT>mu4RCM> zj20<--Q(T8oxS~grq$mM*4c8;D=-)900006VoOIv0RI600RN!9r;`8x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru<_irJ043R2WEcPd02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{00SpUL_t(|+U?m*h?Qj&!13RN6lD{o6-BOuB8XhHh#;ng zAZ`kg3M2?ah-}lsKA?@3786)Rw5Uap5JUvg$09L`iV_B)kQO0MG!prdgWoeb&ZMW! z5nkW!OpP-)n&upMcz8a}bDsBq&w1}T_x2#nW4XjUmjX}#3P1rU00p1`6o3Ly017|> zC;$bZ02F`%Pyk>9Ch!MF@bNTHU5R7ZKgFKqIC7DU7ms5UpW$%Q-+*ti6gOwDgYM>> zAH!+%<53Ld_$RE&J?rpu&JW`9oZp=`cjfpLPPFd-I`-u~M;rHPNc^QeDTJ_0SS9Qe z?h}p)?+a^leM|Pch1J4w;jY#hOLE-SeJ1;+-67$NJnMw;NzNY>whMQpjdxS`1K|~6 zyu&k`Z==GOd9S^~iVN4L_J9Fw!wy`BtFaYV<@(9&AHs*ZKF~t@Ykq=l-H8tNmf&{0 zfv@ls*5C%bfba91?{fe1IFO+_nQTk%-JYR+({w^$C9c6^>0W`pd|+7I2$QL#lkWK# zej;CpD-!4~EKAq!&yb0H7cIr-xI1-!_#3DF!Cjl#~{HzK?(Y)uy*7lwuB^30FYmB-SJH)V(r9u|&F;{JWY zFKOer@Tt&y;hrA#*H|S&1)u;FfG){QYl=A!V5T+2|0)F9HN}Cf0}kS~Onmm_+}Ek| zQq~v~xz;6#uC-1z#r>Hmz0*jpCUW0+>*)9o5It=+3wu&-|>KEO|b}9VoR=l z)5zu5WW{)Crmt6I3VSZYY0ic~v!>XYZoUq^nVX+&>>bMf#_S(xNID5f=Hbd#na&`~y&0mP-TnNmh^<{XB z3xoOX(FHqI4p%Ku017|>C;$bZ02F`%Pyh-*0Vn_kpa2wr0#E=7KmnLf@+ZdrOqG}X RR8;@~002ovPDHLkV1hu9cd!5e literal 0 HcmV?d00001 diff --git a/init.lisp b/init.lisp index a02e75e..78666b0 100644 --- a/init.lisp +++ b/init.lisp @@ -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) diff --git a/server/server.asd b/server/server.asd index 3589535..ea8c074 100644 --- a/server/server.asd +++ b/server/server.asd @@ -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") diff --git a/server/src/package.lisp b/server/src/package.lisp index 15a516c..c23adb2 100644 --- a/server/src/package.lisp +++ b/server/src/package.lisp @@ -1,3 +1,4 @@ (defpackage :pong.server (:use :cl) - (:nicknames :s)) + (:nicknames :s) + (:export #:main)) diff --git a/server/src/server.lisp b/server/src/server.lisp index 316ecd6..310416f 100644 --- a/server/src/server.lisp +++ b/server/src/server.lisp @@ -184,4 +184,7 @@ ;; (start-server 54321) ;; (stop-server) +(defun main () + (unwind-protect (start-server 54321) + (stop-server)))