First time (trying) to create a port I need guidance

Hi guys,

I'd like to create a port for this software:


I read all the manual about ports and I was convinced it was about Poudriere, but it is not.

I installed Poudriere and see about the configuration file and it has been a bit overwhelming.
Unfortunately I am quite slow at grasping this stuff, I would feel more comfortable using some boiling plate with just the essential pieces required.

Regarding the software I was able to compile it until 5.2 stable, then the developer introduced Rust and it started to become complicated.
This software is available as stable and development, I think I will start from the development version which now is 5.3 series, it becomes stable when Patrick will start to work on 5.4.

I guess the first step is to create a Poudriere environment where to learn how to compile it.

Thanks in advance!
 
I read all the manual about ports and I was convinced it was about Poudriere, but it is not.
Poudriere is "just" an automated wrapper around the ports system to build packages. Focus on the port itself, poudriere-testport(8) is useful when you're finalizing things. It does a whole bunch of automated checks to see if the port (and the resulting package) is good (dependency chain, pkg-plist, even the formatting of the Makefile).
 
Thank you guys, perhaps I should start doing some compiling test on a jail or vm to know exactly what dependencies are required, so far I might have some of them already installed... 🤔
 
then the developer introduced Rust and it started to become complicated.
Had a quick look but it's already complicated. It uses rake (Rakefile) to build an 'sphelper' (written in Go). That 'sphelper' builds various components, some written in Lua, some C, and some more Go. That's going to be royal PITA to convert to a decent port.
 
I know how to compile the old version that doesn't use Rust but only go.

The new version requires extra piece from GO and now even from Rust (cargo); this really annoying me quite a lot, because I don't like when an app require extra pieces outside from the regular repository.

I will start to document every step as soon as possible, I think I'll spin up a vm for this task...
 
OUTPUT:

Code:
rake build
go install -ldflags "-X main.basedir=/home/sp/publisher -s"  speedatapublisher/sphelper/sphelper
go: downloading github.com/speedata/optionparser v1.1.1
go: downloading github.com/alecthomas/chroma v0.10.0
go: downloading github.com/speedata/go-epub v0.5.5
go: downloading github.com/russross/blackfriday v1.6.0
go: downloading github.com/dlclark/regexp2 v1.11.0
go: downloading github.com/gofrs/uuid v4.4.0+incompatible
/home/sp/publisher/bin/sphelper build
build std

Code:
rake buildlib
go install -ldflags "-X main.basedir=/home/sp/publisher -s"  speedatapublisher/sphelper/sphelper
/home/sp/publisher/bin/sphelper buildlib
amd64
Building dynamic library for freebsd amd64
go: downloading github.com/yuin/goldmark v1.7.1
go: downloading github.com/alecthomas/chroma/v2 v2.13.0
go: downloading github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
go: downloading github.com/PuerkitoBio/goquery v1.9.1
go: downloading github.com/andybalholm/cascadia v1.3.2
go: downloading github.com/speedata/css/scanner v0.0.0-20250825095519-68d469dc62c4
go: downloading golang.org/x/net v0.35.0
# speedatapublisher/splib
./splib.go:4:10: fatal error: 'lauxlib.h' file not found
    4 | #include <lauxlib.h>
      |          ^~~~~~~~~~~
1 error generated.

