Bug 251785 - sysutils/cpu-x: Fix building without X11 in Poudriere and make package ARM-friendly
Summary: sysutils/cpu-x: Fix building without X11 in Poudriere and make package ARM-fr...
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alexey Dokuchaev
Depends on:
Reported: 2020-12-12 15:13 UTC by Daniel Engberg
Modified: 2020-12-13 09:29 UTC (History)
0 users

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

Patch for cpu-x (3.43 KB, patch)
2020-12-12 15:13 UTC, Daniel Engberg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Engberg 2020-12-12 15:13:34 UTC
Created attachment 220493 [details]
Patch for cpu-x

Patch CMakeLists.txt to use correct libexec path
This application is targeted towards x86/amd64 however a few things like benchmarking also works on other platforms while hardware detection doesn't (lack of support by upstream). While at it, limit building to arm and x86/x86-64 platforms for now.
Rearrange Makefile to make Portlint happy

Compile and run-time tested on FreeBSD 13.0-CURRENT #3 0381b3d8be3-c272567(master)-dirty (aarch64) (without X11)
Compile and run-time tested on FreeBSD 13.0-CURRENT r367711 (amd64) (make, make check-plist) (without X11)
Poudriere testport OK 12.2-RELEASE (amd64)
Comment 1 Alexey Dokuchaev freebsd_committer 2020-12-13 09:02:25 UTC
Thanks for the patch, albeit it's a bit too noisy for my taste. :-)

- DISTVERSION and PORTREVISION are uncalled for (always prefer PORTVERSION
  unless it contains things like dashes, underscores, or weird suffixes,
  if that's the case, resort to DISTVERSION)
- COPYING is just a boilerplate in this port (e.g. it does not contain
  copyright information), thus I've waived the LICENSE_FILE
- Why `localbase' is needed on USES list?
- X11_CMAKE_OFF works just fine, those boolean helpers look too smart to me :)
- I don't see the need for libexec patch: the daemon ends up in the correct
  directory anyways, no?
- ONLY_FOR_ARCHS can probably be waived as well, since the software itself
  is not inherently limited to them

In essence, we just need to expand the .if ${ARCH} to handle more arches, which I agree is a good thing, will do.
Comment 2 Daniel Engberg 2020-12-13 09:29:47 UTC

Handbook says otherwise regarding DISTVERSION and PORTVERSION as far as I can tell.
Ref: http://www.no.freebsd.org/doc/en/books/porters-handbook/book.html --> "Table 5.2. Package Naming Examples"

On aarch64 I ran into issue where it wouldn't find some libs (not using poudriere), however adding localbase fixed those issues (non X11 build).

Regarding libexec, depending on deps (non X11) the daemon gets installed in wrong path using Poudriere and ends up in lib instead.

I opted for ONLY_FOR_ARCHS to keep the noise down (failures) as some libraries are x86/amd64 centric (and will fail on other arches) such as libcpuid.