juliusHuelsmann / st

Repatch repository of developed 'Vim Browse' and 'Alpha Focus Highlight' patches for simple terminal (st).
https://st.suckless.org/patches/alpha_focus_highlight/
MIT License
28 stars 11 forks source link

Alpha Focus Highlight not patching against st-0.9 #34

Closed Jemi closed 1 year ago

Jemi commented 1 year ago

I'm setting up st-0.9 on my new Gentoo machine using Gentoo's user patching facility. The alpha patch is working against this version, as are three scrollback patches. I have the alpha patch set as patch 1 and Alpha Focus Highlight as patch 2. This is the output I'm getting:

tux /home/rogue # emerge -av st

These are the packages that would be merged, in order:

Calculating dependencies... done! Dependency resolution took 0.58 s.

[ebuild R ] x11-terms/st-0.9::gentoo USE="-savedconfig" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No] Yes

Verifying ebuild manifests

Emerging (1 of 1) x11-terms/st-0.9::gentoo

  • st-0.9.tar.gz BLAKE2B SHA512 size ;-) ... [ ok ] Unpacking source... Unpacking st-0.9.tar.gz to /var/tmp/portage/x11-terms/st-0.9/work Source unpacked in /var/tmp/portage/x11-terms/st-0.9/work Preparing source in /var/tmp/portage/x11-terms/st-0.9/work/st-0.9 ...
  • =============================================================================================================================================================================================================================================================================
  • Applying user patches from /etc/portage/patches ...
  • Applying 01-st-alpha-20220206-0.8.5.diff ... [ ok ]
  • Applying 02-st-alphaFocusHighlight-20200216-26cdfeb.diff ... patching file config.def.h Hunk #1 succeeded at 96 with fuzz 2 (offset 14 lines). Hunk #2 FAILED at 113. Hunk #3 FAILED at 121. 2 out of 3 hunks FAILED -- saving rejects to file config.def.h.rej patching file config.mk Hunk #1 FAILED at 16. 1 out of 1 hunk FAILED -- saving rejects to file config.mk.rej patching file st.h Hunk #1 FAILED at 121. 1 out of 1 hunk FAILED -- saving rejects to file st.h.rej patching file x.c Hunk #2 FAILED at 106. Hunk #3 FAILED at 243. Hunk #4 succeeded at 254 with fuzz 2 (offset 3 lines). Hunk #5 FAILED at 721. Hunk #6 succeeded at 794 (offset 35 lines). Hunk #7 FAILED at 795. Hunk #8 FAILED at 1105. Hunk #9 FAILED at 1119. Hunk #10 FAILED at 1139. Hunk #11 succeeded at 1810 (offset 78 lines). Hunk #12 succeeded at 2081 with fuzz 2 (offset 75 lines). 7 out of 12 hunks FAILED -- saving rejects to file x.c.rej [ !! ]
  • ERROR: x11-terms/st-0.9::gentoo failed (prepare phase):
  • patch -p1 failed with /etc/portage/patches/x11-terms/st-0.9/02-st-alphaFocusHighlight-20200216-26cdfeb.diff
  • Call stack:
  • ebuild.sh, line 136: Called src_prepare
  • environment, line 1717: Called default
  • phase-functions.sh, line 872: Called default_src_prepare
  • phase-functions.sh, line 948: Called __eapi8_src_prepare
  • environment, line 324: Called eapply_user
  • environment, line 635: Called eapply '/etc/portage/patches/x11-terms/st-0.9/02-st-alphaFocusHighlight-20200216-26cdfeb.diff'
  • environment, line 598: Called _eapply_patch '/etc/portage/patches/x11-terms/st-0.9/02-st-alphaFocusHighlight-20200216-26cdfeb.diff'
  • environment, line 536: Called __helpers_die 'patch -p1 failed with /etc/portage/patches/x11-terms/st-0.9/02-st-alphaFocusHighlight-20200216-26cdfeb.diff'
  • isolated-functions.sh, line 112: Called die
  • The specific snippet of code:
  • die "$@"
  • If you need support, post the output of emerge --info '=x11-terms/st-0.9::gentoo',
  • the complete build log and the output of emerge -pqv '=x11-terms/st-0.9::gentoo'.
  • The complete build log is located at '/var/tmp/portage/x11-terms/st-0.9/temp/build.log'.
  • The ebuild environment file is located at '/var/tmp/portage/x11-terms/st-0.9/temp/environment'.
  • Working directory: '/var/tmp/portage/x11-terms/st-0.9/work/st-0.9'
  • S: '/var/tmp/portage/x11-terms/st-0.9/work/st-0.9'

