# Patches

`l_patch.sh` is mainly prepared from `prepare()` function from Parabola's [PKGBUILD](https://git.parabola.nu/abslibre.git/tree/libre/netsurf/PKGBUILD). It also has some replace commands at the end for some replacements for privacy respecting search engine.

The `remove_nonprivacy_options.patch` and the changes in PKGBUILD are converted into a patch with these instructions:

- Put the original source in `a` directory, copy that into a `b` directory.
- Put [`remove_nonprivacy_options.patch`](https://git.parabola.nu/abslibre.git/tree/libre/netsurf/remove_nonprivacy_options.patch)
- Put the `l_patch.sh` as `b/l_patch.sh`
- `cd` into `b` (very important)
- You may need to install `setconf` if not installed already.
- Run:
```
bash l_patch.sh
rm l_patch.sh
find . -name \*.orig -delete
cd ..
diff -Naurp1 --no-dereference a b > libre.patch
```

`--no-dereference` is to ignore symbolic links, because it causes issues when xbps applies patch.

- Check for instances of `google` and other non-privacy friendly search engines in the lines beginning with `+` in `libre.patch` and remove/replace them accordingly to privacy respecting option.
- Take the `libre.patch` to put it in `patches` directory with accompanying `libre.patch.args` having `-Np1` as content.
- Doing all these means no need to include `remove_nonprivacy_options.patch`

Arch Linux branding is not there as Useragent, so ignored the change for Void.
