For reasons that are a bit beyond me, `--host` and `PLATFORM_TRIPLET`
seem to be independent, in particular we've had an empty
`PLATFORM_TRIPLET`. This is unfortunate because `PLATFORM_TRIPLET`
is used to generate the SOABI config variable which in turn is used
to decide whether a .so file is a good match for loading. We'd like
for linux Pythons not to try to import emscripten .so files (it
raises `ImportError: some_file.so: invalid ELF header`). Similarly,
we'd like to avoid attempting to load linux .so files in wasm. These
platform tags are our friends.

Anyways, this PR sets `PLATFORM_TRIPLET` and ensures that .so files
built by pywasmcross are tagged with our SOABI tag.

I moved the .so file renaming from pywasmcross to buildpkg just
before running the post script. That is a better place to put it in
case the package wants to look at the .so file after linking it. It
might be surprised that we moved it.

I also improved the error message if we try to `loadWebAssemblyModule`
something that is actually say a Linux .so file and updated get_dynlibs
to filter out .so files that have an incompatible abi tag.
Set PLATFORM_TRIPLET, include platform in so names, only load compatible so files. For reasons that are a bit beyond me, `--host` and `PLATFORM_TRIPLET`
seem to be independent, in particular we've had an empty
`PLATFORM_TRIPLET`. This is unfortunate because `PLATFORM_TRIPLET`
is used to generate the SOABI config variable which in turn is used
to decide whether a .so file is a good match for loading. We'd like
for linux Pythons not to try to import emscripten .so files (it
raises `ImportError: some_file.so: invalid ELF header`). Similarly,
we'd like to avoid attempting to load linux .so files in wasm. These
platform tags are our friends.

Anyways, this PR sets `PLATFORM_TRIPLET` and ensures that .so files
built by pywasmcross are tagged with our SOABI tag.

I moved the .so file renaming from pywasmcross to buildpkg just
before running the post script. That is a better place to put it in
case the package wants to look at the .so file after linking it. It
might be surprised that we moved it.

I also improved the error message if we try to `loadWebAssemblyModule`
something that is actually say a Linux .so file and updated get_dynlibs
to filter out .so files that have an incompatible abi tag.
# from: http://wiki.scipy.org/Cookbook/Theoretical_Ecology/Hastings_and_Powell
# setup: import numpy as np ; y = np.random.rand(3) ; args = np.random.rand(7)
# run: hasting(y, *args)

# pythran export hasting(float [], float, float, float, float, float,
# float, float)
import numpy as np


def hasting(y, t, a1, a2, b1, b2, d1, d2):
    yprime = np.empty((3,))
    yprime[0] = y[0] * (1.0 - y[0]) - a1 * y[0] * y[1] / (1.0 + b1 * y[0])
    yprime[1] = (
        a1 * y[0] * y[1] / (1.0 + b1 * y[0])
        - a2 * y[1] * y[2] / (1.0 + b2 * y[1])
        - d1 * y[1]
    )
    yprime[2] = a2 * y[1] * y[2] / (1.0 + b2 * y[1]) - d2 * y[2]
    return yprime

# from: http://wiki.scipy.org/Cookbook/Theoretical_Ecology/Hastings_and_Powell
# setup: import numpy as np ; y = np.random.rand(3) ; args = np.random.rand(7)
# run: hasting(y, *args)

# pythran export hasting(float [], float, float, float, float, float,
# float, float)
import numpy as np


def hasting(y, t, a1, a2, b1, b2, d1, d2):
    yprime = np.empty((3,))
    yprime[0] = y[0] * (1.0 - y[0]) - a1 * y[0] * y[1] / (1.0 + b1 * y[0])
    yprime[1] = (
        a1 * y[0] * y[1] / (1.0 + b1 * y[0])
        - a2 * y[1] * y[2] / (1.0 + b2 * y[1])
        - d1 * y[1]
    )
    yprime[2] = a2 * y[1] * y[2] / (1.0 + b2 * y[1]) - d2 * y[2]
    return yprime
