• Talisman - alpine?

    From deon@21:2/116 to Apam on Fri Mar 29 21:51:09 2024
    Howdy,

    Cant remember if this has come up before (and I havent tried yet) - but was wondering would talisman compile using alpine linux?

    The reason I ask, as I put all my apps in docker containers, and alpine images are 50-70% smaller than debian ones...


    ...лоеп
    --- SBBSecho 3.20-Linux
    * Origin: I'm playing with ANSI+videotex - wanna play too? (21:2/116)
  • From apam@21:1/182 to deon on Sat Mar 30 10:27:06 2024
    Cant remember if this has come up before (and I havent tried yet) -
    but was wondering would talisman compile using alpine linux?

    Possibly. If not out of the box it shouldn't be too hard to make it work.

    I think musl doesn't have iconv built in? so you might need libiconv
    which might mean there would need to be some tweaks in guards on usage of iconv.

    Otherwise, it should just run fine.

    Andrew


    --- Talisman v0.53-dev (FreeBSD/amd64)
    * Origin: Smuggler's Cove - scove.talismanbbs.com:2323 (21:1/182)
  • From deon@21:2/116 to apam on Sun Apr 14 22:24:59 2024
    Re: Talisman - alpine?
    By: apam to deon on Sat Mar 30 2024 10:27 am

    Howdy,

    Possibly. If not out of the box it shouldn't be too hard to make it work.

    I think musl doesn't have iconv built in? so you might need libiconv
    which might mean there would need to be some tweaks in guards on usage of iconv.

    So I've started trying to get talisman to build on alpine, and came across a couple of issues - and I've hit a roadblock.

    1) alpine cant find LUA_LIBRARIES, but a quick google search shows that I need to call cmake with a -D

    cmake -DLUA_LIBRARY=/usr/lib/lua5.4/liblua.so ../../Talisman

    2) calling make, I hit errors about needing to "#include <ctime>"

    /source/Talisman/FileArea.h:3:1: note: 'time_t' is defined in header '<ctime>'; did you forget to '#include <ctime>'?
    /source/Talisman/CallLog.h:5:1: note: 'time_t' is defined in header '<ctime>'; did you forget to '#include <ctime>'?

    3) After adding the include <ctime>, I hit this

    [ 3%] Building CXX object CMakeFiles/talisman.dir/Config.cpp.o /source/Talisman/Config.cpp: In static member function 'static std::string Config::convert_cp437(std::string)':
    /source/Talisman/Config.cpp:70:20: error: invalid conversion from 'const char**' to 'char**' [-fpermissive]
    70 | while (iconv(ic, (const char **)&inp, &isz, &oup, &osz) == -1) {
    | ^~~~~~~~~~~~~~~~~~~
    | |
    | const char**
    In file included from /source/Talisman/Config.cpp:9: /usr/include/iconv.h:17:23: note: initializing argument 2 of 'size_t iconv(iconv_t, char**, size_t*, char**, size_t*)'
    17 | size_t iconv(iconv_t, char **__restrict, size_t *__restrict, char **__restrict, size_t *__restrict);
    | ^~~~~~~~~~~~~~~~~
    /source/Talisman/Config.cpp: In static member function 'static int Config::convert_utf8(const char*, int, char**)':
    /source/Talisman/Config.cpp:137:20: error: invalid conversion from 'const char**' to 'char**' [-fpermissive]
    137 | while (iconv(ic, (const char **)&inp, &isz, &oup, &osz) == -1) {
    | ^~~~~~~~~~~~~~~~~~~
    | |
    | const char**
    /usr/include/iconv.h:17:23: note: initializing argument 2 of 'size_t iconv(iconv_t, char**, size_t*, char**, size_t*)'
    17 | size_t iconv(iconv_t, char **__restrict, size_t *__restrict, char **__restrict, size_t *__restrict);
    | ^~~~~~~~~~~~~~~~~
    /source/Talisman/Config.cpp: In static member function 'static std::string Config::convert_utf8(std::string)':
    /source/Talisman/Config.cpp:205:20: error: invalid conversion from 'const char**' to 'char**' [-fpermissive]
    205 | while (iconv(ic, (const char **)&inp, &isz, &oup, &osz) == -1) {
    | ^~~~~~~~~~~~~~~~~~~
    | |
    | const char**
    /usr/include/iconv.h:17:23: note: initializing argument 2 of 'size_t iconv(iconv_t, char**, size_t*, char**, size_t*)'
    17 | size_t iconv(iconv_t, char **__restrict, size_t *__restrict, char **__restrict, size_t *__restrict);
    | ^~~~~~~~~~~~~~~~~
    make[2]: *** [CMakeFiles/talisman.dir/build.make:104: CMakeFiles/talisman.dir/Config.cpp.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/talisman.dir/all] Error 2

    Is it fixable? (it doesntlike the (const char**)


    ...лоеп
    --- SBBSecho 3.20-Linux
    * Origin: I'm playing with ANSI+videotex - wanna play too? (21:2/116)
  • From apam@21:1/182.1 to deon on Mon Apr 15 07:18:30 2024
    By: deon to apam on Sun Apr 14 2024 10:24 pm

    Is it fixable? (it doesntlike the (const char**)

    Yeah, that's the iconv thing i mentioned, i've got two versions in the source, you'll want to add a whatever the MUSL define is to the list on the ones above the const char ** things.

    With the amount of systems that don't like the const char ** i'm thinking i should have made the other way default :)

    Andrew
    --- SBBSecho 3.20-Linux
    * Origin: HappyLand - happylnd.synchro.net (21:1/182.1)
  • From deon@21:2/116 to apam on Thu Apr 18 09:06:43 2024
    Re: Talisman - alpine?
    By: apam to deon on Mon Apr 15 2024 07:18 am

    Howdy,

    Is it fixable? (it doesntlike the (const char**)

    Yeah, that's the iconv thing i mentioned, i've got two versions in the source, you'll want to add a whatever the MUSL define is to the list on the ones above the const char ** things.

    With the amount of systems that don't like the const char ** i'm thinking i should have made the other way default :)

    So it compiles and seems to be working OK. I'm building a docker container of talisman, so if anybody wants to use it let me know and I'll make it available.

    I did hit a few hurdles with the configuration, but that might have been my inexperience with talisman and/or finger trouble, which I'll test out and let you know if I hit the same problem. (I'm using full paths, but it seemed to ignore them?)

    Do you want a patch for alpine? Its pretty easy, basically you need a
    #include <ctime> for the files where you are using time_t, and to get past that iconv const issue, was to define __GLIBC__ in Talisman/Config.cpp.

    It probably would make sense to have all that wrapped around ifdefs and maybe a define for alpine - and for it to be automatically detected, but that is beyond my knowledge. ;)


    ...лоеп
    --- SBBSecho 3.20-Linux
    * Origin: I'm playing with ANSI+videotex - wanna play too? (21:2/116)