Switch to cmake. Add upstream patch fixing iconv detection. Signed-off-by: Rosen Penev <rosenp@gmail.com>