#!/bin/sh

jagen_pkg_install() {
    pkg_install || return

    if [ "$pkg_sysroot" ]; then
        pkg_run sed -ri "s|^(prefix=)$pkg_prefix$|\1$pkg_sysroot|" \
            "${pkg_install_dir:?}/bin/gpg-error-config"
    fi
}

#!/bin/sh

jagen_pkg_install() {
    pkg_install || return

    if [ "$pkg_sysroot" ]; then
        pkg_run sed -ri "s|^(prefix=)$|\1$pkg_sysroot|" \
            "${pkg_install_dir:?}/bin/gpg-error-config"
    fi
}

--- 
+++ 
@@ -4,7 +4,7 @@
     pkg_install || return
 
     if [ "$pkg_sysroot" ]; then
-        pkg_run sed -ri "s|^(prefix=)$|\1$pkg_sysroot|" \
+        pkg_run sed -ri "s|^(prefix=)$pkg_prefix$|\1$pkg_sysroot|" \
             "${pkg_install_dir:?}/bin/gpg-error-config"
     fi
 }
Fix gpg-error-config patching to handle non empty pkg_prefix
