Omar Polo <op@openbsd.org> writes:
> Klemens Nanni <kn@openbsd.org> writes:
>
>> Another port that I currently build as bundle of telegram desktop.
>> I figured it would be useful to other ports and a dedicated port always
>> gives us more control.
>>
>> Information for inst:qr-code-generator-1.7.0
>>
>> Comment:
>> QR Code generator library
>>
>> Description:
>> High-quality QR Code generator library in Java, TypeScript/JavaScript,
>> Python, Rust, C++, C.
>>
>> This project aims to be the best, clearest QR Code generator library in
>> multiple languages. The primary goals are flexible options and absolute
>> correctness. Secondary goals are compact implementation size and good
>> documentation comments.
>>
>> This package only contains libraries for C++ and C.
>>
>> Maintainer: Klemens Nanni <kn@openbsd.org>
>>
>> WWW: https://www.nayuki.io/page/qr-code-generator-library
>>
>>
>> Upstream has poor Makefiles, so I leveraged our bsd.{subdir,lib}.mk
>> which works great.
>>
>> Builds fine on amd64, arm64, sparc64.
>>
>> One thing seems off which I spotted by building on a pre clang 13 amd64
>> snapshot, here is the "fix" inlined from Makefile:
>>
>>
>> # XXX on an amd64 snapshot with base-clang 11.1.0:
>> # - base-clang builds without this
>> # - ports-gcc needs this
>> # on an amd64 snapshot with base-clang 13.0.0:
>> # - base-clang needs this
>> # - ports-gcc needs this
>> #
>> # qrcodegen.cpp:24:10: fatal error: 'algorithm' file not found
>> # include <algorithm>
>> CPPFLAGS += -I/usr/include/c++/v1
>>
>>
>> Feedback? OK?
>
> WANTLIB is missing.
>
> I think it'd be easier to just roll our own do-build and do-install
> instead of trying to hook bsd.lib.mk in. Bonus points: we don't need
> the CPPFLAGS hack. Also, we could enable the tests since we're here:
>
> % make test
> ===> Regression tests for qr-code-generator-1.7.0
> cd /home/ports/pobj/qr-code-generator-1.7.0/QR-Code-generator-1.7.0/c && cc -DQRCODEGEN_TEST qrcodegen{,-test}.c -o test && ./test
> All 521 test cases passed
>
> What do you think?
>
> [...]
> + ${INSTALL_DATA} ${WRKSRC}/c/*.so* ${PREFIX}/lib
> + ${INSTALL_DATA} ${WRKSRC}/c/*.h ${PREFIX}/include
> + ${INSTALL_DATA} ${WRKSRC}/cpp/*.so* ${PREFIX}/lib
> + ${INSTALL_DATA} ${WRKSRC}/cpp/*.hpp ${PREFIX}/include
just come to mind that we could simplify that to
${INSTALL_DATA} ${WRKSRC}/c{,pp}/*.so* ${PREFIX}/lib
${INSTALL_DATA} ${WRKSRC}/c{,pp}/*.h* ${PREFIX}/include
> + ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/qr-code-generator
> + ${INSTALL_DATA} ${WRKSRC}/Readme.markdown \
> + ${PREFIX}/share/doc/qr-code-generator
> +
> +do-test:
> + cd ${WRKSRC}/c && \
> + ${CC} -DQRCODEGEN_TEST qrcodegen{,-test}.c -o test && \
> + ./test
>
> .include <bsd.port.mk>
>
> [2. application/octet-stream; qr-code-generator.tar.gz]...
No comments:
Post a Comment