diff --git a/deskutils/taskwarrior/Makefile b/deskutils/taskwarrior/Makefile index d97f3cf4c486..463075a43c53 100644 --- a/deskutils/taskwarrior/Makefile +++ b/deskutils/taskwarrior/Makefile @@ -1,63 +1,70 @@ PORTNAME= taskwarrior PORTVERSION= 3.5.0 DISTVERSIONPREFIX= v CATEGORIES= deskutils MAINTAINER= skreuzer@FreeBSD.org COMMENT= Feature-rich command-line todo list manager WWW= https://taskwarrior.org/ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= cxxbridge:devel/rust-cxxbridge \ ${LOCALBASE}/lib/cmake/Corrosion/CorrosionConfig.cmake:devel/corrosion TEST_DEPENDS= faketime:devel/libfaketime USES= cmake cargo compiler:c++17-lang python:3.8+,test shebangfix # The Rust part is built by corrosion through CMake, so let cargo.mk # only fetch and vendor the crates (librsvg2-rust style). CARGO_BUILD= no CARGO_INSTALL= no CARGO_TEST= no CONFIGURE_ENV+= ${CARGO_ENV} MAKE_ENV+= ${CARGO_ENV} USE_GITHUB= yes GH_ACCOUNT= GothenburgBitFactory GH_PROJECT= taskwarrior libshared:libshared GH_TAGNAME= 8693555:libshared GH_SUBDIR= src/libshared:libshared CMAKE_ON= SYSTEM_CORROSION CMAKE_ARGS+= -DTASK_DOCDIR:STRING=${DATADIR:S/${PREFIX}\///} \ -DTASK_MAN1DIR:STRING=share/man/man1 \ - -DTASK_MAN5DIR:STRING=share/man/man5 \ - -DCMAKE_BUILD_TYPE=release + -DTASK_MAN5DIR:STRING=share/man/man5 SHEBANG_FILES= test/*.test.py post-patch: # The hook test wrapper invokes a bare "python3" to timestamp hook logs. @${REINPLACE_CMD} -e 's|python3 -c|${PYTHON_CMD} -c|' \ ${WRKSRC}/test/test_hooks/wrapper.sh # corrosion_add_cxxbridge() only uses a preinstalled cxxbridge if its # version exactly matches the cxx crate version from Cargo.lock; # otherwise it would try to "cargo install" it at build time (network!). pre-configure: @v=$$(cxxbridge --version 2>/dev/null | ${SED} -En 's/^cxxbridge ([0-9.]+)$$/\1/p'); \ l=$$(${SED} -En '/^name = "cxx"$$/{n;s/^version = "([^"]+)".*/\1/p;}' ${WRKSRC}/Cargo.lock); \ if [ "$$v" != "$$l" ]; then \ ${ECHO_MSG} "===> cxxbridge ($$v) does not match the cxx crate in Cargo.lock ($$l)"; \ ${ECHO_MSG} "===> Update devel/cxxbridge (or Cargo.lock) so both versions match"; \ exit 1; \ fi do-test: @cd ${BUILD_WRKSRC} && ${SETENV} ${MAKE_ENV} ${CMAKE_BIN} --build . --target test_runner @${CP} ${WRKSRC}/doc/rc/* ${TEST_WRKSRC}/test/ @cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ctest -j${MAKE_JOBS_NUMBER} --output-on-failure -.include +.include + +# i386 has a 32-bit time_t; the braced init in Datetime::operator+/- then +# narrows int64_t -> time_t, which clang rejects with -Wc++11-narrowing. +.if ${ARCH} == i386 +EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-src_libshared_src_Datetime.cpp +.endif + +.include diff --git a/deskutils/taskwarrior/files/extra-patch-src_libshared_src_Datetime.cpp b/deskutils/taskwarrior/files/extra-patch-src_libshared_src_Datetime.cpp new file mode 100644 index 000000000000..f362a8337f34 --- /dev/null +++ b/deskutils/taskwarrior/files/extra-patch-src_libshared_src_Datetime.cpp @@ -0,0 +1,23 @@ +Fix i386 build: time_t is 32-bit there, so "return { _date + delta }" +narrows int64_t to time_t inside a braced-init-list, which clang rejects +with -Wc++11-narrowing (an error, not a warning). Cast explicitly like +the operator+= / operator-= below already do. + +--- src/libshared/src/Datetime.cpp.orig 2026-07-18 21:00:05 UTC ++++ src/libshared/src/Datetime.cpp +@@ -3818,13 +3818,13 @@ + //////////////////////////////////////////////////////////////////////////////// + Datetime Datetime::operator+ (const int64_t delta) + { +- return { _date + delta }; ++ return { (time_t) (_date + delta) }; + } + + //////////////////////////////////////////////////////////////////////////////// + Datetime Datetime::operator- (const int64_t delta) + { +- return { _date - delta }; ++ return { (time_t) (_date - delta) }; + } + + //////////////////////////////////////////////////////////////////////////////// diff --git a/deskutils/taskwarrior/files/patch-src_CMakeLists.txt b/deskutils/taskwarrior/files/patch-src_CMakeLists.txt new file mode 100644 index 000000000000..d4b7e2744325 --- /dev/null +++ b/deskutils/taskwarrior/files/patch-src_CMakeLists.txt @@ -0,0 +1,19 @@ +Do not compile the path to the rc files in the source tree into the task +binary. Upstream enables this whenever CMAKE_BUILD_TYPE is Debug (or unset) +so that in-tree test runs find doc/rc/default.theme, but the resulting binary +writes an "include /doc/rc/default.theme" line into every ~/.taskrc +it creates, which breaks WITH_DEBUG builds of the port once the work +directory is gone. The port's test setup copies the rc files into the test +sandbox instead (see files/patch-test_bash__tap__tw.sh and do-test). + +--- src/CMakeLists.txt.orig 2026-08-16 19:02:36 UTC ++++ src/CMakeLists.txt +@@ -73,8 +73,3 @@ + #SET(CMAKE_CXX_FLAGS_GCOV "--coverage") + #SET(CMAKE_C_FLAGS_GCOV "--coverage") + #SET(CMAKE_EXE_LINKER_FLAGS_GCOV "--coverage") +-if (CMAKE_BUILD_TYPE STREQUAL "Debug" OR NOT CMAKE_BUILD_TYPE) +- target_compile_definitions(task PRIVATE +- -DTASK_TEST_RCDIR="${CMAKE_SOURCE_DIR}/doc/rc" +- ) +-endif ()