libevent2: make cmake use relative imported path
authorLiu Dongmiao <liudongmiao@gmail.com>
Tue, 12 Mar 2024 06:48:08 +0000 (06:48 +0000)
committerLiu Dongmiao <liudongmiao@gmail.com>
Wed, 13 Mar 2024 00:24:43 +0000 (00:24 +0000)
commit51752fa14bebb6d026b36dc18e4562f93caa96b5
treedeabe24487c8a5ad522dea57cc3d6f7215e82ca6
parent1d3d6ef8269aca7ee34fb6ddd1c11d3fe45e785b
libevent2: make cmake use relative imported path

libevent2's cmake use absolute path, then cmake cannot find it when cross compiling:

```
-- Found libevent include directory: /builder/staging_dir/target-mips_24kc_musl/usr/include
-- Found libevent component: /builder/staging_dir/target-mips_24kc_musl/usr/lib/libevent_core.so
-- Found libevent component: /builder/staging_dir/target-mips_24kc_musl/usr/lib/libevent_extra.so
-- Found libevent component: /builder/staging_dir/target-mips_24kc_musl/usr/lib/libevent_openssl.so
-- Found libevent 2.1.12 in /builder/staging_dir/target-mips_24kc_musl/usr
CMake Error at /builder/staging_dir/target-mips_24kc_musl/usr/lib/cmake/libevent/LibeventTargets-shared.cmake:102 (message):
  The imported target "libevent::core" references the file

     "/usr/lib/libevent_core-2.1.so.7.0.1"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/builder/staging_dir/target-mips_24kc_musl/usr/lib/cmake/libevent/LibeventTargets-shared.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /builder/staging_dir/target-mips_24kc_musl/usr/lib/cmake/libevent/LibeventConfig.cmake:168 (include)
  CMakeLists.txt:34 (find_package)
```

This patch make cmake use relative imported path, so it can find libevent.

Signed-off-by: Liu Dongmiao <liudongmiao@gmail.com>
package/libs/libevent2/Makefile
package/libs/libevent2/patches/001-relative-cmake.patch [new file with mode: 0644]