From nobody Mon Mar 13 21:07:12 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Pb8Nx23BVz3yCJm; Mon, 13 Mar 2023 21:07:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Pb8Nx1YYbz3F9Q; Mon, 13 Mar 2023 21:07:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678741633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uOoZ3ZAhxtWUgzFI+tx57i02UvwkTsv14SP51YEJtwU=; b=ju2W4BPYK6FAtgYZ4B6v4Lhl9Y8trjyKJuSuwdHA4uuSUn8BV8Stdx1rKHGqBkxzhHuExb k9C2OLPKRxtzIH8uPHXiEdWHVqdMDA/OzwNMXUEQXuWflkBI2eIcfnlE10ofPLFxUipyNk XejOwqhtxPsu6JBW99PnthtxGWuezwmNqfgFe8xIoTaZyzAinLTpwAND3Sa/aa18Y9Mv5H VTlX6q/L12qtnGb1KJ0gksEl9wAzH+quMFm6hlusPa0W2yU99dE3JAZIeTiwzsAeFzrs3w xVjvwBEWWubsU1t7fEzi0psTFDocaZ9DMQX2xSD8pSieDoJPFXOOwMbu3f/J6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678741633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uOoZ3ZAhxtWUgzFI+tx57i02UvwkTsv14SP51YEJtwU=; b=Ou5eJEa9wyA8hfIiSNST/GPnc6SEt6t3DlMe/7IVxrx0izWU2pIuNXwNrDuVqViQS71w4y x8jy2rhQJaa5VV8hrQ+fAD+mQ3iHHkcb2s70zy9ZsfeEb28/YFE7wFFKf2fIcSU4OMgWOA PczNTc0EVDdKj2gem/bFr7SQh08Ht8JS8p6+OHBH32v68vBwSSGKKkbdpj1ylzqsgGFFbN YdqvgB7ouqmw5oZDm7P2nt+tLWff1vQWgVicYChuHZCV1Rs+n/KC8y2zDiv5FCncuDJFzy GbzSCOvGEx5x8u7pWZnN3NHGWTAfzNaV5qTwybqFdRPsWhAUhpTsLzBI5Upz2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678741633; a=rsa-sha256; cv=none; b=MOPm7gGxLSY96SUpVWg8/R+spkdeH/C+5xKzVXO/Qj+hnPFuUkS/xUOJ8NNz+7XghjI+Eb QTNbDiLGHN3wkWYpTChOkmKg/1qSDWv/MpwQWpfRT8KeVne0ZUTy2+K3Cfmog9y1JQCsR+ 3MtxIuJeG4uVqUqdaWcMBKUlbM42DdCeN2CUge9v/Wb7OZnnlSm7MfFF99lxbzFAkLCorL 9x1d0+vtRs0c7jgTI+qmcs416NyzVOrxZ9gaXJyn9xrf2ER2X7Vpv9Ry4+wrei6nxzoFm3 oYSqwSHc/gi9+nQzEogInpzkJI8RO1WDTronpXCz/gzGj5UfpOWBpvRvLL/ALw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Pb8Nx0bkLz17LM; Mon, 13 Mar 2023 21:07:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32DL7CJW050807; Mon, 13 Mar 2023 21:07:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32DL7CL7050806; Mon, 13 Mar 2023 21:07:12 GMT (envelope-from git) Date: Mon, 13 Mar 2023 21:07:12 GMT Message-Id: <202303132107.32DL7CL7050806@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Kurt Jaeger Subject: git: 61e5c612e7f1 - main - devel/ccache4: new port List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pi X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61e5c612e7f14178fec95fd56dcbf2b6b9fce5d4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pi: URL: https://cgit.FreeBSD.org/ports/commit/?id=61e5c612e7f14178fec95fd56dcbf2b6b9fce5d4 commit 61e5c612e7f14178fec95fd56dcbf2b6b9fce5d4 Author: Oleg Sidorkin AuthorDate: 2023-03-13 21:04:41 +0000 Commit: Kurt Jaeger CommitDate: 2023-03-13 21:04:41 +0000 devel/ccache4: new port ccache is a compiler cache. It acts as a caching pre-processor to C/C++ compilers, using the -E compiler switch and a hash to detect when a compilation can be satisfied from cache. This often results in a 5 to 10 times speedup in common compilations. PR: 234971 Approved by: bdrewery Author: Oleg Sidorkin --- devel/Makefile | 1 + devel/ccache/Makefile | 2 +- devel/ccache4/Makefile | 101 ++++++++++++++++++++++++++ devel/ccache4/distinfo | 3 + devel/ccache4/files/ccache-update-links.sh.in | 72 ++++++++++++++++++ devel/ccache4/files/ccache_clean.in | 71 ++++++++++++++++++ devel/ccache4/files/pkg-message.in | 10 +++ devel/ccache4/files/world-ccache.in | 9 +++ devel/ccache4/pkg-descr | 4 + devel/ccache4/pkg-plist | 9 +++ 10 files changed, 281 insertions(+), 1 deletion(-) diff --git a/devel/Makefile b/devel/Makefile index 0f833ed637c3..0dbfaf4fb83b 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -339,6 +339,7 @@ SUBDIR += ccache-memcached SUBDIR += ccache-memcached-static SUBDIR += ccache-static + SUBDIR += ccache4 SUBDIR += cccc SUBDIR += ccdoc SUBDIR += ccls diff --git a/devel/ccache/Makefile b/devel/ccache/Makefile index 99c902e6399f..97ca1446269d 100644 --- a/devel/ccache/Makefile +++ b/devel/ccache/Makefile @@ -12,7 +12,7 @@ WWW= https://ccache.samba.org/ LICENSE= GPLv3+ LICENSE_FILE= ${WRKSRC}/GPL-3.0.txt -CONFLICTS_INSTALL?= ccache-static ccache-memcached ccache-memcached-static +CONFLICTS_INSTALL?= ccache-static ccache-memcached ccache-memcached-static ccache4 GNU_CONFIGURE= yes diff --git a/devel/ccache4/Makefile b/devel/ccache4/Makefile new file mode 100644 index 000000000000..f1dadfa4a86d --- /dev/null +++ b/devel/ccache4/Makefile @@ -0,0 +1,101 @@ +PORTNAME= ccache +PORTVERSION= 4.8 +DISTVERSIONPREFIX= v +CATEGORIES= devel +PKGNAMESUFFIX= 4 + +MAINTAINER= bdrewery@FreeBSD.org +COMMENT= Tool to minimize the compile time of C/C++ programs +WWW= https://ccache.dev/ + +LICENSE= GPLv3+ +LICENSE_FILE= ${WRKSRC}/GPL-3.0.txt + +USES= cmake:noninja pathfix shebangfix compiler:c++11-lang +CONFLICTS_INSTALL?= ccache ccache-static \ + ccache-memcached ccache-memcached-static + +PORTDOCS= AUTHORS.adoc AUTHORS.html MANUAL.html MANUAL.adoc \ + NEWS.adoc NEWS.html + +USE_GITHUB= yes +SUB_FILES= world-ccache ccache-update-links.sh ccache_clean +# Prevent infinite recursion. +NO_CCACHE_DEPEND= yes + +LIB_DEPENDS+= libzstd.so:archivers/zstd + +# /bin/bash -> /bin/sh to reduce tests dep. +SHEBANG_FILES= test/* +SHEBANG_GLOB= *.sh *.bash +bash_CMD= /bin/sh + +CMAKE_OFF= WARNINGS_AS_ERRORS \ + ENABLE_IPO \ + ZSTD_FROM_INTERNET \ + ENABLE_TRACING \ + REDIS_STORAGE_BACKEND \ + STATIC_LINK + +OPTIONS_DEFINE= DOCS CLANGLINK LLVMLINK STATIC TEST +OPTIONS_DEFAULT=CLANGLINK LLVMLINK +OPTIONS_SUB= yes + +DOCS_BUILD_DEPENDS= asciidoctor:textproc/rubygem-asciidoctor +DOCS_ALL_TARGET= all doc +DOCS_USES= perl5 +DOCS_CMAKE_BOOL= ENABLE_DOCUMENTATION + +CLANGLINK_DESC= Create clang compiler links if clang is installed +LLVMLINK_DESC= Create llvm compiler links if llvm is installed + +STATIC_LDFLAGS= -static + +TEST_CMAKE_BOOL=ENABLE_TESTING +TEST_TARGET= check + +.include + +CCLINKDIR= libexec/ccache +PLIST_SUB+= CCLINKDIR="${CCLINKDIR}" + +.if ${ARCH}=="i386" +CCACHE_COMPILERS+= icc icpc +.endif + +GNU_COMPILERS+= 48 8 9 10 11 12 +CCACHE_COMPILERS+= cc c++ CC gcc g++ ${GNU_COMPILERS:S|^|gcc|} \ + ${GNU_COMPILERS:S|^|g++|} \ + ${GNU_COMPILERS:S|^|cpp|} + +.if ${PORT_OPTIONS:MCLANGLINK} +CLANG_COMPILERS+= 10 11 12 13 14 15 16 -devel +CCACHE_COMPILERS+= clang clang++ ${CLANG_COMPILERS:S|^|clang|} \ + ${CLANG_COMPILERS:S|^|clang++|} \ + ${CLANG_COMPILERS:S|^|cpp|} +.endif + +.if ${PORT_OPTIONS:MLLVMLINK} +CCACHE_COMPILERS+= llvm-gcc llvm-c++ llvm-g++ +.endif + +CCACHE_COMPILERS+= ${EXTRA_COMPILERS} +SUB_LIST+= CCACHE_COMPILERS="${CCACHE_COMPILERS}" \ + CCLINKDIR="${CCLINKDIR}" + +post-install: + ${MKDIR} ${STAGEDIR}${PREFIX}/${CCLINKDIR}/world + ${INSTALL_SCRIPT} ${WRKDIR}/world-ccache \ + ${STAGEDIR}${PREFIX}/${CCLINKDIR}/world/ccache + ${INSTALL_SCRIPT} ${WRKDIR}/ccache-update-links.sh \ + ${STAGEDIR}${PREFIX}/bin/ccache-update-links + @${MKDIR} ${STAGEDIR}${PREFIX}/etc/periodic/daily + ${INSTALL_SCRIPT} ${WRKDIR}/ccache_clean \ + ${STAGEDIR}${PREFIX}/etc/periodic/daily + +post-install-DOCS-on: + ${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${BUILD_WRKSRC}/doc/*.html ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/doc/*.adoc ${STAGEDIR}${DOCSDIR} + +.include diff --git a/devel/ccache4/distinfo b/devel/ccache4/distinfo new file mode 100644 index 000000000000..5b7926ccb96e --- /dev/null +++ b/devel/ccache4/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1678706114 +SHA256 (ccache-ccache-v4.8_GH0.tar.gz) = 47c9ff1668c9c6892b34642f9f09027f4a41e719dad1062f82265ff0087299ce +SIZE (ccache-ccache-v4.8_GH0.tar.gz) = 767312 diff --git a/devel/ccache4/files/ccache-update-links.sh.in b/devel/ccache4/files/ccache-update-links.sh.in new file mode 100644 index 000000000000..15bc180aef2d --- /dev/null +++ b/devel/ccache4/files/ccache-update-links.sh.in @@ -0,0 +1,72 @@ +#!/bin/sh +# +# Author: Emanuel Haupt +# +# $FreeBSD: head/devel/ccache/files/ccache-update-links.sh.in 435560 2017-03-06 17:50:14Z bdrewery $ +# + +CCACHE_COMPILERS="%%CCACHE_COMPILERS%% ${EXTRA_COMPILERS}" +CCLINKDIR="%%CCLINKDIR%%" +PREFIX="%%PREFIX%%" + +usage() { + cat << "EOUSAGE" +Usage: ccache-update-links [hv] + +ccache-update-links maintains symlinks needed by ccache to work with additional +compilers. + + -h, --help this help + -v verbose + +EOUSAGE +} + +case "$1" +in + -h|--help) + usage + ;; +esac + +strip_path() { + local IFS=":" + local path + set -- ${PATH} + while [ $# -gt 0 ]; do + if ! [ "${1}" = "${PREFIX}/libexec/ccache" ]; then + path="${path}${path:+:}${1}" + fi + shift + done + echo "${path}" +} + +# Remove ccache wrappers from PATH +PATH=$(strip_path) + +# create compiler links +for comp in ${CCACHE_COMPILERS} +do + if command -v "${comp}" >/dev/null; then + if [ ! -L "${PREFIX}/${CCLINKDIR}/${comp}" ]; then + [ "$1" = "-v" ] && echo "create symlink for ${comp}" + ln -sf ${PREFIX}/bin/ccache ${PREFIX}/${CCLINKDIR}/${comp} + fi + + if [ ! -L "${PREFIX}/${CCLINKDIR}/world/${comp}" ]; then + [ "$1" = "-v" ] && echo "create symlink for ${comp} (world)" + ln -sf ccache ${PREFIX}/${CCLINKDIR}/world/${comp} + fi + else + if [ -L "${PREFIX}/${CCLINKDIR}/${comp}" ]; then + [ "$1" = "-v" ] && echo "remove symlink for ${comp}" + rm -f ${PREFIX}/${CCLINKDIR}/${comp} + fi + + if [ -L "${PREFIX}/${CCLINKDIR}/world/${comp}" ]; then + [ "$1" = "-v" ] && echo "remove symlink for ${comp} (world)" + rm -f ${PREFIX}/${CCLINKDIR}/world/${comp} + fi + fi +done diff --git a/devel/ccache4/files/ccache_clean.in b/devel/ccache4/files/ccache_clean.in new file mode 100755 index 000000000000..c68d621bba64 --- /dev/null +++ b/devel/ccache4/files/ccache_clean.in @@ -0,0 +1,71 @@ +#!/bin/sh +# +# Copyright (c) 2020 Rozhuk Ivan +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +if [ -r /etc/defaults/periodic.conf ]; then + . /etc/defaults/periodic.conf + source_periodic_confs +fi + + +case "${daily_ccache_clean_enable:-YES}" in +[Nn][Oo]) + ;; +*) + SYS_CCACHE_DIR=`make -V CCACHE_DIR` + if [ -z "${SYS_CCACHE_DIR}" ]; then + SYS_CCACHE_DIR='/var/cache/ccache' + fi + if [ -d "${SYS_CCACHE_DIR}" ]; then + echo "ccache dir: ${SYS_CCACHE_DIR}" + env CCACHE_DIR="${SYS_CCACHE_DIR}" \ + /usr/bin/nice -n 15 \ + %%PREFIX%%/bin/ccache --cleanup + fi + + _USERS_HOME_DIRS=`pw usershow -a | awk -F":" '{print $9}' | sort -u` + for _USER_HOME in ${_USERS_HOME_DIRS}; do + if [ -d "${_USER_HOME}/.ccache" ]; then + echo "ccache dir: ${_USER_HOME}/.ccache" + env CCACHE_DIR="${_USER_HOME}/.ccache" \ + /usr/bin/nice -n 15 \ + %%PREFIX%%/bin/ccache --cleanup + fi + if [ -d "${_USER_HOME}/.cache/ccache" ]; then + echo "ccache dir: ${_USER_HOME}/.cache/ccache" + env CCACHE_DIR="${_USER_HOME}/.cache/ccache" \ + CCACHE_CONFIGPATH="${_USER_HOME}/.config/ccache/ccache.conf" \ + /usr/bin/nice -n 15 \ + %%PREFIX%%/bin/ccache --cleanup + fi + done + ;; +esac + + +exit 0 diff --git a/devel/ccache4/files/pkg-message.in b/devel/ccache4/files/pkg-message.in new file mode 100644 index 000000000000..ce77e2104573 --- /dev/null +++ b/devel/ccache4/files/pkg-message.in @@ -0,0 +1,10 @@ +[ +{ type: install + message: <&2 && + exit 1 + +unset CCACHE_PATH +export CCACHE_COMPILERCHECK=content +exec %%PREFIX%%/%%CCLINKDIR%%/${0##*/} "$@" diff --git a/devel/ccache4/pkg-descr b/devel/ccache4/pkg-descr new file mode 100644 index 000000000000..a6b59b8988a8 --- /dev/null +++ b/devel/ccache4/pkg-descr @@ -0,0 +1,4 @@ +ccache is a compiler cache. It acts as a caching pre-processor to C/C++ +compilers, using the -E compiler switch and a hash to detect when a +compilation can be satisfied from cache. This often results in a 5 to 10 +times speedup in common compilations. diff --git a/devel/ccache4/pkg-plist b/devel/ccache4/pkg-plist new file mode 100644 index 000000000000..b4b4599bdacb --- /dev/null +++ b/devel/ccache4/pkg-plist @@ -0,0 +1,9 @@ +etc/periodic/daily/ccache_clean +bin/ccache +bin/ccache-update-links +%%PORTDOCS%%share/man/man1/ccache.1.gz +%%PORTDOCS%%%%DOCSDIR%%/LICENSE.html +%%CCLINKDIR%%/world/ccache +@postexec echo "Create compiler links..." +@postexec %D/bin/ccache-update-links -v +@preunexec find %D/%%CCLINKDIR%% -type l -exec rm -f {} \;