I have various ways to discover new software that I might try to port (unofficially) to FreeBSD. Not long ago I was trying to use the linuxulator to run appimages. One of the things I wanted to work was mudlet, it was among pleny of other games on an appimage index site. I was unable to succeed, it may have run like a number of others but failed for graphics reasons. I believe a more direct use via ported software may work.
First I add a new directory into my recently organized GitRepos/PortsTree directory at games/mudlet-dev since I intend as usual to follow upstream commits rather than releases. I may as well add the SUBDIR += mudlet-dev line to the Makefile in the games directory. I copy the Makefile from luanti-dev into the mudlet-dev directory because it has a lot of features I might use at another time and also reminder comments on section order.
The essential changes for the Makefile are the PORTNAME, GH_ACCOUNT, GH_PROJECT, and GH_TAGNAME. Everything else can be ignored or commented out. The mudlet wiki provides compilation instruction for Linux and even FreeBSD. This detail should make constructing the Makefile a simpler task than usual. How refreshing that developers have obviously tested and tried their software on FreeBSD. An official port would be easy if someone wanted to make one, start from scratch or adjust my Makefile for release version tracking.
Portlint truly needs to comprehend, interpret, and ignore comments in a Makefile. All of the commented-out parts of the former luanti Makefile were handled fine by the build process, but portlint complained about commented-out port options. Mudlet has an unusual dependency which seems to be unique, none of our ports seem to require the modules obtained by luarocks. I had to add a series of commands in special post-extract directive. This worked perfectly for all but one, and then even avoiding lua-yajl the build continues to a point where it fails on the first git submodule.
We can look at the .gitmodules file to see what it contains, below.
[submodule "3rdparty/edbee-lib"] path = 3rdparty/edbee-lib url = https://github.com/Mudlet/edbee-lib.git [submodule "3rdparty/lua_code_formatter"] path = 3rdparty/lcf url = https://github.com/martin-eden/lua_code_formatter.git [submodule "3rdparty/qt-tags-widget"] path = 3rdparty/qt-tags-widget url = https://github.com/julian-go/qt-tags-widget.git [submodule "3rdparty/qtkeychain"] path = 3rdparty/qtkeychain url = https://github.com/frankosterfeld/qtkeychain.git [submodule "3rdparty/sentry-native"] path = 3rdparty/sentry-native url = https://github.com/getsentry/sentry-native.git
What I found in the porter's handbook may seem strange but it works for figuring out submodules. It told me to clone the git repo and then use a git command on it. What I had to do specifically for Mudlet was
root@ichigo:/home/tigersharke/GitRepos # git clone --recurse-submodules --branch=development https://github.com/Mudlet/Mudlet.git Cloning into 'Mudlet'... remote: Enumerating objects: 54063, done. remote: Counting objects: 100% (241/241), done. remote: Compressing objects: 100% (149/149), done. remote: Total 54063 (delta 153), reused 95 (delta 92), pack-reused 53822 (from 3) Receiving objects: 100% (54063/54063), 203.40 MiB | 58.15 MiB/s, done. Resolving deltas: 100% (40986/40986), done. Submodule '3rdparty/edbee-lib' (https://github.com/Mudlet/edbee-lib.git) registered for path '3rdparty/edbee-lib' Submodule '3rdparty/lua_code_formatter' (https://github.com/martin-eden/lua_code_formatter.git) registered for path '3rdparty/lcf' Submodule '3rdparty/qt-tags-widget' (https://github.com/julian-go/qt-tags-widget.git) registered for path '3rdparty/qt-tags-widget' Submodule '3rdparty/qtkeychain' (https://github.com/frankosterfeld/qtkeychain.git) registered for path '3rdparty/qtkeychain' Submodule '3rdparty/sentry-native' (https://github.com/getsentry/sentry-native.git) registered for path '3rdparty/sentry-native' Cloning into '/home/tigersharke/GitRepos/Mudlet/3rdparty/edbee-lib'... remote: Enumerating objects: 4859, done. remote: Counting objects: 100% (301/301), done. remote: Compressing objects: 100% (157/157), done. remote: Total 4859 (delta 184), reused 170 (delta 140), pack-reused 4558 (from 2) Receiving objects: 100% (4859/4859), 3.21 MiB | 3.24 MiB/s, done. Resolving deltas: 100% (3461/3461), done. Cloning into '/home/tigersharke/GitRepos/Mudlet/3rdparty/lcf'... remote: Enumerating objects: 1456, done. remote: Counting objects: 100% (14/14), done. remote: Compressing objects: 100% (10/10), done. remote: Total 1456 (delta 5), reused 11 (delta 3), pack-reused 1442 (from 1) Receiving objects: 100% (1456/1456), 298.26 KiB | 2.21 MiB/s, done. Resolving deltas: 100% (549/549), done. Cloning into '/home/tigersharke/GitRepos/Mudlet/3rdparty/qt-tags-widget'... remote: Enumerating objects: 63, done. remote: Counting objects: 100% (63/63), done. remote: Compressing objects: 100% (32/32), done. remote: Total 63 (delta 22), reused 54 (delta 17), pack-reused 0 (from 0) Receiving objects: 100% (63/63), 90.43 KiB | 2.38 MiB/s, done. Resolving deltas: 100% (22/22), done. Cloning into '/home/tigersharke/GitRepos/Mudlet/3rdparty/qtkeychain'... remote: Enumerating objects: 1660, done. remote: Counting objects: 100% (593/593), done. remote: Compressing objects: 100% (196/196), done. remote: Total 1660 (delta 483), reused 410 (delta 392), pack-reused 1067 (from 2) Receiving objects: 100% (1660/1660), 429.77 KiB | 2.96 MiB/s, done. Resolving deltas: 100% (1031/1031), done. Cloning into '/home/tigersharke/GitRepos/Mudlet/3rdparty/sentry-native'... remote: Enumerating objects: 18913, done. remote: Counting objects: 100% (1104/1104), done. remote: Compressing objects: 100% (347/347), done. remote: Total 18913 (delta 962), reused 767 (delta 757), pack-reused 17809 (from 4) Receiving objects: 100% (18913/18913), 9.50 MiB | 15.03 MiB/s, done. Resolving deltas: 100% (13339/13339), done. Submodule path '3rdparty/edbee-lib': checked out 'a3ae51bbb82158366b3d5c4030a54981db688892' Submodule path '3rdparty/lcf': checked out '4aa25029eae867840e6c06c7b075f4b690dd2ec2' Submodule path '3rdparty/qt-tags-widget': checked out '26f177cbcebe66fdc3e8daed4d0984a7f60f3431' Submodule path '3rdparty/qtkeychain': checked out 'e3b2e83f01cccadf9257c3143ae6a066b7d02149' Submodule path '3rdparty/sentry-native': checked out 'c0e5f0705da3853ff548c7ece77d639a20e1d8f5' Submodule 'external/benchmark' (https://github.com/google/benchmark.git) registered for path '3rdparty/sentry-native/external/benchmark' Submodule 'external/breakpad' (https://github.com/getsentry/breakpad.git) registered for path '3rdparty/sentry-native/external/breakpad' Submodule 'external/crashpad' (https://github.com/getsentry/crashpad.git) registered for path '3rdparty/sentry-native/external/crashpad' Submodule 'external/libunwindstack-ndk' (https://github.com/getsentry/libunwindstack-ndk) registered for path '3rdparty/sentry-native/external/libunwindstack-ndk' Submodule 'external/third_party/lss' (https://github.com/getsentry/chromium-linux-syscall-support) registered for path '3rdparty/sentry-native/external/third_party/lss' Cloning into '/home/tigersharke/GitRepos/Mudlet/3rdparty/sentry-native/external/benchmark'... remote: Enumerating objects: 10601, done. remote: Counting objects: 100% (77/77), done. remote: Compressing objects: 100% (45/45), done. remote: Total 10601 (delta 62), reused 32 (delta 32), pack-reused 10524 (from 4) Receiving objects: 100% (10601/10601), 3.39 MiB | 8.99 MiB/s, done. Resolving deltas: 100% (7229/7229), done. Cloning into '/home/tigersharke/GitRepos/Mudlet/3rdparty/sentry-native/external/breakpad'... remote: Enumerating objects: 23942, done. remote: Counting objects: 100% (1702/1702), done. remote: Compressing objects: 100% (786/786), done. remote: Total 23942 (delta 1158), reused 917 (delta 916), pack-reused 22240 (from 4) Receiving objects: 100% (23942/23942), 44.66 MiB | 24.51 MiB/s, done. Resolving deltas: 100% (18247/18247), done. Cloning into '/home/tigersharke/GitRepos/Mudlet/3rdparty/sentry-native/external/crashpad'... remote: Enumerating objects: 27408, done. remote: Counting objects: 100% (16942/16942), done. remote: Compressing objects: 100% (2051/2051), done. remote: Total 27408 (delta 15729), reused 14899 (delta 14890), pack-reused 10466 (from 3) Receiving objects: 100% (27408/27408), 10.16 MiB | 17.99 MiB/s, done. Resolving deltas: 100% (21336/21336), done. Cloning into '/home/tigersharke/GitRepos/Mudlet/3rdparty/sentry-native/external/libunwindstack-ndk'... remote: Enumerating objects: 1714, done. remote: Counting objects: 100% (518/518), done. remote: Compressing objects: 100% (187/187), done. remote: Total 1714 (delta 385), reused 364 (delta 318), pack-reused 1196 (from 1) Receiving objects: 100% (1714/1714), 829.10 KiB | 4.15 MiB/s, done. Resolving deltas: 100% (1190/1190), done. Cloning into '/home/tigersharke/GitRepos/Mudlet/3rdparty/sentry-native/external/third_party/lss'... remote: Enumerating objects: 311, done. remote: Counting objects: 100% (311/311), done. remote: Compressing objects: 100% (150/150), done. remote: Total 311 (delta 159), reused 311 (delta 159), pack-reused 0 (from 0) Receiving objects: 100% (311/311), 549.84 KiB | 3.05 MiB/s, done. Resolving deltas: 100% (159/159), done. Submodule path '3rdparty/sentry-native/external/benchmark': checked out '48f5cc21bac647a8a64e9787cb84f349e334b7ac' Submodule path '3rdparty/sentry-native/external/breakpad': checked out '25b6b727af49fa383161e7dba4a82ab0661b69b8' Submodule path '3rdparty/sentry-native/external/crashpad': checked out '17b7aca1634f1a91018f1bba13f7941a2892e864' Submodule 'third_party/lss/lss' (https://github.com/getsentry/chromium-linux-syscall-support) registered for path '3rdparty/sentry-native/external/crashpad/third_party/lss/lss' Submodule 'third_party/mini_chromium/mini_chromium' (https://github.com/getsentry/mini_chromium.git) registered for path '3rdparty/sentry-native/external/crashpad/third_party/mini_chromium/mini_chromium' Submodule 'third_party/zlib/zlib' (https://github.com/getsentry/chromium-zlib) registered for path '3rdparty/sentry-native/external/crashpad/third_party/zlib/zlib' Cloning into '/home/tigersharke/GitRepos/Mudlet/3rdparty/sentry-native/external/crashpad/third_party/lss/lss'... remote: Enumerating objects: 311, done. remote: Counting objects: 100% (311/311), done. remote: Compressing objects: 100% (150/150), done. remote: Total 311 (delta 159), reused 311 (delta 159), pack-reused 0 (from 0) Receiving objects: 100% (311/311), 549.84 KiB | 3.23 MiB/s, done. Resolving deltas: 100% (159/159), done. Cloning into '/home/tigersharke/GitRepos/Mudlet/3rdparty/sentry-native/external/crashpad/third_party/mini_chromium/mini_chromium'... remote: Enumerating objects: 2810, done. remote: Counting objects: 100% (995/995), done. remote: Compressing objects: 100% (206/206), done. remote: Total 2810 (delta 868), reused 790 (delta 789), pack-reused 1815 (from 2) Receiving objects: 100% (2810/2810), 867.24 KiB | 2.83 MiB/s, done. Resolving deltas: 100% (1900/1900), done. Cloning into '/home/tigersharke/GitRepos/Mudlet/3rdparty/sentry-native/external/crashpad/third_party/zlib/zlib'... remote: Enumerating objects: 2999, done. remote: Counting objects: 100% (2999/2999), done. remote: Compressing objects: 100% (1070/1070), done. remote: Total 2999 (delta 1885), reused 2999 (delta 1885), pack-reused 0 (from 0) Receiving objects: 100% (2999/2999), 1.68 MiB | 6.48 MiB/s, done. Resolving deltas: 100% (1885/1885), done. Submodule path '3rdparty/sentry-native/external/crashpad/third_party/lss/lss': checked out '9719c1e1e676814c456b55f5f070eabad6709d31' Submodule path '3rdparty/sentry-native/external/crashpad/third_party/mini_chromium/mini_chromium': checked out '64339ac9468a8c3af236ca9186b42a33354455b9' Submodule path '3rdparty/sentry-native/external/crashpad/third_party/zlib/zlib': checked out 'fef58692c1d7bec94c4ed3d030a45a1832a9615d' Submodule path '3rdparty/sentry-native/external/libunwindstack-ndk': checked out '284202fb1e42dbeba6598e26ced2e1ec404eecd1' Submodule path '3rdparty/sentry-native/external/third_party/lss': checked out 'ed31caa60f20a4f6569883b2d752ef7522de51e0' root@ichigo:/home/tigersharke/GitRepos #
The next step is to cd into the Mudlet directory and issue
root@ichigo:/home/tigersharke/GitRepos/Mudlet # git submodule status a3ae51bbb82158366b3d5c4030a54981db688892 3rdparty/edbee-lib (v0.1.0-386-ga3ae51b) 4aa25029eae867840e6c06c7b075f4b690dd2ec2 3rdparty/lcf (5.1-2-4-g4aa2502) 26f177cbcebe66fdc3e8daed4d0984a7f60f3431 3rdparty/qt-tags-widget (heads/main) e3b2e83f01cccadf9257c3143ae6a066b7d02149 3rdparty/qtkeychain (0.15.0-44-ge3b2e83) c0e5f0705da3853ff548c7ece77d639a20e1d8f5 3rdparty/sentry-native (0.4.14-666-gc0e5f070)
When you've gone round and round with attempting to get a port to build with the Makefile you've constructed for it, and it finally succeeds, it becomes difficult to know exactly what you did to cause it. This gets to be especially true when the issue is a dependency that you were sure was accurate any number of previous tries, but this last time it is found and the port builds. Undoubtedly the change was in the Makefile, and after this sudden and unexpected success, I must capture the current state of the Makefile into my git repo for this nascent port. I've made more improvements to the Makefile as it is now shown below. The pkg-plist and other files are created and on my github repo site for Mudlet.
### PORTNAME block ##--------------------------------------------------------------------------------------
PORTNAME= Mudlet
DISTVERSION= g20260509
CATEGORIES= games
MASTER_SITES= GH
PKGNAMESUFFIX= -dev
DIST_SUBDIR= ${PORTNAME}${PKGNAMESUFFIX}
# Maintainer block ##--------------------------------------------------------------------------------------
MAINTAINER= nope@nothere
COMMENT= Cross-platform, open source, super fast MUD client with lua scripting
WWW= https://mudlet.org/
### License block ##---------------------------------------------------------------------------------------
LICENSE= GPLv2+
LICENSE_FILE= ${WRKSRC}/COPYING
# dependencies ##------------------------------------------------------------------------------------------
LIB_DEPENDS= libassimp.so:multimedia/assimp \
libqt6keychain.so:security/qtkeychain@qt6 \
libpugixml.so:textproc/pugixml \
libhunspell-1.7.so:textproc/hunspell \
libpcre2-8.so:devel/pcre2 \
libzip.so:archivers/libzip \
libsysinfo.so:devel/libsysinfo \
libonig.so:devel/oniguruma \
libzstd.so:archivers/zstd \
libcurl.so:ftp/curl \
libboost_thread.so:devel/boost-libs \
liblua-5.1.so:lang/lua51
# libyajl.so:devel/yajl \
BUILD_DEPENDS= lua54-luarocks>0:devel/lua-luarocks
### uses block ##------------------------------------------------------------------------------------------
USES= lua cmake:noninja gmake sqlite qt:6 desktop-file-utils gl
GH_ACCOUNT= Mudlet
GH_TAGNAME= 4e32ebc58d0abc58418f03145ef54b3b7b7093f8
USE_GITHUB= nodefaults
GH_TUPLE= \
Mudlet:edbee-lib:a3ae51bbb82158366b3d5c4030a54981db688892:fakedir1/3rdparty/edbee-lib \
martin-eden:lua_code_formatter:4aa25029eae867840e6c06c7b075f4b690dd2ec2:fakedir2/3rdparty/lcf \
julian-go:qt-tags-widget:26f177cbcebe66fdc3e8daed4d0984a7f60f3431:fakedir3/3rdparty/qt-tags-widget \
getsentry:sentry-native:c0e5f0705da3853ff548c7ece77d639a20e1d8f5:fakedir5/3rdparty/sentry-native
USE_QT= base 5compat multimedia tools
USE_GL= gl opengl glu
# USES=cmake related variables ##--------------------------------------------------------------------------
#
### Make block ##------------------------------------------------------------------------------------------
#
### conflicts ##-------------------------------------------------------------------------------------------
CONFLICTS= Mudlet mudlet
### wrksrc block ##----------------------------------------------------------------------------------------
#
### packaging list block ##--------------------------------------------------------------------------------
#
### options definitions ##---------------------------------------------------------------------------------
#
### options descriptions ##--------------------------------------------------------------------------------
#
### options helpers ##-------------------------------------------------------------------------------------
#
.include
post-extract:
${LOCALBASE}/bin/luarocks54 install luautf8
${LOCALBASE}/bin/luarocks54 install luafilesystem
${LOCALBASE}/bin/luarocks54 install lua-zip
${LOCALBASE}/bin/luarocks54 install luasql-sqlite3
${LOCALBASE}/bin/luarocks54 install lrexlib-pcre2
${LOCALBASE}/bin/luarocks54 install lpeg
${LOCALBASE}/bin/luarocks54 install lua-yajl
#----------------------------------------------------------------------
.include
What took me the longest to perfect were the tuples and getting them to be placed in the correct locations. What baffles me the most about this, is how it was successful, since I used a series of numbered 'fakedir' directories which are entirely ignored. Should those "fakedir" entries actually be some kind of other place-holder word? What I did works for now, when it breaks I will update it to the proper method. The handbook is less than clear about handling a git submodule arrangement like this. A REAL example would be much more helpful than foo and bar and all that confusing stuff because I could go to the real port to see the whole process, step through the directories created and truly understand it. One other thing that doesn't seem to be mentioned in the handbook anywhere that I could locate, is how to have a dependency upon a specific flavored port. I had to depend upon one of the two possible flavors for a dependency
I've lightly tested Mudlet to see what it is like, it works fine but I didn't try to play any MUD games yet. The work I have done to take a known FreeBSD build mentioned on the Mudlet wiki to a Makefile usable in our ports tree but that mine tracks upstream commits instead of release versions. You are very welcome, whomever is interested, to take all my efforts, lightly revise them for release version tracking, possibly correct any of my style or technique mistakes, and maybe create a better method for the luarocks portion. There is an easy way to install Mudlet now, the rest is up to a volunteer with my blessing. My success would never have been possible without the work of erikarn (adrian@freebsd.org).
No comments:
Post a Comment