Skip to content

Commit

Permalink
math/scilab: Fix build with llvm16
Browse files Browse the repository at this point in the history
Approved by:	portmgr (blanket)
Sponsored by:	The FreeBSD Foundation
  • Loading branch information
5u623l20 committed Aug 6, 2023
1 parent d841a36 commit 005c37a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion math/scilab/Makefile
Expand Up @@ -27,6 +27,7 @@ RUN_DEPENDS= xdg-open:devel/xdg-utils
USES= compiler:c++17-lang cpe desktop-file-utils eigen:3,build \
fortran gettext gmake gnome iconv:wchar_t libtool \
localbase ncurses pathfix pkgconfig shared-mime-info
USE_CXXSTD= c++14
USE_LOCALE= en_US.UTF-8

GNU_CONFIGURE= yes
Expand Down Expand Up @@ -132,10 +133,14 @@ CONFIGURE_ARGS+= --enable-debug

.include <bsd.port.pre.mk>

.if ${OPSYS} == FreeBSD && ( ${OSVERSION} >= 1400079 || ( ${OSVERSION} >= 1302505 && ${OSVERSION} < 1400000 ))
.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 150
CFLAGS+= -Wno-error=int-conversion
.endif

.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 160
CFLAGS+= -Wno-error=incompatible-function-pointer-types
.endif

.if ${GCC_DEFAULT} >= 10
# workaround for Rank mismatch between actual argument at (1) and actual argument at (2) (rank-1 and scalar)
FFLAGS+= -fallow-argument-mismatch
Expand All @@ -144,6 +149,11 @@ FFLAGS+= -fallow-argument-mismatch
post-patch:
@${REINPLACE_CMD} 's,/usr/local,${LOCALBASE},' ${WRKSRC}/etc/librarypath.xml
@${REINPLACE_CMD} -e 's, gfortran, ${FC},' ${WRKSRC}/modules/dynamic_link/src/scripts/configure
.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 160
@${REINPLACE_CMD} -e 's|std::filesystem|std::__fs::filesystem|g' \
${WRKSRC}/modules/fileio/src/cpp/fullpath.cpp \
${WRKSRC}/modules/fileio/sci_gateway/cpp/sci_get_absolute_file_path.cpp
.endif

post-patch-GUI-on:
# scilab segfaults on FreeBSD with C locale
Expand Down

0 comments on commit 005c37a

Please sign in to comment.