svn commit: r438747 - in head: . Mk Mk/Uses
Koop Mast
kwm at FreeBSD.org
Mon Apr 17 18:55:57 UTC 2017
Author: kwm
Date: Mon Apr 17 18:55:56 2017
New Revision: 438747
URL: https://svnweb.freebsd.org/changeset/ports/438747
Log:
Introduce new "meson" USES.
This uses will handling building software that uses the meson
build system. Expand the option framework to handle MESON options.
Approved by: portmgr (swills@)
Differential Revision: https://reviews.freebsd.org/D104091
Added:
head/Mk/Uses/meson.mk (contents, props changed)
Modified:
head/CHANGES
head/Mk/bsd.options.mk
Modified: head/CHANGES
==============================================================================
--- head/CHANGES Mon Apr 17 18:51:20 2017 (r438746)
+++ head/CHANGES Mon Apr 17 18:55:56 2017 (r438747)
@@ -10,6 +10,11 @@ in the release notes and/or placed into
All ports committers are allowed to commit to this file.
+20170417:
+AUTHOR: kwm at FreeBSD.org
+
+ New USES: meson, to handle properly the meson building system.
+
20170313:
AUTHOR: tijl at FreeBSD.org
Added: head/Mk/Uses/meson.mk
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/Mk/Uses/meson.mk Mon Apr 17 18:55:56 2017 (r438747)
@@ -0,0 +1,68 @@
+# $FreeBSD$
+#
+# Provide support for Meson based projects
+#
+# Feature: meson
+# Usage: USES=meson
+#
+# The following files are bundled in source tar files.
+# meson.build - Instructions for meson like autoconf configure,
+# there is no changeable parts in the file.
+# meson_options.txt - All the options meson understands
+#
+# Variables for ports:
+# MESON_ARGS - Arguments passed to meson
+# format: -Denable_foo=true
+# MESON_BUILD_DIR - Path to the build directory
+# Default: ${WRKSRC}/_build
+#
+# MAINTAINER: gnome at FreeBSD.org
+
+.if !defined(_INCLUDE_USES_MESON_MK)
+_INCLUDE_USES_MESON_MK= yes
+
+# Sanity check
+.if !empty(meson_ARGS)
+IGNORE= Incorrect 'USES+= meson:${meson_ARGS}'. meson takes no arguments
+.endif
+
+BUILD_DEPENDS+= meson:devel/meson
+
+# meson uses ninja
+.include "${USESDIR}/ninja.mk"
+
+# meson might have issues with non-unicode locales
+USE_LOCALE?= en_US.UTF-8
+
+CONFIGURE_ARGS+= --prefix ${PREFIX} \
+ --mandir man
+
+# meson has it own strip mechanic
+INSTALL_TARGET= install
+
+# should we have strip separate from WITH_DEBUG?
+.if defined(WITH_DEBUG)
+CONFIGURE_ARGS+= --buildtype debug
+.else
+CONFIGURE_ARGS+= --buildtype release \
+ --strip
+.endif
+
+HAS_CONFIGURE= yes
+CONFIGURE_CMD= meson
+# Pull in manual set settings and from options
+CONFIGURE_ARGS+= ${MESON_ARGS}
+
+BUILD_WRKSRC= ${WRKSRC}/${MESON_BUILD_DIR}
+
+INSTALL_WRKSRC= ${WRKSRC}/${MESON_BUILD_DIR}
+
+TEST_WRKSRC= ${WRKSRC}/${MESON_BUILD_DIR}
+TEST_TARGET= test
+
+MESON_BUILD_DIR?= _build
+
+# Add meson build dir at the end.
+CONFIGURE_ARGS+= ${MESON_BUILD_DIR}
+
+.endif #!defined(_INCLUDE_USES_MESON_MK)
Modified: head/Mk/bsd.options.mk
==============================================================================
--- head/Mk/bsd.options.mk Mon Apr 17 18:51:20 2017 (r438746)
+++ head/Mk/bsd.options.mk Mon Apr 17 18:55:56 2017 (r438747)
@@ -112,6 +112,18 @@
# ${opt}_QMAKE_OFF When option is disabled, it will add its content to
# the QMAKE_ARGS.
#
+# ${opt}_MESON_ON When option is enabled, it will add its
+# content to MESON_ARGS.
+# ${opt}_MESON_OFF When option is disabled, it will add its
+# content to MESON_ARGS.
+#
+# ${opt}_MESON_TRUE Will add to MESON_ARGS:
+# Option enabled --${content} true
+# Option disabled --${content} false
+# ${opt}_MESON_FALSE Will add to MESON_ARGS:
+# Option enabled --${content} false
+# Option disabled --${content} true
+#
# ${opt}_IMPLIES When opt is enabled, options named in IMPLIES will
# get enabled too.
# ${opt}_PREVENTS When opt is enabled, if any options in PREVENTS are
@@ -521,7 +533,13 @@ CMAKE_ARGS+= ${${opt}_CMAKE_BOOL:C/.*/-
. if defined(${opt}_CMAKE_BOOL_OFF)
CMAKE_ARGS+= ${${opt}_CMAKE_BOOL_OFF:C/.*/-D&:BOOL=false/}
. endif
-. for configure in CONFIGURE CMAKE QMAKE
+. if defined(${opt}_MESON_TRUE)
+MESON_ARGS+= ${${opt}_MESON_TRUE:C/.*/-D&=true/}
+. endif
+. if defined(${opt}_MESON_TRUE_OFF)
+MESON_ARGS+= ${${opt}_MESON_TRUE_OFF:C/.*/-D&=false/}
+. endif
+. for configure in CONFIGURE CMAKE MESON QMAKE
. if defined(${opt}_${configure}_ON)
${configure}_ARGS+= ${${opt}_${configure}_ON}
. endif
@@ -571,7 +589,13 @@ CMAKE_ARGS+= ${${opt}_CMAKE_BOOL:C/.*/-
. if defined(${opt}_CMAKE_BOOL_OFF)
CMAKE_ARGS+= ${${opt}_CMAKE_BOOL_OFF:C/.*/-D&:BOOL=true/}
. endif
-. for configure in CONFIGURE CMAKE QMAKE
+. if defined(${opt}_MESON_FALSE)
+MESON_ARGS+= ${${opt}_MESON_FALSE:C/.*/-D&=false/}
+. endif
+. if defined(${opt}_MESON_FALSE_OFF)
+MESON_ARGS+= ${${opt}_MESON_FALSE_OFF:C/.*/-D&=true/}
+. endif
+. for configure in CONFIGURE CMAKE MESON QMAKE
. if defined(${opt}_${configure}_OFF)
${configure}_ARGS+= ${${opt}_${configure}_OFF}
. endif
More information about the svn-ports-head
mailing list