Failed to emerge x11-terms/st-0.9, Log file:

'/var/tmp/portage/x11-terms/st-0.9/temp/build.log'

I've tried using different versions of the patch with no luck. The output above is from the patch posted at this issue: https://github.com/juliusHuelsmann/st/issues/24.

I really need this functionality. Can you please update the patch for st-0.9?

juliusHuelsmann commented 1 year ago

hey!

I will update the patch to 0.9 in the future! I have got a pending merge request, that I want to merge prior to that, and haven't done that (it's already open a while). I currently don't have too much time on my hands, and I therefore prefer to spend my time away from my laptop when I'm off work.

I'm sorry that it's going to take me a while. Have you tried patching only the focus patch that has the alpha patch already built in? From the release page, that should be the following file:

st-focus-20200530-43a395a.diff

Hope that helps for now!

Jemi commented 1 year ago

Nope, I get the following:

patching file config.def.h Hunk #1 succeeded at 93 (offset 9 lines). Hunk #2 FAILED at 114. Hunk #3 succeeded at 136 with fuzz 2 (offset 11 lines). 1 out of 3 hunks FAILED -- saving rejects to file config.def.h.rej patching file config.mk patching file st.c Hunk #1 succeeded at 194 with fuzz 2. patching file st.h Hunk #2 FAILED at 123. 1 out of 2 hunks FAILED -- saving rejects to file st.h.rej patching file x.c Hunk #3 FAILED at 254. Hunk #4 succeeded at 754 (offset 18 lines). Hunk #5 succeeded at 792 (offset 18 lines). Hunk #6 succeeded at 1146 (offset 31 lines). Hunk #7 succeeded at 1172 (offset 31 lines). Hunk #8 succeeded at 1192 (offset 31 lines). Hunk #9 succeeded at 1797 (offset 47 lines). Hunk #10 succeeded at 2065 (offset 41 lines). Hunk #11 succeeded at 2119 (offset 41 lines). 1 out of 11 hunks FAILED -- saving rejects to file x.c.rej

I hope you can get to it soonish...

juliusHuelsmann commented 1 year ago

Hi, I got around to creating a new release of my focus patch.

On the branch plainAlpha09, you can see the patch applied to the clean version 0.9 of st.

https://github.com/juliusHuelsmann/st/tree/plainAlpha09

Here you can download the patch: https://github.com/juliusHuelsmann/st/releases/tag/alpha_09

patch -p1 < st-focus-20230610-68d1ad9.diff

should do the trick.

It will be available through the suckless website shortly aswell.

Jemi commented 1 year ago

Does the patch include the alpha patch? When I apply them both I get a strange message about a reversed patch being detected. When I apply just yours the patch applies and compiles, but the resulting binary doesn't have any working transparency. Do I need to do something with config.h to get the transparency?

juliusHuelsmann commented 1 year ago

Yes, it includes the alpha patch.

Does the alpha patch alone work for you?

Detailed example of how to make a clean build with the alpha focus patch:

wget https://dl.suckless.org/st/st-0.9.tar.gz

tar -xf st-0.9.tar.gz
cd st-0.9
wget https://github.com/juliusHuelsmann/st/releases/download/alpha_09/st-focus-20230610-68d1ad9.diff
patch -p1 <  st-focus-20230610-68d1ad9.diff
make -j
./st

which shows transparency for me.

Configuration that you can change in the config.h:

float alpha = 0.93, alphaUnfocused = 0.6;
unsigned int bg = 0, bgUnfocused = 16;

Make sure you delete the config.h prior to re-building.

Jemi commented 1 year ago

Yes, it's transparent. I had mistaken the 93% opacity for 100% opacity, but changing focus showed the transparency. It works now. I hope this will go up on the st site soon. Let me know if you want me to test the separate focus patch.

juliusHuelsmann commented 1 year ago

It will be on the site soonish, I already pushed it to the site:

https://git.suckless.org/sites/commit/aeb86b4481b7daa23c28f1afdbdb46ee934390b2.html

The version is completely identical to the one in the release (in fact, one of the two download links goes directly to my github release), so if you want, you can already apply it to your custom build.