Skip to content

Commit

Permalink
devel/lasi: Fix build with llvm16
Browse files Browse the repository at this point in the history
- Pet portclippy
- Fix builds with DOCS option instead of DOXYGEN
- Adopt port

Sponsored by:	The FreeBSD Foundation
  • Loading branch information
5u623l20 committed Jul 18, 2023
1 parent 0493712 commit cfc6048
Show file tree
Hide file tree
Showing 3 changed files with 198 additions and 174 deletions.
41 changes: 15 additions & 26 deletions devel/lasi/Makefile
@@ -1,57 +1,46 @@
PORTNAME= lasi
PORTVERSION= 1.1.3
PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTVERSION}%20Source
DISTNAME= libLASi-${PORTVERSION}

MAINTAINER= ports@FreeBSD.org
MAINTAINER= bofh@FreeBSD.org
COMMENT= C++ stream output interface for creating Postscript documents
WWW= https://www.unifont.org/lasi/

LIB_DEPENDS= libltdl.so:devel/libltdl
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING

OPTIONS_DEFINE= DOXYGEN EXAMPLES
OPTIONS_SUB= yes
LIB_DEPENDS= libfreetype.so:print/freetype2 \
libfontconfig.so:x11-fonts/fontconfig \
libharfbuzz.so:print/harfbuzz \
libltdl.so:devel/libltdl

USES= cmake compiler:c++11-lang gnome pathfix pkgconfig
USE_CXXSTD= c++14
PATHFIX_CMAKELISTSTXT= pkg-config.cmake
USE_GNOME= pango

USE_LDCONFIG= yes

CMAKE_ARGS+= -DCMAKE_INSTALL_DATADIR:PATH=${DATADIR}

.include <bsd.port.options.mk>
OPTIONS_DEFINE= DOCS EXAMPLES

.if ${PORT_OPTIONS:MDOXYGEN}
BUILD_DEPENDS+= ${LOCALBASE}/bin/doxygen:devel/doxygen
.else
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-cmake+modules+lasi.cmake
.endif
DOCS_BUILD_DEPENDS= ${LOCALBASE}/bin/doxygen:devel/doxygen
DOCS_EXTRA_PATCHES_OFF= ${FILESDIR}/extra-patch-cmake+modules+lasi.cmake

pre-install:
.if ! ${PORT_OPTIONS:MEXAMPLES}
pre-install-EXAMPLES-off:
@${REINPLACE_CMD} 's/^\(add_subdirectory(examples)\)/#\1/' \
${WRKSRC}/CMakeLists.txt
.endif

post-install:
@${MV} ${STAGEDIR}${PREFIX}/lib/libLASi.so.2.0.0 \
${STAGEDIR}${PREFIX}/lib/libLASi.so.2
.if ${PORT_OPTIONS:MDOXYGEN}
@${MKDIR} ${STAGEDIR}${DOCSDIR}
@${MV} ${STAGEDIR}${DATADIR}/doc/* ${STAGEDIR}${DOCSDIR}/
@${RMDIR} ${STAGEDIR}${DATADIR}/doc
.endif
.if ${PORT_OPTIONS:MEXAMPLES}

post-install-EXAMPLES-on:
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
@${MV} ${STAGEDIR}${DATADIR}/examples/* ${STAGEDIR}${EXAMPLESDIR}/
@${RMDIR} ${STAGEDIR}${DATADIR}/examples
.endif
.if ! ${PORT_OPTIONS:MDOXYGEN} && ! ${PORT_OPTIONS:MEXAMPLES}
@${RM} -r ${STAGEDIR}${DATADIR}/*
.endif
@${TEST} -d ${STAGEDIR}${DATADIR} && \
${RMDIR} ${STAGEDIR}${DATADIR} || ${TRUE}

.include <bsd.port.mk>
16 changes: 15 additions & 1 deletion devel/lasi/files/patch-cmake+modules+instdirs.cmake
@@ -1,6 +1,20 @@
--- cmake/modules/instdirs.cmake.orig 2019-01-31 07:34:50 UTC
+++ cmake/modules/instdirs.cmake
@@ -80,6 +80,6 @@ set(docdir ${CMAKE_INSTALL_DATADIR}/doc/libLASi-${VERS
@@ -13,7 +13,7 @@
# install locations).

set(
-CMAKE_INSTALL_EXEC_PREFIX
+CMAKE_INSTALL_EXEC_PREFIX
${CMAKE_INSTALL_PREFIX}
CACHE PATH "install location for architecture-dependent files"
)
@@ -76,10 +76,10 @@ set(includedir ${CMAKE_INSTALL_INCLUDEDIR}
CACHE PATH "install location for headers"
)

-set(docdir ${CMAKE_INSTALL_DATADIR}/doc/libLASi-${VERSION}
+set(docdir ${CMAKE_INSTALL_PREFIX}/share/doc/lasi
CACHE PATH "install location for documentation"
)

Expand Down

0 comments on commit cfc6048

Please sign in to comment.