Converted to CMake for simplicity. Added upstream patch to use sleep_for instead of deprecated usleep. Added patch to fix compilation with musl. Signed-off-by: Rosen Penev <rosenp@gmail.com>