-
Notifications
You must be signed in to change notification settings - Fork 136
Newpkg: megaglest #1886
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
base: master
Are you sure you want to change the base?
Newpkg: megaglest #1886
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| TERMUX_PKG_HOMEPAGE=https://megaglest.org/ | ||
| TERMUX_PKG_DESCRIPTION="A free and open source 3D real-time strategy game" | ||
| TERMUX_PKG_LICENSE="GPL-3.0" | ||
| TERMUX_PKG_MAINTAINER="@IntinteDAO" | ||
| TERMUX_PKG_VERSION=3.13.0 | ||
| TERMUX_PKG_SRCURL=https://github.com/MegaGlest/megaglest-source/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz | ||
| TERMUX_PKG_SHA256=e02e58c2329558cc5d67374b5e5f9b3cfaafc300b96feff71df8d4b0d39e1eaa | ||
| TERMUX_PKG_DEPENDS="glib, openal-soft, sdl2, libvorbis, libjpeg-turbo, libpng, freetype, curl, libxml2, wxwidgets, lua52, fribidi, libandroid-glob, libftgl2, glew" | ||
|
|
||
| TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" | ||
| -DCMAKE_POLICY_VERSION_MINIMUM=3.5 | ||
| -DLUA_LIBRARIES=${TERMUX_PREFIX}/lib/liblua5.2.so | ||
| -DLUA_INCLUDE_DIR=${TERMUX_PREFIX}/include/lua5.2 | ||
| -DLUA_MATH_LIBRARY=$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/libm.so | ||
| -DWANT_STATIC_LIBS=OFF | ||
| -DBUILD_SHARED_LIBS=ON | ||
| -DBUILD_MEGAGLEST_MAP_EDITOR=OFF | ||
| -DCMAKE_SYSTEM_NAME=OpenBSD | ||
| -DBUILD_MEGAGLEST_MODEL_VIEWER=OFF | ||
| -DMEGAGLEST_DATA_INSTALL_PATH=share/games/megaglest/ | ||
| -DWANT_DEV_OUTPATH=ON | ||
| " | ||
|
|
||
| termux_step_pre_configure() { | ||
| export LDFLAGS+=" -landroid-glob -Wl,--no-as-needed,-lOpenSLES,--as-needed" | ||
| export CFLAGS+=" -D__OpenBSD__" | ||
| export CXXFLAGS+=" -D__OpenBSD__" | ||
| } | ||
|
|
||
| termux_step_post_make_install() { | ||
| echo "POST INSTALL for Menu entries" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this do? (is it a placeholder for WIP function?)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You can add additional URLs in TERMUX_PKG_SRCURL=(https://github.com/MegaGlest/megaglest-source/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz
https://github.com/MegaGlest/megaglest-data/releases/download/3.13.0/megaglest-standalone-data-${TERMUX_PKG_VERSION}.tar.xz)
TERMUX_PKG_SHA256=(e02e58c2329558cc5d67374b5e5f9b3cfaafc300b96feff71df8d4b0d39e1eaa
996040acfb338cfcbd0612b13db9c1734a7588bcc60c7e9b87e9fd619629dda3)this will make the megaglest-standalone-data be extracted somewhere in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yep. I had a issues with that. I usually create a package with 1 link, not 2s and I don't know how to work on 2 archives at once.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I have given the code block which you can copy and paste in order to start with it, but if you still don't understand it, let me know and later I can try to finish the entire thing and send it |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| diff -ur orig/source/shared_lib/include/feathery_ftp/ftpTypes.h mod/source/shared_lib/include/feathery_ftp/ftpTypes.h | ||
| --- orig/source/shared_lib/include/feathery_ftp/ftpTypes.h 2017-03-08 21:39:12.000000000 +0100 | ||
| +++ mod/source/shared_lib/include/feathery_ftp/ftpTypes.h 2025-07-17 11:03:14.934302633 +0200 | ||
| @@ -69,7 +69,7 @@ | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| -int VERBOSE_MODE_ENABLED; | ||
| +extern int VERBOSE_MODE_ENABLED; | ||
|
|
||
| typedef ip_t (*ftpFindExternalFTPServerIpType)(ip_t clientIp); | ||
| typedef void (*ftpAddUPNPPortForwardType)(int internalPort, int externalPort); | ||
| @@ -77,11 +77,11 @@ | ||
| typedef int (*ftpIsValidClientType)(ip_t clientIp); | ||
| typedef int (*ftpIsClientAllowedToGetFileType)(ip_t clientIp, const char *username, const char *filename); | ||
|
|
||
| -ftpFindExternalFTPServerIpType ftpFindExternalFTPServerIp; | ||
| -ftpAddUPNPPortForwardType ftpAddUPNPPortForward; | ||
| -ftpRemoveUPNPPortForwardType ftpRemoveUPNPPortForward; | ||
| -ftpIsValidClientType ftpIsValidClient; | ||
| -ftpIsClientAllowedToGetFileType ftpIsClientAllowedToGetFile; | ||
| +extern ftpFindExternalFTPServerIpType ftpFindExternalFTPServerIp; | ||
| +extern ftpAddUPNPPortForwardType ftpAddUPNPPortForward; | ||
| +extern ftpRemoveUPNPPortForwardType ftpRemoveUPNPPortForward; | ||
| +extern ftpIsValidClientType ftpIsValidClient; | ||
| +extern ftpIsClientAllowedToGetFileType ftpIsClientAllowedToGetFile; | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| diff -ur orig/source/shared_lib/sources/feathery_ftp/ftpRuntime.c mod/source/shared_lib/sources/feathery_ftp/ftpRuntime.c | ||
| --- orig/source/shared_lib/sources/feathery_ftp/ftpRuntime.c 2017-03-08 21:39:12.000000000 +0100 | ||
| +++ mod/source/shared_lib/sources/feathery_ftp/ftpRuntime.c 2025-07-17 11:04:27.524309864 +0200 | ||
| @@ -30,6 +30,13 @@ | ||
| #include "ftp.h" | ||
| #include "ftpMessages.h" | ||
|
|
||
| +int VERBOSE_MODE_ENABLED = 0; | ||
| +ftpFindExternalFTPServerIpType ftpFindExternalFTPServerIp = NULL; | ||
| +ftpAddUPNPPortForwardType ftpAddUPNPPortForward = NULL; | ||
| +ftpRemoveUPNPPortForwardType ftpRemoveUPNPPortForward = NULL; | ||
| +ftpIsValidClientType ftpIsValidClient = NULL; | ||
| +ftpIsClientAllowedToGetFileType ftpIsClientAllowedToGetFile = NULL; | ||
| + | ||
|
|
||
| /** | ||
| * @brief server-sockets that listens for incoming connections | ||
| diff -ur orig/source/shared_lib/sources/platform/posix/miniftpserver.cpp mod/source/shared_lib/sources/platform/posix/miniftpserver.cpp | ||
| --- orig/source/shared_lib/sources/platform/posix/miniftpserver.cpp 2017-03-08 21:39:12.000000000 +0100 | ||
| +++ mod/source/shared_lib/sources/platform/posix/miniftpserver.cpp 2025-07-17 11:06:54.287657818 +0200 | ||
| @@ -40,7 +40,7 @@ | ||
| static std::map<uint32,uint32> clientToFTPServerList; | ||
| FTPClientValidationInterface * FTPServerThread::ftpValidationIntf = NULL; | ||
|
|
||
| -ip_t FindExternalFTPServerIp(ip_t clientIp) { | ||
| +static ip_t FindExternalFTPServerIp(ip_t clientIp) { | ||
| ip_t result = clientToFTPServerList[clientIp]; | ||
|
|
||
| if(SystemFlags::VERBOSE_MODE_ENABLED) printf("===> FTP Server thread clientIp = %u, result = %u\n",clientIp,result); | ||
| @@ -49,7 +49,7 @@ | ||
| return result; | ||
| } | ||
|
|
||
| -int isValidClientType(ip_t clientIp) { | ||
| +static int isValidClientType(ip_t clientIp) { | ||
| int result = 0; | ||
| if(FTPServerThread::getFtpValidationIntf() != NULL) { | ||
| result = FTPServerThread::getFtpValidationIntf()->isValidClientType(clientIp); | ||
| @@ -57,7 +57,7 @@ | ||
| return result; | ||
| } | ||
|
|
||
| -int isClientAllowedToGetFile(ip_t clientIp, const char *username, const char *filename) { | ||
| +static int isClientAllowedToGetFile(ip_t clientIp, const char *username, const char *filename) { | ||
| int result = 1; | ||
|
|
||
| //printf("In [%s::%s] Line: %d username [%s] file [%s]\n",__FILE__,__FUNCTION__,__LINE__,username,filename); | ||
| @@ -87,9 +87,9 @@ | ||
| this->ftpValidationIntf = ftpValidationIntf; | ||
| this->tempFilesPath = tempFilesPath; | ||
|
|
||
| - ftpInit(&FindExternalFTPServerIp,&UPNP_Tools::AddUPNPPortForward,&UPNP_Tools::RemoveUPNPPortForward, | ||
| + ftpInit(&FindExternalFTPServerIp, &UPNP_Tools::AddUPNPPortForward, &UPNP_Tools::RemoveUPNPPortForward, | ||
| &isValidClientType, &isClientAllowedToGetFile); | ||
| - VERBOSE_MODE_ENABLED = SystemFlags::VERBOSE_MODE_ENABLED; | ||
| + //VERBOSE_MODE_ENABLED = SystemFlags::VERBOSE_MODE_ENABLED; | ||
|
|
||
| if(SystemFlags::VERBOSE_MODE_ENABLED) printf("***FTP SERVER STARTED [%p]\n",this); | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you just write
-DLUA_MATH_LIBRARY=mdoes that work instead and prevent the error in CI? Yes I know that some packages likeneovimdo this, but it just looks like a big mess, maybe it's fine with only-DLUA_MATH_LIBRARY=m. If it really does have to be like this then you can move this totermux_step_pre_configure()(like it is inneovim)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I see when I test, it does need either that or a patch, so put it in
termux_step_pre_configure()likeneovim: