DEV Question! Use library/object files from windows or ubuntu/centos on Alpine Linux

I have downloaded an SDK, and there are some compiled librarys for windows (dll) and/or centos/linux (so)… there is no source, so i cant recompile them for Alpine Linux (HassOS)

I’m no dev, but is there no way to use those files and make it work on Alpine? maybe in somekind of emulator or something?

thx in advance

linux is linux, be it centos or alpine.
What you have to check is whether the dependencies of the library is met on Alpine. The ldd command is used for that.

But first of all: What do you plan to do with the libraries if you are not a dev?

I have a python script, it works , its using those .so files, i have created an HA addon for that
But the Addon is based on centos or ubuntu, taking space

Want to make it work for Alpine

below output of ldd command

➜  ~ ldd /addons/hikvision/lib/
        /lib/ (0x7f729be6e000) => /addons/hikvision/lib/ (0x7f729b37b000) => /addons/hikvision/lib/ (0x7f729aa8b000) => /usr/lib/ (0x7f729a8ea000) => /lib/ (0x7f729be6e000) => /usr/lib/ (0x7f729a8d0000) => /lib/ (0x7f729be6e000) => /lib/ (0x7f729be6e000) => /lib/ (0x7f729be6e000) => /lib/ (0x7f729be6e000) => /lib/ (0x7f729a8c7000)

In case it was not clear, you have to run the ldd under alpine in the addon environment.
But besides that, if the dependencies are met, it should work.

yeah, but it doesnt work :slight_smile:
in system requirements of the SDK, they say clearly that it only works under redhat/centos/ubuntu
so i want to make it work in Alpine , is there no such thing as an emulator? :slight_smile:

You’d have to do the same transitively for all libs, ofc, so e.g., /addons/hikvision/lib/ and /addons/hikvision/lib/ here

What “doesn’t work”? Do you have errors? logs?

There is no such thing as distro emulators per se. You normally use a VM or docker for that, which is not applicable to an addon, ofc.

You might get somewhere with chroot if you are really motivated :wink:

ok, gonna google chroot :slight_smile:
is this python code i’m using : GitHub - laszlojakab/hikvision-intercom-python-demo: Hikvsion intercom Python demo

its using a shared library (hikvision camera/intercom devices)

so that python scripts tries to login on the hikvision device, but then it throws out some error code 29 , meaining , that library is not compatible