Tuesday, April 04, 2023

Re: [Update] comms/hidapi 0.13.1

On 2023/04/03 22:38, Volker Schlecht wrote:
> Updates libhidapi to the most recent release.
> https://github.com/libusb/hidapi/releases/tag/hidapi-0.13.1
>
> * Switch to new github organization (signal11 -> libusb)
> * Switch from deprecated autotools build to devel/cmake
> * Adapt patches
> * Couldn't figure out how to run cmake twice to build
> both static and shared libs, so just built the shared ones

There is a trick used by some ports: extract object files from
the static libs and construct the shared lib from those:

like this (from an unpublished port of libomp):

post-build:
# extract the .o files
cd ${WRKBUILD}/runtime/src && \
${AR} x libomp.a
# build shared library
cd ${WRKBUILD} && \
${CC} -shared -o \
libomp.so.${LIBomp_VERSION} \
runtime/src/*.o -lm -lpthread

post-install:
${INSTALL_DATA} ${WRKBUILD}/lib*.so.${LIBomp_VERSION} \
${PREFIX}/lib/


This is a trick used in math/suitesparse and somewhere else
I can't remember at the moment.


J

No comments:

Post a Comment