exit status 1
rake aborted!
Command failed with status (255): [/home/sp/publisher/bin/sphelper buildlib]
/home/sp/publisher/Rakefile:42:in `block in <top (required)>'
Tasks: TOP => buildlib
(See full trace by running task with --trace)

This is an error that I do frequently and that I always forgot to document, and now I have to find where I wrote the fix:

Code:
# speedatapublisher/splib
./splib.go:4:10: fatal error: 'lauxlib.h' file not found
    4 | #include <lauxlib.h>
      |          ^~~~~~~~~~~
1 error generated.

Forgot to install lua53, dependencies updated.
 
OUTPUT 2:

Code:
$ rake build -v
go install -ldflags "-X main.basedir=/home/sp/publisher -s"  speedatapublisher/sphelper/sphelper
/home/sp/publisher/bin/sphelper build
build std

Note: that go libraries were already downloaded.

Code:
$ export CGO_CFLAGS="-I /usr/local/include/lua53"
$ rake buildlib -v
go install -ldflags "-X main.basedir=/home/sp/publisher -s"  speedatapublisher/sphelper/sphelper
/home/sp/publisher/bin/sphelper buildlib
amd64
Building dynamic library for freebsd amd64
Building dynamic lua glue library for freebsd amd64

Note: that go libraries were already downloaded.

It should work!
 
TEST:
Code:
ls -l bin
total 24232
-rwxr-xr-x  1 sp sp        4452 Jan 12 14:40 luatest
-rwxr-xr-x  1 sp wheel  9658670 Jan 12 15:12 sp
-rwxr-xr-x  1 sp wheel 15049006 Jan 12 15:14 sphelper

Code:
bin/./sp --version
Version: 5.3.12

The following test doesn't really make sense, but since produces a PDF it means the software is working properly:

Code:
bin/./sp --dummy
Run speedata publisher 5.3.12
Finished with 2 errors and 269 warnings
Output written on publisher.pdf (1 pages, 986 bytes)
Transcript written to publisher-protocol.xml
exit status 1
Total run time: 147ms
 
To compile Speedata Publisher are required these external GO dependencies:
Code:
github.com/speedata/optionparser v1.1.1
github.com/alecthomas/chroma v0.10.0
github.com/speedata/go-epub v0.5.5
github.com/russross/blackfriday v1.6.0
github.com/dlclark/regexp2 v1.11.0<
github.com/gofrs/uuid v4.4.0+incompatible
github.com/yuin/goldmark v1.7.1
github.com/alecthomas/chroma/v2 v2.13.0
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
github.com/PuerkitoBio/goquery v1.9.1
github.com/andybalholm/cascadia v1.3.2
github.com/speedata/css/scanner v0.0.0-20250825095519-68d469dc62c4
golang.org/x/net v0.35.0
 
To compile and to run Speedata Publisher it is required this binary too:

Code:
whereis luahbtex
luahbtex: /usr/local/bin/luahbtex

Actually the git repo provide it as sdluatex that is why I wrote this step:
ln -s /usr/local/bin/luahbtex /usr/local/bin/sdluatex

Here there are two things:
1. This package is provided by tex-luatex but it is a huge massive virtual-package that requires 1GB once installed, while it is needed only that file:​

Code:
pkg info -lx tex-luatex | wc -l
2064 (files)

2. I could either use a patch to stick with what the code is expected to find, I mean download and rename luahbtex to sdluatex or create a symbolic link as I already did. Perhaps cases such this are addressed in the manual, I haven't checked about that, actually.​
 
And with this last detail, I guess, I listed all the files that are needed to compile it locally.
How do they become a port I guess is something else… 🤔
 
When you create a port, which branch's port do you must use? Head or Quarterly?

Thanks… 🙏
To create / maintain ports, quarterly is NOT an option.
Everything needed to be committed to main branch (aka head or latest).

And only limited commits (basically security / build / runtime fixes but NOT improving functionalities) are allowed to be merged into quarterly.

"Merge-quartely" flag in Bugzilla is just for this purpose to obtain explicit approval. Or on Phabricator, include group reviewer portmgr (if needed, additionally secteam) to reviewer and only merge into quarterly by any committer after anyone in the group reviewer accepted the revision.
 
  • Thanks
Reactions: mrd
Hi guys,

The port guide (quick ports) is giving for granted that I've understood in which directory I should work to create the pkg-descr and pkg-plist.

So far I created the directory /usr/ports/distfiles and downloaded the latest tarball in there. This is what I understood from this passage:
First, get the original tarball and put it into DISTDIR, which defaults to /usr/ports/distfiles.

I download the tagged tarball although they use a generic name, and I wonder if I should ask mr. frischefarbe to use a more detailed name, e.g.: from v5.3.13 to speedata_v5.3.13. You tell me.

So far I've been doing some tests on the git version in my home directory, I am not sure if I have to work on the tarball or the git version, locally or into the ports tree: In which directory should I work and with which version?

I am very sorry for this confusion, I am trying to wrap my head around it... 😵‍💫
 
Back
Top