Building a port from master branch?

Is it possible to build a port from the master branch of a project? Furthermore would it be something easily setup if using pourdiere?

The project I want to build from trunk exists in ports but it's using a tag from several years ago (because the project is mostly a development project and tags are only created several years apart).

I understand the repercussions of building from a master branch, but would this require creating a new port on my system, and if so, is this easily done?
 
Is it possible to build a port from the master branch of a project? Furthermore would it be something easily setup if using pourdiere?
Of course this is possible. Ports for development version, i.e. building from the master branch of a project, often have a -devel packagenamesuffix. One example is x11-wm/bspwm-devel. I myself try to get one development version into the ports tree (PR 277174).

The project I want to build from trunk exists in ports but it's using a tag from several years ago (because the project is mostly a development project and tags are only created several years apart).
May I ask which project it is?

I understand the repercussions of building from a master branch, but would this require creating a new port on my system, and if so, is this easily done?
You do not necessarily need to write and use a new port. You can also try to build it without the ports framework, i.e. doing the ./configure, make, make install dance on your own. That's often necessary to do when porting new software because you need to know how it builds before you can write a port for it.

The difficulty in writing a new port is depending on the software in question. It could be a total of 5 lines of generic boilerplate code, or 100 lines filled with raw make-instructions. Porter's Handbook is the source of truth.
 
May I ask which project it is?
The port I'm referring to is multimedia/tvheadend. The last tag was created in 2019, typically they don't have many breaking changes to their code and most of the newer features are implemented into trunk.

Of course this is possible. Ports for development version, i.e. building from the master branch of a project, often have a -devel packagenamesuffix. One example is x11-wm/bspwm-devel. I myself try to get one development version into the ports tree (PR 277174).
Thanks for that, I come from the Linux ecosystem and typically -devel packages are designed around development header installation. So this is good to know.
 
For a quick and dirty test I would take the original Makefile and adjust it to use the latest commit from the master branch and try to build it with ports-mgmt/poudriere. Replace the topmost paragraph with
Makefile:
PORTNAME=    tvheadend
DISTVERSION=    4.2.8.20240224
CATEGORIES=    multimedia
and add GH_TAGNAME=ae51d24 beneath the USE_GITHUB=yes line.
 
From the host site:
The latest 'stable' release (v4.2.8) was released in January 2019 and is now showing its age. As there are no plans for another v4.2 maintenance release and there is no direct upgrade path from v4.2 to v4.3/v4.4 we recommend all new installs use the current v4.3 'development' releases. These have been in a reliable state for several years and will soon become the new v4.4 stable release (eta in Q1/2024).
 
For a quick and dirty test I would take the original Makefile and adjust it to use the latest commit from the master branch and try to build it with ports-mgmt/poudriere. Replace the topmost paragraph with
Makefile:
PORTNAME=    tvheadend
DISTVERSION=    4.2.8.20240224
CATEGORIES=    multimedia
and add GH_TAGNAME=ae51d24 beneath the USE_GITHUB=yes line.


Ok thanks I will try that.

I have a build going right now, not sure if it will work yet. I modified the make file in the default ports tree I made with poudriere. Wouldn't poudriere revert my change if the default ports tree was updated? Or will it only remove it if I recreated the default tree I have? Sorry if these are stupid questions, I've only really been working with the ports tree for a few weeks.

Also, is there a way I could automatically fill the latest commit in using the make file? Or is the commit configuration a manual change?

Thanks
 
Wouldn't poudriere revert my change if the default ports tree was updated?
It was only for the quick and dirty test in order to see if the development version builds and works as expected. Now that you have established that the development version indeed builds and runs fine, you can prepare a new port for the development version in your local ports tree. Your changes wouldn't interfere with the original port then.

Also, is there a way I could automatically fill the latest commit in using the make file? Or is the commit configuration a manual change?
As far as I know you have to update the commit in the Makefile manually. Microsoft has the "patch tuesday", maybe you introduce the "update friday" ;)
 
Is it possible to build a port from the master branch of a project?
No.

Any branch is a "moving target", so this directly clashes with the port infrastructure's hashing and verifying of distfiles. There's even some heuristic in the USE_GITHUB implementation to catch and forbid the special case of setting GH_TAGNAME to master.

But what you can (and should) do is just using a *specific* commit, which might just be the (currently) latest on master. If the project is hosted on github or gitlab, ports integrate easily with that, e.g. for github, just set GH_TAGNAME to the (possibly shortened) commit hash.
 
Back
Top