summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEcho J2024-09-23 00:46:36 +0300
committerEcho J2024-09-23 00:46:36 +0300
commite5ba1dfcfca84fb4ae5501d2c9b52d54040ee249 (patch)
tree6479982e956d0593c2b23ff86115c5d612a18a6e
parent7283ab5834c8758ec1264dd0475d9997372a0f54 (diff)
downloadaur-classicube.tar.gz
Update to 1.3.7
And add a nvchecker file
-rw-r--r--.SRCINFO12
-rw-r--r--.gitignore2
-rw-r--r--.nvchecker.toml3
-rw-r--r--ClassiCube.desktop10
-rw-r--r--ClassiCubeLauncher22
-rw-r--r--PKGBUILD42
-rw-r--r--sdl2-dialog.patch51
7 files changed, 55 insertions, 87 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 66fb6066f824..a783968eacd0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = classicube
pkgdesc = A custom Minecraft Classic compatible client written in C from scratch
- pkgver = 1.3.6
+ pkgver = 1.3.7
pkgrel = 1
url = https://www.classicube.net/
arch = x86_64
@@ -13,13 +13,11 @@ pkgbase = classicube
depends = openal
depends = sdl2
optdepends = zenity: Dialog box support
- source = ClassiCube-1.3.6.tar.gz::https://github.com/ClassiCube/ClassiCube/archive/1.3.6.tar.gz
+ source = ClassiCube-1.3.7.tar.gz::https://github.com/ClassiCube/ClassiCube/archive/1.3.7.tar.gz
source = sdl2-dialog.patch
source = ClassiCubeLauncher
- source = ClassiCube.desktop
- sha256sums = fab780f4dcf0669a0f94683c9b6596f40cb83e09727a3b91aaae5e934a9740b0
- sha256sums = 4bc98c1f4f881d28f8c042b3d0d6c25c63303965702b82cfed6f17909922a74c
- sha256sums = abcf649e1e886f0c3278648ebf4eb8f6d070ac1358e26920ceaa396624cac91e
- sha256sums = 2c11b3f517f68b6322b007922999d7a8b51fab183ee6cc51c0260f3ae56d0a4a
+ sha256sums = 04f96eb2cc338b81a36a843b7d1f23de54ef539a80d2b793bbef69aa9043585f
+ sha256sums = 277b5ab664238d5f3a55d7ba0e75e92deb120b4bb8e29d0b8c22c2bfd9bda34f
+ sha256sums = 8a562c0358bca5217ea914f76dfe821a121d035d72b98287162750b850a4c25d
pkgname = classicube
diff --git a/.gitignore b/.gitignore
index 83797b990902..b53d6ca5f8e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,7 +3,7 @@
# But not these files...
!.gitignore
-!ClassiCube.desktop
+!.nvchecker.toml
!PKGBUILD
!.SRCINFO
!ClassiCubeLauncher
diff --git a/.nvchecker.toml b/.nvchecker.toml
new file mode 100644
index 000000000000..8c3175fe23a3
--- /dev/null
+++ b/.nvchecker.toml
@@ -0,0 +1,3 @@
+[classicube]
+source = "git"
+git = "https://github.com/ClassiCube/ClassiCube.git"
diff --git a/ClassiCube.desktop b/ClassiCube.desktop
deleted file mode 100644
index 85afdb2f82d9..000000000000
--- a/ClassiCube.desktop
+++ /dev/null
@@ -1,10 +0,0 @@
-[Desktop Entry]
-Name=ClassiCube
-Exec=ClassiCubeLauncher %u
-Comment=Sandbox building-block game
-Type=Application
-Icon=ClassiCube
-Categories=Game;ActionGame;
-Terminal=false
-MimeType=x-scheme-handler/mc;
-StartupWMClass=ClassiCube
diff --git a/ClassiCubeLauncher b/ClassiCubeLauncher
index 30181fa3f02d..dc83e3ec9def 100644
--- a/ClassiCubeLauncher
+++ b/ClassiCubeLauncher
@@ -6,24 +6,4 @@ set -eu
mkdir -p "${_xdg_data}/ClassiCube"
cd "${_xdg_data}/ClassiCube"
-# TODO: Remove this once mc:// parsing gets added in the client
-if [ "$#" -eq 1 ]; then
- case "$1" in
- 'mc://'*)
- IFS='/' read -ra _args <<< "$1"
-
- if [ "${#_args[@]}" -eq 5 ]; then
- for i in {2..4}; do [ -z "${_args[$i]}" ] && exit 1; done
-
- IFS=':' read -ra _args2 <<< "${_args[2]}"
- echo "Username: ${_args[3]}, password: ${_args[4]}, address: ${_args2[0]}, port: ${_args2[1]}"
- exec ClassiCube "${_args[3]}" "${_args[4]}" "${_args2[0]}" "${_args2[1]}"
- fi
- ;;
- *)
- exec ClassiCube "$@"
- ;;
- esac
-else
- exec ClassiCube "$@"
-fi
+exec ClassiCube "$@"
diff --git a/PKGBUILD b/PKGBUILD
index 6446390c0353..ad37e27dd784 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,7 +6,7 @@
_pkgname=ClassiCube
pkgname=classicube
-pkgver=1.3.6
+pkgver=1.3.7
pkgrel=1
pkgdesc="A custom Minecraft Classic compatible client written in C from scratch"
arch=('x86_64')
@@ -18,27 +18,23 @@ depends=('bash' 'curl' 'libglvnd' 'openal' 'sdl2')
optdepends=('zenity: Dialog box support')
source=("${_pkgname}-${pkgver}.tar.gz::https://github.com/${_pkgname}/${_pkgname}/archive/${pkgver}.tar.gz"
sdl2-dialog.patch
- ClassiCubeLauncher
- ClassiCube.desktop)
-sha256sums=('fab780f4dcf0669a0f94683c9b6596f40cb83e09727a3b91aaae5e934a9740b0'
- '4bc98c1f4f881d28f8c042b3d0d6c25c63303965702b82cfed6f17909922a74c'
- 'abcf649e1e886f0c3278648ebf4eb8f6d070ac1358e26920ceaa396624cac91e'
- '2c11b3f517f68b6322b007922999d7a8b51fab183ee6cc51c0260f3ae56d0a4a')
+ ClassiCubeLauncher)
+sha256sums=('04f96eb2cc338b81a36a843b7d1f23de54ef539a80d2b793bbef69aa9043585f'
+ '277b5ab664238d5f3a55d7ba0e75e92deb120b4bb8e29d0b8c22c2bfd9bda34f'
+ '8a562c0358bca5217ea914f76dfe821a121d035d72b98287162750b850a4c25d')
prepare() {
cd "${_pkgname}-${pkgver}"
- # Don't override makepkg compile flags
- sed -i -e '0,/CFLAGS=/{s//CFLAGS?=/}' -e '0,/LDFLAGS=/{s//LDFLAGS?=/}' Makefile
+ ## TODO: Upstream most of these changes by 1.3.8
- # Change to SDL2 on Linux
- sed -i '0,/-lX11 -lXi/{s//-lSDL2/}' Makefile
- sed -i -e '0,/CC_BUILD_X11/{//d}' -e '0,/CC_BUILD_XINPUT2/{//d}' src/Core.h
- sed -i '/#error/d' src/Window_SDL.c
- patch --no-backup-if-mismatch --binary -Np1 -i ../sdl2-dialog.patch
+ # Don't override external compile flags
+ sed -i -e '0,/CFLAGS =/{s//CFLAGS ?=/}' -e '0,/LDFLAGS =/{s//LDFLAGS?=/}' Makefile
- # Fix an incompatible pointer error (this is unnecessary in the git version)
- sed -i 's/samples, count \* 2/(cc_uint8*)samples, count * 2/' src/Resources.c
+ # Switch to SDL2 on Linux (SDL3 is still in development)
+ sed -i '0,/-lX11 -lXi/{s//-lSDL2 -lm/}' Makefile
+ sed -i -e '0,/DEFAULT_WIN_BACKEND CC_WIN_BACKEND_X11/{//d}' -e '0,/CC_BUILD_XINPUT2/{//d}' src/Core.h
+ patch --no-backup-if-mismatch --binary -Np1 -i ../sdl2-dialog.patch
# Remove spammy log calls
sed -i '/Face:/d' src/SystemFonts.c
@@ -47,12 +43,16 @@ prepare() {
# Make SDL dialogs actually work
sed -i '/SIGCHLD/d' src/Platform_Posix.c
- # Fix SDL fullscreen exit
- sed -i 's/SDL_RestoreWindow(win_handle); return 0;/return SDL_SetWindowFullscreen(win_handle, 0);/' src/Window_SDL.c
+ # Fix SDL2 fullscreen exit
+ sed -i 's/SDL_RestoreWindow(win_handle); return 0;/return SDL_SetWindowFullscreen(win_handle, 0);/' src/Window_SDL2.c
+
+ # Fix up the upstream desktop file
+ sed -i -e 's/net.classicube.flatpak.client/ClassiCube/g' \
+ -e 's/ClassiCubeLauncher/ClassiCubeLauncher %u/' misc/linux/flatpak/net.classicube.flatpak.client.desktop
}
build() {
- export CFLAGS+=" -DCC_BUILD_SDL -DCC_BUILD_GLMODERN"
+ export CFLAGS+=" -DDEFAULT_WIN_BACKEND=CC_WIN_BACKEND_SDL2"
make -C "${_pkgname}-${pkgver}"
}
@@ -62,8 +62,8 @@ package() {
install -Dm755 "${_pkgname}" "${pkgdir}/usr/bin/ClassiCube"
install -Dm644 license.txt "${pkgdir}/usr/share/licenses/${pkgname}/license.txt"
install -Dm644 misc/CCicon.png "${pkgdir}/usr/share/pixmaps/${_pkgname}.png"
+ install -Dm644 misc/linux/flatpak/net.classicube.flatpak.client.desktop "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
- # TODO: Use upstream launch files directly once there's a new release
+ # TODO: Use upstream launch script directly by 1.3.8
install -Dm755 ../ClassiCubeLauncher "$pkgdir/usr/bin/ClassiCubeLauncher"
- install -Dm644 ../${_pkgname}.desktop "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
}
diff --git a/sdl2-dialog.patch b/sdl2-dialog.patch
index b88419b6c785..3b4bf9a83510 100644
--- a/sdl2-dialog.patch
+++ b/sdl2-dialog.patch
@@ -1,24 +1,17 @@
-diff -ur ClassiCube-1.3.6.orig/src/Window_SDL.c ClassiCube-1.3.6/src/Window_SDL.c
---- ClassiCube-1.3.6.orig/src/Window_SDL.c 2023-08-29 01:52:14.000000000 +0300
-+++ ClassiCube-1.3.6/src/Window_SDL.c 2024-06-25 18:46:52.547983162 +0300
-@@ -6,6 +6,7 @@
+--- ClassiCube-1.3.7.orig/src/Window_SDL2.c 2024-09-21 02:44:10.000000000 +0300
++++ ClassiCube-1.3.7/src/Window_SDL2.c 2024-09-21 12:51:04.849585840 +0300
+@@ -7,6 +7,7 @@
#include "Funcs.h"
#include "Bitmap.h"
#include "Errors.h"
+#include "Utils.h"
#include <SDL2/SDL.h>
- static SDL_Window* win_handle;
-@@ -276,15 +277,95 @@
+ static SDL_Window* win_handle;
+@@ -347,6 +348,36 @@
+ SDL_ShowSimpleMessageBox(0, title, msg, win_handle);
}
- static void ShowDialogCore(const char* title, const char* msg) {
-- SDL_ShowSimpleMessageBox(0, title, msg, win_handle);
-+ int frog = SDL_ShowSimpleMessageBox(0, title, msg, win_handle);
-+ if (frog < 0)
-+ printf("Failed to show dialog: %s\n", SDL_GetError());
-+}
-+
+#ifdef CC_BUILD_LINUX
+static cc_result OpenSaveFileDialog(const char* args, FileDialogCallback callback, const char* defaultExt) {
+ cc_string path; char pathBuffer[1024];
@@ -46,11 +39,17 @@ diff -ur ClassiCube-1.3.6.orig/src/Window_SDL.c ClassiCube-1.3.6/src/Window_SDL.
+ }
+ callback(&path);
+ return 0;
- }
++}
+#endif
-
++
cc_result Window_OpenFileDialog(const struct OpenFileDialogArgs* args) {
-+#ifdef CC_BUILD_LINUX
+ #if defined CC_BUILD_OS2
+ FILEDLG fileDialog;
+@@ -367,6 +398,29 @@
+ }
+
+ return 0;
++#elif defined CC_BUILD_LINUX
+ const char* const* filters = args->filters;
+ cc_string path; char pathBuffer[1024];
+ int i;
@@ -73,13 +72,14 @@ diff -ur ClassiCube-1.3.6.orig/src/Window_SDL.c ClassiCube-1.3.6/src/Window_SDL.
+
+ path.buffer[path.length] = '\0';
+ return OpenSaveFileDialog(path.buffer, args->Callback, NULL);
-+#else
+ #else
return ERR_NOT_SUPPORTED;
-+#endif
- }
-
- cc_result Window_SaveFileDialog(const struct SaveFileDialogArgs* args) {
-+#ifdef CC_BUILD_LINUX
+ #endif
+@@ -392,6 +446,27 @@
+ }
+
+ return 0;
++#elif defined CC_BUILD_LINUX
+ const char* const* titles = args->titles;
+ const char* const* fileExts = args->filters;
+ cc_string path; char pathBuffer[1024];
@@ -100,9 +100,6 @@ diff -ur ClassiCube-1.3.6.orig/src/Window_SDL.c ClassiCube-1.3.6/src/Window_SDL.
+
+ path.buffer[path.length] = '\0';
+ return OpenSaveFileDialog(path.buffer, args->Callback, fileExts[0]);
-+#else
+ #else
return ERR_NOT_SUPPORTED;
-+#endif
- }
-
- static SDL_Surface* win_surface;
+ #endif