Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Apr 2021 13:04:56 GMT
From:      Lewis Cook <lcook@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 6a9dfe8760c7 - main - www/lagrange: Make SSE4.1 support optional
Message-ID:  <202104221304.13MD4uPL048869@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by lcook:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6a9dfe8760c745ce1710c71c797f88c2f5416b1c

commit 6a9dfe8760c745ce1710c71c797f88c2f5416b1c
Author:     Lewis Cook <lcook@FreeBSD.org>
AuthorDate: 2021-04-22 12:59:59 +0000
Commit:     Lewis Cook <lcook@FreeBSD.org>
CommitDate: 2021-04-22 13:00:20 +0000

    www/lagrange: Make SSE4.1 support optional
    
    Older class AMD64 and i386 CPUs do not support
    SSE4.1, so make it opt-in instead.  This is a
    problem since a build host may support the
    feature-set whilst a package consumer does not,
    causing an unexpected crash upon starting
    the application.
    
    MFH: 2021Q2
---
 www/lagrange/Makefile                              |  6 ++++
 .../files/patch-lib_the__Foundation_CheckSSE.cmake | 32 ++++++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/www/lagrange/Makefile b/www/lagrange/Makefile
index 02f0f46ca5b0..21e23681ebaf 100644
--- a/www/lagrange/Makefile
+++ b/www/lagrange/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	lagrange
 DISTVERSION=	1.2.2
+PORTREVISION=	1
 CATEGORIES=	www
 MASTER_SITES=	https://git.skyjake.fi/skyjake/${PORTNAME}/releases/download/v${DISTVERSION}/
 
@@ -19,6 +20,11 @@ LIB_DEPENDS=	libmpg123.so:audio/mpg123 \
 USES=		cmake compiler:c11 desktop-file-utils pkgconfig sdl ssl
 USE_SDL=	sdl2
 
+OPTIONS_DEFINE=	SSE41
+
+SSE41_DESC=	Enable SSE4.1 support
+SSE41_CMAKE_ON=	-DTFDN_ENABLE_SSE41:BOOL=ON
+
 OPENSSL_LDFLAGS=	-lssl -lcrypto
 
 .include <bsd.port.pre.mk>
diff --git a/www/lagrange/files/patch-lib_the__Foundation_CheckSSE.cmake b/www/lagrange/files/patch-lib_the__Foundation_CheckSSE.cmake
new file mode 100644
index 000000000000..20c25373b943
--- /dev/null
+++ b/www/lagrange/files/patch-lib_the__Foundation_CheckSSE.cmake
@@ -0,0 +1,32 @@
+Disable SSE4.1 by default and make it opt-in only.
+
+Older class AMD64 and i386 CPUs do not support the
+feature-set, this becomes a problem when a build
+hosts support it, whilst package consumers do not,
+causing an instant crash upon startup.
+
+--- lib/the_Foundation/CheckSSE.cmake.orig	2021-04-22 10:39:48 UTC
++++ lib/the_Foundation/CheckSSE.cmake
+@@ -1,22 +1 @@
+ set (SSE41_FOUND NO)
+-try_run (
+-    sseRunCode
+-    sseCompiled
+-    ${CMAKE_CURRENT_BINARY_DIR}
+-    ${CMAKE_CURRENT_LIST_DIR}/ssecheck.c
+-    RUN_OUTPUT_VARIABLE sseOutput
+-)
+-string (STRIP "${sseOutput}" sseOutput)
+-# message (STATUS "sseCompiled: ${sseCompiled}")
+-# message (STATUS "sseRunCode: ${sseRunCode}")
+-# message (STATUS "sseOutput: ${sseOutput}")
+-
+-if (sseCompiled AND sseOutput STREQUAL "1")
+-    set (SSE41_FOUND YES)
+-endif ()
+-
+-if (SSE41_FOUND)
+-    message (STATUS "CPU supports SSE 4.1")
+-else ()
+-    message (STATUS "CPU does not support SSE 4.1")
+-endif ()



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104221304.13MD4uPL048869>