Bug 258065 - math/cglm: convert to USES=meson
Summary: math/cglm: convert to USES=meson
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Yuri Victorovich
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2021-08-26 17:13 UTC by Jan Beich
Modified: 2021-08-27 17:02 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (yuri)


Attachments
v1 (1.53 KB, patch)
2021-08-26 17:13 UTC, Jan Beich
no flags Details | Diff
v2 (1.80 KB, patch)
2021-08-26 17:45 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2021-08-26 17:13:22 UTC
Created attachment 227454 [details]
v1

For some reason pkg-config version isn't set for me. This is supposed to be done by configure_file() from ${PACKAGE_VERSION} but the variable isn't explicitly set by CMakeLists.txt. Instead of wasting time on CMake let's switch to Meson where pkg-config is more native. THere's only 1 consumer, anyway.

$ pkg-config --modversion cglm

$ cat /usr/local/libdata/pkgconfig/cglm.pc
prefix=/usr/local
exec_prefix=/usr/local
libdir=${prefix}/lib
includedir=${prefix}/include

Name: cglm
Description: OpenGL Mathematics (glm) for C
URL: https://github.com/recp/cglm
Version: 
Cflags: -I${includedir}
Libs: -L${libdir} -lcglm 

$ make -C games/taisei
[...]
Dependency cglm found: NO unknown version, but need: ['>=0.7.8']
Found CMake: /usr/local/bin/cmake (3.21.0)
Dependency cglm found: NO unknown version, but need: ['>=0.7.8']
Run-time dependency cglm found: NO (tried pkgconfig and cmake)
Not looking for a fallback subproject for the dependency cglm because:
Use of fallback dependencies is disabled.

meson.build:153:0: ERROR: Dependency 'cglm' is required but not found.
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2021-08-26 17:21:13 UTC
Can you preserve the test target?
Comment 2 Jan Beich freebsd_committer freebsd_triage 2021-08-26 17:45:16 UTC
Created attachment 227456 [details]
v2

