Changeset View
Changeset View
Standalone View
Standalone View
devel/googletest/Makefile
# Created by: Cheng-Lung Sung <clsung@FreeBSD.org> | # Created by: Cheng-Lung Sung <clsung@FreeBSD.org> | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTNAME= googletest | PORTNAME= googletest | ||||
DISTVERSIONPREFIX= release- | DISTVERSIONPREFIX= release- | ||||
DISTVERSION= 1.8.1 | DISTVERSION= 1.8.1 | ||||
PORTREVISION= 1 | PORTREVISION= 2 | ||||
CATEGORIES= devel | CATEGORIES= devel | ||||
MAINTAINER= jbeich@FreeBSD.org | MAINTAINER= jbeich@FreeBSD.org | ||||
COMMENT= Framework for writing C++ tests on a variety of platforms | COMMENT= Framework for writing C++ tests on a variety of platforms | ||||
LICENSE= BSD3CLAUSE | LICENSE= BSD3CLAUSE | ||||
LICENSE_FILE= ${WRKSRC}/LICENSE | LICENSE_FILE= ${WRKSRC}/LICENSE | ||||
USE_GITHUB= yes | USE_GITHUB= yes | ||||
GH_ACCOUNT= google | GH_ACCOUNT= google | ||||
USES= autoreconf compiler:c++11-lang libtool | USES= cmake:noninja compiler:c++11-lang libtool | ||||
jbeichUnsubmitted Not Done Inline Actions
jbeich: - Why `:noninja` is necessary?
- `USES=libtool` isn't used with `USES=cmake`
| |||||
WRKSRC_SUBDIR= ${PORTNAME} | CMAKE_ON= BUILD_SHARED_LIBS gtest_build_tests | ||||
GNU_CONFIGURE= yes | CMAKE_OFF= BUILD_GMOCK | ||||
# fused-src python tests are only useful for bundling. There's no point in | |||||
# running them before installing system-wide without source files. | |||||
CONFIGURE_ENV= ac_cv_path_PYTHON=":" | |||||
TEST_TARGET= check | TEST_TARGET= check | ||||
jbeichUnsubmitted Not Done Inline ActionsReplace check (automake) with test (CMake): $ make test ===> Testing for googletest-1.8.1_2 make[1]: don't know how to make check. Stop make[1]: stopped in /usr/ports/devel/googletest/work/.build *** Error code 1 Stop. make: stopped in /usr/ports/devel/googletest jbeich: Replace `check` (automake) with `test` (CMake):
```
$ make test
===> Testing for googletest-1. | |||||
INSTALL_TARGET= install-strip | |||||
USE_LDCONFIG= yes | USE_LDCONFIG= yes | ||||
post-patch: | CXXFLAGS+= -DGTESTS_HAS_POSIX_RE=1 | ||||
# enable vendor make install again (revert 661758e) | CXXFLAGS+= -DGTESTS_HAS_STREAM_REDIRECTION=1 | ||||
jbeichUnsubmitted Not Done Inline ActionsBoth are already default on FreeBSD and nop here due to a typo. jbeich: Both are already default on FreeBSD and nop here due to a typo. | |||||
@${REINPLACE_CMD} -E 's/install-(exec|data)-local/&-dummy/' \ | CXXFLAGS+= -frtti | ||||
jbeichUnsubmitted Not Done Inline ActionsAlready default for both Clang and GCC. jbeich: Already default for both Clang and GCC. | |||||
${WRKSRC}/Makefile.am | CXXFLAGS+= -std=c++11 | ||||
jbeichUnsubmitted Not Done Inline ActionsC++14 is already default for both Clang and GCC (implied via USES=compiler:c++11-lang). If C++11 (not C++14 or later) is important cherry-pick upstream fixes or update to a snapshot. jbeich: C++14 is already default for both Clang and GCC (implied via `USES=compiler:c++11-lang`). If… | |||||
ngieAuthorUnsubmitted Done Inline ActionsI was being unnecessarily conservative. ngie: I was being unnecessarily conservative. | |||||
post-install: | pre-install: | ||||
jbeichUnsubmitted Done Inline ActionsUse post-install for additional files. jbeich: Use `post-install` for additional files. | |||||
${INSTALL_SCRIPT} ${WRKSRC}/scripts/gtest-config ${STAGEDIR}${PREFIX}/bin | ${MKDIR} ${STAGEDIR}${LOCALBASE}/tests/googletest | ||||
asomersUnsubmitted Done Inline ActionsInstalling tests should be conditionalized on a TEST option. That's what Kyua does. It should probably be off-by-default, but that's just my opinion. asomers: Installing tests should be conditionalized on a `TEST` option. That's what Kyua does. It… | |||||
tests="$$(${GREP} -E "^tests/googletest" "${PKGDIR}/pkg-plist")"; \ | |||||
for test in $$tests; do \ | |||||
${INSTALL_PROGRAM} \ | |||||
"${CONFIGURE_WRKSRC}/googletest/$$(basename $$test)" \ | |||||
jbeichUnsubmitted Done Inline ActionsUse ${INSTALL_WRKSRC}. jbeich: Use `${INSTALL_WRKSRC}`. | |||||
"${STAGEDIR}${LOCALBASE}/$$test"; \ | |||||
matUnsubmitted Done Inline ActionsLOCALBASE is where dependencies are installed, not where the port installs itself, that's PREFIX. mat: `LOCALBASE` is where dependencies are installed, not where the port installs itself, that's… | |||||
done | |||||
.include <bsd.port.mk> | .include <bsd.port.mk> |