Bug 275042 - math/dsfmt: Some improvements to port
Summary: math/dsfmt: Some improvements to port
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: Thierry Thomas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-12 17:01 UTC by Daniel Engberg
Modified: 2023-11-18 09:34 UTC (History)
0 users

See Also:
thierry: maintainer-feedback+


Attachments
Patch for dsfmt (2.03 KB, patch)
2023-11-12 17:01 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 freebsd_committer freebsd_triage 2023-11-12 17:01:58 UTC
Created attachment 246258 [details]
Patch for dsfmt

- Use DISTVERSION when utilizing USE_GITHUB
  https://docs.freebsd.org/en/books/porters-handbook/book/#makefile-master_sites-github

Remove USES= compiler as its functionality isn't utilized

Change CSTD= to USE_CSTD

Add -DNDEBUG and -DDSFMT_DO_NOT_USE_OLD_NAMES to closer match other repos

Remove -msse2, it's a requirement for amd64

Respect CFLAGS, utilize a common toggle for optimization
https://docs.freebsd.org/en/books/porters-handbook/book/#dads-cflags
https://cgit.freebsd.org/ports/tree/Mk/bsd.options.desc.mk#n396

Compact do-* sections and make use of RLN macro
Comment 1 Thierry Thomas freebsd_committer freebsd_triage 2023-11-12 17:58:01 UTC
Remark: -msse2 is only set for amd64.
This the point of CFLAGS_amd64.

No problem with your other points.
Comment 2 Daniel Engberg freebsd_committer freebsd_triage 2023-11-12 18:07:35 UTC
All amd64 CPUs have SSE2, it's mandatory so you don't need to specify it (-msse2).
Comment 3 Thierry Thomas freebsd_committer freebsd_triage 2023-11-12 18:37:40 UTC
Anyway, we need CFLAGS_amd64 to define HAVE_SSE2.

Actually, when writing this port, I just copied what was defined by Julia to make the bundled part, in order to keep it as-is.
Comment 4 Daniel Engberg freebsd_committer freebsd_triage 2023-11-12 18:51:20 UTC
Indeed, that is still being kept
Comment 5 Thierry Thomas freebsd_committer freebsd_triage 2023-11-13 17:34:50 UTC
OK, just a last point: if you prefer add an option for the OPTIMIZED_CFLAGS, it should be set to default, in order to keep the same behaviour as the previous Julia’s bundle.
Comment 6 Daniel Engberg freebsd_committer freebsd_triage 2023-11-17 19:27:29 UTC
Sure, I'll fix that
Comment 7 commit-hook freebsd_committer freebsd_triage 2023-11-18 09:28:17 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0e851e515db85671a196c382a2cbfc0e3f32ec14

commit 0e851e515db85671a196c382a2cbfc0e3f32ec14
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2023-11-17 19:30:06 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2023-11-18 09:24:49 +0000

    math/dsfmt: Improve port

    * Rearrange Makefile to follow Porters Handbook more closely
    * Use USE_CSTD helper
    * Adjust CFLAGS
    * Use OPTIMIZED_CFLAGS option

    PR:             275042
    Reviewed by:    thierry (maintainer)

 math/dsfmt/Makefile | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)
Comment 8 Daniel Engberg freebsd_committer freebsd_triage 2023-11-18 09:34:29 UTC
Thanks!