termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.34k stars 3.07k forks source link

enhance(main/zsh): Cherry-pick PCRE2 support for `zsh/pcre` module #22314

Open TomJo2000 opened 3 days ago

TomJo2000 commented 3 days ago

This PR adopts Arch Linux's cherry-picks from upstream Zsh to update the zsh/pcre module to use pcre2 instead of the now deprecated pcre^1.

This change is already present in the upstream project's master branch, and is slated for inclusion in the 5.10 release of Zsh. Which will presumably happen sometime prior to the heat death of the universe.

This PR also contains:

TomJo2000 commented 3 days ago

Ah crap I just got around to testing this on-device and that didn't quite work it looks like. image

Ah it's not applying the patch. But `termux_step_post_get_source` should happen before `termux_step_patch_package`... ![image](https://github.com/user-attachments/assets/036e5f9b-b90f-4fbd-91a3-cf8af39ff9d0)

Oh... I downloaded it into the wrong directory.
TomJo2000 commented 3 days ago

Tracked it down to needing to autoreconf -fi first. In addition to actually downloading the patch to the right location.

Scratch that. I don't know anymore at this point.

TomJo2000 commented 3 days ago

The first configure run, for config.modules doesn't pick up -lpcre2-8, the second one for Zsh itself does. But since the module one doesn't, zsh/pcre doesn't get linked to pcre2.

I'm just gonna push my changes to this branch and worry about it tomorrow.

Edit: Apparently I should just hold my tongue because I just noticed I had commented out the `autoreconf -fi` to diff the logs. And after re-enabling it, it works as it should. ![image](https://github.com/user-attachments/assets/bb178b34-5150-4009-90ee-fa7f4a711575) Works like a charm.
TomJo2000 commented 1 day ago

Looks like it isn't removing the pcre patch from the package directory properly after patching, I didn't get the time to look into why today.