View previous topic :: View next topic |
Author |
Message |
tld Veteran
Joined: 09 Dec 2003 Posts: 1836
|
Posted: Sat Aug 19, 2017 4:52 pm Post subject: Applying patches to x11-terms/st [SOLVED] |
|
|
I'm having only marginal success trying to apply patches supplied by upstream to x11-terms/st. Specifically I'm trying to add both keyboard and mouse scrolling from these:
http://st.suckless.org/patches/scrollback/
Note that the do in fact have a version 0.7 patch for the keyboard scrolling. I tried adding that to my /etc/portage/patches and it compiled but failed:
Code: | >>> Preparing source in /disk2/var/tmp/portage/x11-terms/st-0.7/work/st-0.7 ...
* Applying patches from /etc/portage/patches/x11-terms/st-0.7 ...
* st-scrollback-0.7.diff ... [ ok ]
* User patches applied.
* Checking existence of //etc/portage/savedconfig//x11-terms/st-0.7 ...
* found //etc/portage/savedconfig//x11-terms/st-0.7
* Building using saved configfile //etc/portage/savedconfig//x11-terms/st-0.7
>>> Source prepared.
>>> Configuring source in /disk2/var/tmp/portage/x11-terms/st-0.7/work/st-0.7 ...
>>> Source configured.
>>> Compiling source in /disk2/var/tmp/portage/x11-terms/st-0.7/work/st-0.7 ...
make -j2
st build options:
CC st.c
i686-pc-linux-gnu-gcc -c -march=pentium4 -O2 -pipe -fomit-frame-pointer -fno-stack-protector -g -std=c99 -pedantic -Wall -Wvariadic-macros -I. -I/usr/include -I/usr/include/X11 `pkg-config --cflags fontconfig` `pkg-config --cflags freetype2` -DVERSION=\"0.7\" -D_XOPEN_SOURCE=600 st.c
CFLAGS = -march=pentium4 -O2 -pipe -fomit-frame-pointer -fno-stack-protector -g -std=c99 -pedantic -Wall -Wvariadic-macros -I. -I/usr/include -I/usr/include/X11 -I/usr/include/freetype2 -I/usr/include/freetype2 -DVERSION="0.7" -D_XOPEN_SOURCE=600
LDFLAGS = -Wl,-O1 -Wl,--as-needed -g -L/usr/lib -lc -L/usr/lib/X11 -lm -lrt -lX11 -lutil -lXft -lfontconfig -lfreetype -lfreetype
CC = i686-pc-linux-gnu-gcc
st.c:333:12: error: ‘histsize’ undeclared here (not in a function)
Line hist[histsize]; /* history buffer */
^
st.c: In function ‘selsnap’:
st.c:796:18: warning: variable ‘xt’ set but not used [-Wunused-but-set-variable]
int newx, newy, xt, yt;
^
st.c: At top level:
st.c:1724:1: warning: ‘kscrollup’ defined but not used [-Wunused-function]
kscrollup(const Arg* a) |
Then I unmasked the st-9999 version, and was able to apply the current keyboard patch (st-scrollback-20170329-149c0d3.diff), and that worked fine. However when I tried to add the mouse patch (st-scrollback-mouse-20170427-5a10aca.diff), both applied, but again the compile failed:
Code: | >>> Preparing source in /disk2/var/tmp/portage/x11-terms/st-9999/work/st-9999 ...
* Applying patches from /etc/portage/patches/x11-terms/st-9999 ...
* 01-st-scrollback-20170329-149c0d3.diff ... [ ok ]
* 02-st-scrollback-mouse-20170427-5a10aca.diff ... [ ok ]
* User patches applied.
* Checking existence of //etc/portage/savedconfig//x11-terms/st-9999 ...
* found //etc/portage/savedconfig//x11-terms/st-9999
* Building using saved configfile //etc/portage/savedconfig//x11-terms/st-9999
>>> Source prepared.
>>> Configuring source in /disk2/var/tmp/portage/x11-terms/st-9999/work/st-9999 ...
>>> Source configured.
>>> Compiling source in /disk2/var/tmp/portage/x11-terms/st-9999/work/st-9999 ...
make -j2
i686-pc-linux-gnu-gcc -I/usr/include/X11 `pkg-config --cflags fontconfig` `pkg-config --cflags freetype2` -DVERSION=\"0.7\" -D_XOPEN_SOURCE=600 -march=pentium4 -O2 -pipe -fomit-frame-pointer -fno-stack-protector -c st.c
st build options:
CFLAGS = -I/usr/include/X11 -I/usr/include/freetype2 -I/usr/include/freetype2 -DVERSION="0.7" -D_XOPEN_SOURCE=600 -march=pentium4 -O2 -pipe -fomit-frame-pointer -fno-stack-protector
LDFLAGS = -L/usr/lib/X11 -lm -lrt -lX11 -lutil -lXft -lfontconfig -lfreetype -lfreetype -Wl,-O1 -Wl,--as-needed
CC = i686-pc-linux-gnu-gcc
i686-pc-linux-gnu-gcc -I/usr/include/X11 `pkg-config --cflags fontconfig` `pkg-config --cflags freetype2` -DVERSION=\"0.7\" -D_XOPEN_SOURCE=600 -march=pentium4 -O2 -pipe -fomit-frame-pointer -fno-stack-protector -c x.c
In file included from st.c:37:0:
st.h:10:25: error: invalid application of ‘sizeof’ to incomplete type ‘MouseKey[] {aka struct <anonymous>[]}’
#define LEN(a) (sizeof(a) / sizeof(a)[0])
^
st.c:240:19: note: in expansion of macro ‘LEN’
size_t mkeyslen = LEN(mkeys);
^
make: *** [Makefile:22: st.o] Error 1
make: *** Waiting for unfinished jobs.... |
So getting closer. Anyone had success doing this?
Thanks!
Tom
Last edited by tld on Sun Aug 20, 2017 1:17 pm; edited 1 time in total |
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3683
|
Posted: Sat Aug 19, 2017 7:09 pm Post subject: |
|
|
cd /usr/portage/x11-terms/st
ebuild st-9999.ebuild clean unpack
cd /var/tmp/portage/x11-terms/st-9999/work/st-9999
git log --oneline
Find the lines starting with 149c0d3 and 5a10aca
Modify st-9999.ebuild adding EGIT_COMMIT="5a10ca"
ebuild st-9999.ebuild manifest
Then try again |
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3683
|
Posted: Sat Aug 19, 2017 7:30 pm Post subject: |
|
|
Hm, just tried Code: | ebuild /usr/portage//x11-terms/st/st-9999.ebuild clean install |
Result in https://paste.pound-python.org/show/QSmYMdG38Ji8VcUca2fE/, lines 14 to 19.
There should be no problem to emerge the 9999 version using those two patches. Without adding EGIT_COMMIT.
Edit:
I am having the patches in /etc/portage/patches/x11-terms/ |
|
Back to top |
|
|
tld Veteran
Joined: 09 Dec 2003 Posts: 1836
|
Posted: Sun Aug 20, 2017 1:17 pm Post subject: |
|
|
Ant P had the answer in the thread where this first came up here. Many of the patches change the default config.h and having the savedconfig USE flag on when adding a patch can break things. What I had to do was this:
1. Make a copy of my customized /etc/portage/savedconfig/x11-terms/st-9999.
2. Disable the savedconfig USE flag.
3. Add the second patch under /etc/portage/patches and emerge st (which worked perfectly this time).
4. Enable the savedconfig USE flag and emerge again.
5. Port my config customizations to the new /etc/portage/savedconfig/x11-terms/st-9999 and emerge again.
Thanks for the replies, and thanks Ant P!
Tom |
|
Back to top |
|
|
|