(In reply to Yuri Victorovich from comment #1)
> Can you preserve the test target?

Does this work? Meson needs explicit --reconfigure unlike CMake. I've used build cookies to avoid copy-pasting configure and build targets.
Comment 3 Jan Beich freebsd_committer freebsd_triage 2021-08-27 12:29:25 UTC
I'm still waiting for approval. For example, "make test" builds only tests (like before) but limited only to the first invocation.

$ make clean all
[...]

$ make test
===>  Testing for cglm-0.8.4_1
===>   cglm-0.8.4_1 depends on package: meson>=0.57.1_1 - found
===>   cglm-0.8.4_1 depends on executable: ninja - found
===>  Configuring for cglm-0.8.4_1
The Meson build system
Version: 0.59.1
Source dir: /usr/ports/math/cglm/work/cglm-0.8.4
Build dir: /usr/ports/math/cglm/work/cglm-0.8.4/_build
Build type: native build
Project name: cglm
Project version: 0.8.4
C compiler for the host machine: cc (clang 10.0.1 "FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2)")
C linker for the host machine: cc ld.lld 10.0.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Library m found: YES
Build targets in project: 2

Found ninja-1.10.2 at /usr/local/bin/ninja
===>  Building for cglm-0.8.4_1
[  7% 8/14] cc -Itests.p -I. -I.. -I../include -fno-color-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O3 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -DGLM_TESTS_NO_COLORFUL_OUTPUT -MD -MQ tests.p/test_src_test_cam_lh_no.c.o -MF tests.p/test_src_test_cam_lh_no.c.o.d -o tests.p/test_src_test_cam_lh_no.c.o -c ../test/src/test_cam_lh_no.c
[ 14% 9/14] cc -Itests.p -I. -I.. -I../include -fno-color-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O3 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -DGLM_TESTS_NO_COLORFUL_OUTPUT -MD -MQ tests.p/test_src_test_cam_lh_zo.c.o -MF tests.p/test_src_test_cam_lh_zo.c.o.d -o tests.p/test_src_test_cam_lh_zo.c.o -c ../test/src/test_cam_lh_zo.c
[ 21% 10/14] cc -Itests.p -I. -I.. -I../include -fno-color-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O3 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -DGLM_TESTS_NO_COLORFUL_OUTPUT -MD -MQ tests.p/test_src_test_cam_rh_no.c.o -MF tests.p/test_src_test_cam_rh_no.c.o.d -o tests.p/test_src_test_cam_rh_no.c.o -c ../test/src/test_cam_rh_no.c
[ 28% 11/14] cc -Itests.p -I. -I.. -I../include -fno-color-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O3 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -DGLM_TESTS_NO_COLORFUL_OUTPUT -MD -MQ tests.p/test_src_test_cam_rh_zo.c.o -MF tests.p/test_src_test_cam_rh_zo.c.o.d -o tests.p/test_src_test_cam_rh_zo.c.o -c ../test/src/test_cam_rh_zo.c
[ 35% 12/14] cc -Itests.p -I. -I.. -I../include -fno-color-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O3 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -DGLM_TESTS_NO_COLORFUL_OUTPUT -MD -MQ tests.p/test_src_test_bezier.c.o -MF tests.p/test_src_test_bezier.c.o.d -o tests.p/test_src_test_bezier.c.o -c ../test/src/test_bezier.c
[ 42% 13/14] cc -Itests.p -I. -I.. -I../include -fno-color-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O3 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -DGLM_TESTS_NO_COLORFUL_OUTPUT -MD -MQ tests.p/test_src_test_cam.c.o -MF tests.p/test_src_test_cam.c.o.d -o tests.p/test_src_test_cam.c.o -c ../test/src/test_cam.c
[ 50% 13/14] cc -Itests.p -I. -I.. -I../include -fno-color-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O3 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -DGLM_TESTS_NO_COLORFUL_OUTPUT -MD -MQ tests.p/test_runner.c.o -MF tests.p/test_runner.c.o.d -o tests.p/test_runner.c.o -c ../test/runner.c
[ 57% 13/14] /usr/local/bin/meson --internal symbolextractor /usr/ports/math/cglm/work/cglm-0.8.4/_build libcglm.so.0.8.4 libcglm.so.0.8.4 libcglm.so.0.8.4.p/libcglm.so.0.8.4.symbols
[ 64% 13/14] cc -Itests.p -I. -I.. -I../include -fno-color-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O3 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -DGLM_TESTS_NO_COLORFUL_OUTPUT -MD -MQ tests.p/test_src_test_clamp.c.o -MF tests.p/test_src_test_clamp.c.o.d -o tests.p/test_src_test_clamp.c.o -c ../test/src/test_clamp.c
[ 71% 13/14] cc -Itests.p -I. -I.. -I../include -fno-color-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O3 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -DGLM_TESTS_NO_COLORFUL_OUTPUT -MD -MQ tests.p/test_src_test_euler.c.o -MF tests.p/test_src_test_euler.c.o.d -o tests.p/test_src_test_euler.c.o -c ../test/src/test_euler.c
[ 78% 13/14] cc -Itests.p -I. -I.. -I../include -fno-color-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O3 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -DGLM_TESTS_NO_COLORFUL_OUTPUT -MD -MQ tests.p/test_src_test_struct.c.o -MF tests.p/test_src_test_struct.c.o.d -o tests.p/test_src_test_struct.c.o -c ../test/src/test_struct.c
[ 85% 13/14] cc -Itests.p -I. -I.. -I../include -fno-color-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O3 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -DGLM_TESTS_NO_COLORFUL_OUTPUT -MD -MQ tests.p/test_src_test_common.c.o -MF tests.p/test_src_test_common.c.o.d -o tests.p/test_src_test_common.c.o -c ../test/src/test_common.c
[ 92% 13/14] cc -Itests.p -I. -I.. -I../include -fno-color-diagnostics -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O3 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -DGLM_TESTS_NO_COLORFUL_OUTPUT -MD -MQ tests.p/test_src_tests.c.o -MF tests.p/test_src_tests.c.o.d -o tests.p/test_src_tests.c.o -c ../test/src/tests.c
[100% 14/14] cc  -o tests tests.p/test_runner.c.o tests.p/test_src_test_bezier.c.o tests.p/test_src_test_cam.c.o tests.p/test_src_test_cam_lh_no.c.o tests.p/test_src_test_cam_lh_zo.c.o tests.p/test_src_test_cam_rh_no.c.o tests.p/test_src_test_cam_rh_zo.c.o tests.p/test_src_test_clamp.c.o tests.p/test_src_test_common.c.o tests.p/test_src_test_euler.c.o tests.p/test_src_tests.c.o tests.p/test_src_test_struct.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -fstack-protector-strong -O2 -pipe -fstack-protector-strong -fno-strict-aliasing '-Wl,-rpath,$ORIGIN/' -Wl,-rpath-link,/usr/ports/math/cglm/work/cglm-0.8.4/_build/ -Wl,--start-group libcglm.so.0.8.4 -lm -Wl,--end-group
[  0% 1/1] /usr/local/bin/meson test --no-rebuild --print-errorlogs
1/1 cglm.tests        OK              0.17s


Ok:                 1
Expected Fail:      0
Fail:               0
Unexpected Pass:    0
Skipped:            0
Timeout:            0

Full log written to /usr/ports/math/cglm/work/cglm-0.8.4/_build/meson-logs/testlog.txt

$ make test
===>  Testing for cglm-0.8.4_1
[  0% 1/1] /usr/local/bin/meson test --no-rebuild --print-errorlogs
1/1 cglm.tests        OK              0.17s


Ok:                 1
Expected Fail:      0
Fail:               0
Unexpected Pass:    0
Skipped:            0
Timeout:            0

Full log written to /usr/ports/math/cglm/work/cglm-0.8.4/_build/meson-logs/testlog.txt
Comment 4 Yuri Victorovich freebsd_committer freebsd_triage 2021-08-27 17:02:24 UTC
Committed, thanks!
Comment 5 commit-hook freebsd_committer freebsd_triage 2021-08-27 17:02:24 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2ed037639e9b536d23f997772c4bd23394ceb666

commit 2ed037639e9b536d23f997772c4bd23394ceb666
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2021-08-27 16:58:18 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2021-08-27 17:02:10 +0000

    math/cglm: convert to USES=meson from USES=cmake

    It wrote a .pc file that was causing games/taisei to not find
    cglm for some reason.

    PR:             258065

 math/cglm/Makefile  | 14 ++++++++------
 math/cglm/pkg-plist |  2 --
 2 files changed, 8 insertions(+), 8 deletions(-)