On Sat, Nov 28, 2020 at 12:27:47PM +0000, björn gohla wrote: > hi all, > > i'm fairly new to openbsd. and i've run into the following problem, > where i want to hack a project (most recently trying to fix a possible > issue with i3status), but building the from the git source > tree fails. > > now, in the specific case, i'm trying to build a version that, > also exists in ports, so we know it can be built on openbsd; and i > presume the various patches included with the port are what makes it > work. > > i could of course try to apply those patches and fix my issue. but then > when i submit a PR upstream i'd have to remove them again. that seems > cumbersome, expecially if done repeatedly. > > so what is the best practice in this situation? should i just upstream > the ports patches?
You could edit the source files which are extracted to /usr/ports/pobj/ when the port is built. If you modify a file the port has not patched yet, create a copy of this file with a .orig filename extension first. 'make update-patches' in the port's directory will diff files against their .orig versions and update patches the port's patches directory. You can then extract your fix and apply it to an upstream development tree. If additional patches are required to get the software to compile, you might as well attempt to upstream those changes, too, while at it.