You are not logged in.

#1 2019-04-11 13:09:35

kibartas
Member
Registered: 2019-01-29
Posts: 29

Trying to patch suckless terminal

Hello. I wanted to patch scrollback into suckless terminal from the AUR. I followed the guide here: https://wiki.archlinux.org/index.php/Patching_packages

I'm not really sure why, but makepkg fails in prepare() function.

patching file st.c
Hunk #2 FAILED in 43.
...
1 out of 21 hunks FAILED -- saving rejects to file st.c.rej
patching file st.h
==> ERROR: A failure occurred in prepare().
       Aborting...

I'm not sure what to do, could anyone please help. I tried looking into the rejects file, but what am I supposed to do with it, anyway.

Also, my PKGBUILD prepare function:

prepare() {
  # user is supposed to maintain config.h him/herself
  cd $srcdir/$pkgname-$pkgver
  patch --strip=1 --input=$srcdir/st-scrollback-20190331-21367a9.diff

Last edited by kibartas (2019-04-11 13:12:13)

Offline

#2 2019-04-11 13:30:56

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: Trying to patch suckless terminal

Which st source are you using?  Where did you get the patch?  Is the patch for the same vesion you are patching?  What's in the rejected file?  Why aren't you just using the st-scrollback-git package already available in the aur?

Why am I asking so many questions?

EDIT: I just glanced at your previous threads - you seem to have a habbit of abandoning threads as soon as anyone tries offering any help.  This is a bit demoralizing to would-be helpers.  Please break that habbit.

Last edited by Trilby (2019-04-11 13:33:06)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2019-04-11 13:32:00

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,720
Website

Re: Trying to patch suckless terminal

Please provide the patch you are trying to apply and the content of st.c.rej.
Edit: Ninja'd.

Last edited by schard (2019-04-11 13:32:19)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#4 2019-04-11 13:52:11

kibartas
Member
Registered: 2019-01-29
Posts: 29

Re: Trying to patch suckless terminal

Trilby wrote:

Which st source are you using?  Where did you get the patch?  Is the patch for the same vesion you are patching?  What's in the rejected file?  Why aren't you just using the st-scrollback-git package already available in the aur?


I got st from https://aur.archlinux.org/packages/st/

The patch I got from the st webpage https://st.suckless.org/patches/scrollback/

The rejected file content:

--- st.c
+++ st.c
@@ -43,6 +44,9 @@
 #define ISCONTROLC1(c)		(BETWEEN(c, 0x80, 0x9f))
 #define ISCONTROL(c)		(ISCONTROLC0(c) || ISCONTROLC1(c))
 #define ISDELIM(u)		(u && wcschr(worddelimiters, u))
+#define TLINE(y)		((y) < term.scr ? term.hist[((y) + term.histi - \
+				term.scr + HISTSIZE + 1) % HISTSIZE] : \
+				term.line[(y) - term.scr])
 
 enum term_mode {
 	MODE_WRAP        = 1 << 0,

About the version: I'm not sure? I mean, the patch just has the date. The four patches which I could apply are

    st-scrollback-0.7.diff
    st-scrollback-0.8.diff
    st-scrollback-0.8.1.diff
    st-scrollback-20190331-21367a0.diff

My st version is 0.8.2 though. Does that mean that this patch doesn't exist for the version of st I'm using?


Not sure about the last one, could you elaborate?

Quick edit: I'm trying to apply the st-scrollback-20190331-21367a0.diff patch.

Last edited by kibartas (2019-04-11 13:53:00)

Offline

#5 2019-04-11 14:32:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,520

Re: Trying to patch suckless terminal

You might be more lucky w/ st-scrollback-0.8.1.diff - st-scrollback-20190331-21367a0.diff should™ apply to the current git master (though I didn't try)

Online

#6 2019-04-11 15:22:33

kibartas
Member
Registered: 2019-01-29
Posts: 29

Re: Trying to patch suckless terminal

seth wrote:

You might be more lucky w/ st-scrollback-0.8.1.diff - st-scrollback-20190331-21367a0.diff should™ apply to the current git master (though I didn't try)

st-scrollback-0.8.1.diff throws the same error

==> ERROR: A failure occured in prepare().
  Aborting...

Offline

#7 2019-04-11 15:29:50

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,520

Re: Trying to patch suckless terminal

With the same patch rejection??

Online

#8 2019-04-11 20:02:05

kibartas
Member
Registered: 2019-01-29
Posts: 29

Re: Trying to patch suckless terminal

seth wrote:

With the same patch rejection??

patching file st.c
Hunk #2 succeeded at 43 with fuzz 2 (offset -1 lines).
Hunk #3 succeeded at 121 (offset -4 lines).
Hunk #4 succeeded at 191 (offset -4 lines).
Hunk #5 succeeded at 434 (offset -4 lines).
Hunk #6 succeeded at 546 (offset -4 lines).
Hunk #7 succeeded at 561 (offset -4 lines).
Hunk #8 succeeded at 589 (offset -4 lines).
Hunk #9 succeeded at 627 (offset -4 lines).
Hunk #10 succeeded at 856 (offset 7 lines).
Hunk #11 succeeded at 1070 (offset 7 lines).
Hunk #12 succeeded at 1130 (offset 7 lines).
Hunk #13 succeeded at 1195 (offset 7 lines).
Hunk #14 succeeded at 1360 (offset 7 lines).
Hunk #15 succeeded at 1797 (offset 8 lines).
Hunk #16 succeeded at 2303 (offset -14 lines).
Hunk #17 succeeded at 2316 (offset -14 lines).
Hunk #18 succeeded at 2535 (offset -14 lines).
Hunk #19 succeeded at 2572 (offset -14 lines).
Hunk #20 succeeded at 2637 (offset -14 lines).
Hunk #21 succeeded at 2658 (offset -14 lines).
patching file st.h
Hunk #1 FAILED at 80.
1 out of 1 hunk FAILED -- saving rejects to file st.h.rej
==> ERROR: A failure occurred in prepare().

I should also note, that another patch (st-clipboard) patched normally. It has the same version as does the terminal, though.

Edit: st.h.rej content

--- st.h
+++ st.h
@@ -80,6 +80,8 @@ void die(const char *, ...);
 void redraw(void);
 void draw(void);
 
+void kscrolldown(const Arg *);
+void kscrollup(const Arg *);
 void iso14755(const Arg *);
 void printscreen(const Arg *);
 void printsel(const Arg *);

Last edited by kibartas (2019-04-11 20:03:29)

Offline

#9 2019-04-11 20:09:09

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: Trying to patch suckless terminal

Either apply the changes yourself manually, or just use the -git source for which the patch was written.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2019-04-11 20:11:25

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,520

Re: Trying to patch suckless terminal

Different reject, seems no available patch version is compatible w/ 0.8.2
You could build the git master of st, though. Or add the two function declarations from the patch by hand (the "iso14755" is gone, thus likely the patch failure. printscreen and printsel are still there, though.)

Edit: Parrot ninja'd

Last edited by seth (2019-04-11 20:12:31)

Online

#11 2019-04-11 20:41:59

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: Trying to patch suckless terminal

I thought about changing my avatar to this, though I cant find any listing of permissions to reuse the image.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#12 2019-04-11 20:55:11

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,520

Re: Trying to patch suckless terminal

Seems lifted from https://yt3.ggpht.com/a-/AAuE7mCNCdlNI3 … ff-rj-k-no - there's a signature on the lower right, but that could mean anything :-(

Online

#13 2019-04-14 22:03:07

kibartas
Member
Registered: 2019-01-29
Posts: 29

Re: Trying to patch suckless terminal

Thanks guys! Solved it by applying the patch manually.

Last edited by kibartas (2019-04-14 22:03:35)

Offline

#14 2019-04-14 22:36:42

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: Trying to patch suckless terminal

Please remember to mark your thread [SOLVED] (edit the title of your first post).

Offline

Board footer

Powered by FluxBB