sineemore / suckless-101

Guide on how to patch, compile and install suckless software.
86 stars 3 forks source link

suckless 911? #3

Open Twix53791 opened 2 years ago

Twix53791 commented 2 years ago

Hi, I think we should complete this tuto to help people to install and patch successfully suckless applications in their own environment.

For example, I leave here my experience to help people struggling this these kinds of issues. For reasons I completely ignore, I was unable to apply the official patches keyrelease and hidetabs to tabbed. Yet I got all the files from the official website, without modifying anything, and following first your tuto, then the method gived by suckless. And the patches were not applied properly, some part of the code rejected. After that, I tried this custom shared patch without more success. At the end, I found this repo and... everything work well ! Thanks to hXtreme to shere his hacking. It is, I think, really incredible than the applying of some basic 'official' features is so difficult. Oh, I before I have tried tabbed flexipatch, which was a complete fail...

Twix53791 commented 2 years ago

Probably these differences are coming from the config.mk file...

sineemore commented 2 years ago

You can investigate the exact reason tabbed didn't compile and we can fix the README.md.

Actually, I've never tried tabbed before :)

Twix53791 commented 2 years ago

Well, I am not a specialist and maybe I just don't understand how patches work. I think, if for example I take the hidetabs patch, than I fact it is just because the diff has not been updated to fit the last tabbed version. In fact, the diff parts which are rejected are in fact different than the original parts:

As we can see, there is a difference into the part which is not patched : numlockmask = 0. Maybe becausee of that, the patch don't find the "match"? It is the same after:

@@ -172,6 +173,7 @@ static char winid[64];
 static char **cmd;
 static char *wmname = "tabbed";
 static const char *geometry;
+static Bool barvisibility = False;
static char **cmd = NULL;
static char *wmname = "tabbed";
static const char *geometry = NULL;

In fact, I don't know how the patch find the lines it has to replace. what means exactly @@ -172,6 +173,7 @@ static char winid[64]; ? And does it matches the lines after and before, like a "grep"?

Config.mk

Anyway, about config.mk, here are the differences between the original tabbed one, which in fact works, but not if I patch tabbed. And some I found on git hub, patched, which work.

Original config.mk of tabbed:

# includes and libs
INCS = -I. -I/usr/include
LIBS = -L/usr/lib -lc -lX11

# flags
CPPFLAGS = -DVERSION=\"${VERSION}\" -D_BSD_SOURCE

Better config.mk

X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib

# freetype
FREETYPELIBS = -lfontconfig -lXft
FREETYPEINC = /usr/include/freetype2

# includes and libs
INCS = -I. -I/usr/include -I$(X11INC) -I${FREETYPEINC}
LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${FREETYPELIBS}

CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE

Tips for patches

By the way, I leave here a tip I found : to use st into tabbed patched with the alpha patch for transparency, you also need to patch st with the st alpha patch. And also, I found this quite interesting tabbed fork which comes which build-in functions, in fact just added to config.def.h: https://github.com/huijunchen9260/tabbed-hjc