View | Details | Raw Unified | Return to bug 234971 | Differences between
and this patch

Collapse All | Expand All

(-)b/Mk/bsd.ccache.mk (-1 / +1 lines)
Lines 83-89 CFLAGS+= -fdebug-prefix-map=${WRKSRC}=. Link Here
83
# Avoid depends loops between ccache and pkg
83
# Avoid depends loops between ccache and pkg
84
.    if !defined(NO_CCACHE_DEPEND) && \
84
.    if !defined(NO_CCACHE_DEPEND) && \
85
    ${PKGORIGIN} != ${PKG_ORIGIN}
85
    ${PKGORIGIN} != ${PKG_ORIGIN}
86
BUILD_DEPENDS+=		${CCACHE_BIN}:devel/ccache
86
BUILD_DEPENDS+=		${CCACHE_BIN}:devel/${CCACHE_DEFAULT}
87
.    endif
87
.    endif
88
88
89
.    if exists(${CCACHE_WRAPPER_PATH})
89
.    if exists(${CCACHE_WRAPPER_PATH})
(-)b/devel/Makefile (+1 lines)
Lines 339-344 Link Here
339
    SUBDIR += ccache-memcached
339
    SUBDIR += ccache-memcached
340
    SUBDIR += ccache-memcached-static
340
    SUBDIR += ccache-memcached-static
341
    SUBDIR += ccache-static
341
    SUBDIR += ccache-static
342
    SUBDIR += ccache4
342
    SUBDIR += cccc
343
    SUBDIR += cccc
343
    SUBDIR += ccdoc
344
    SUBDIR += ccdoc
344
    SUBDIR += ccls
345
    SUBDIR += ccls
(-)b/devel/ccache/Makefile (-1 / +1 lines)
Lines 12-18 WWW= https://ccache.samba.org/ Link Here
12
LICENSE=	GPLv3+
12
LICENSE=	GPLv3+
13
LICENSE_FILE=	${WRKSRC}/GPL-3.0.txt
13
LICENSE_FILE=	${WRKSRC}/GPL-3.0.txt
14
14
15
CONFLICTS_INSTALL?=	ccache-static ccache-memcached ccache-memcached-static
15
CONFLICTS_INSTALL?=	ccache-static ccache-memcached ccache-memcached-static ccache4
16
16
17
GNU_CONFIGURE=	yes
17
GNU_CONFIGURE=	yes
18
18
(-)b/devel/ccache4/Makefile (+101 lines)
Added Link Here
1
# Created by: Dominic Marks <d.marks@student.umist.ac.uk>
2
3
PORTNAME=	ccache
4
PORTVERSION=	4.8
5
DISTVERSIONPREFIX=	v
6
CATEGORIES=	devel
7
8
MAINTAINER=	bdrewery@FreeBSD.org
9
COMMENT=	Tool to minimize the compile time of C/C++ programs
10
11
LICENSE=	GPLv3+
12
LICENSE_FILE=	${WRKSRC}/GPL-3.0.txt
13
14
USES=		cmake:noninja pathfix shebangfix compiler:c++11-lang
15
CONFLICTS_INSTALL?=	ccache ccache-static \
16
		ccache-memcached ccache-memcached-static
17
18
PORTDOCS=	AUTHORS.adoc AUTHORS.html MANUAL.html MANUAL.adoc \
19
		NEWS.adoc NEWS.html
20
21
USE_GITHUB=	yes
22
SUB_FILES=	world-ccache ccache-update-links.sh ccache_clean
23
# Prevent infinite recursion.
24
NO_CCACHE_DEPEND=	yes
25
26
LIB_DEPENDS+=	libzstd.so:archivers/zstd
27
28
# /bin/bash -> /bin/sh to reduce tests dep.
29
SHEBANG_FILES=	test/*
30
SHEBANG_GLOB=	*.sh *.bash
31
bash_CMD=	/bin/sh
32
33
CMAKE_OFF=	WARNINGS_AS_ERRORS \
34
		ENABLE_IPO \
35
		ZSTD_FROM_INTERNET \
36
		ENABLE_TRACING \
37
		REDIS_STORAGE_BACKEND \
38
		STATIC_LINK
39
40
OPTIONS_DEFINE=	DOCS CLANGLINK LLVMLINK STATIC TEST
41
OPTIONS_DEFAULT=CLANGLINK LLVMLINK
42
OPTIONS_SUB=	yes
43
44
DOCS_BUILD_DEPENDS=	asciidoctor:textproc/rubygem-asciidoctor
45
DOCS_ALL_TARGET=	all doc
46
DOCS_USES=		perl5
47
DOCS_CMAKE_BOOL=	ENABLE_DOCUMENTATION
48
49
CLANGLINK_DESC=	Create clang compiler links if clang is installed
50
LLVMLINK_DESC=	Create llvm compiler links if llvm is installed
51
52
STATIC_LDFLAGS=	-static
53
54
TEST_CMAKE_BOOL=ENABLE_TESTING
55
TEST_TARGET=	check
56
57
.include <bsd.port.pre.mk>
58
59
CCLINKDIR=		libexec/ccache
60
PLIST_SUB+=		CCLINKDIR="${CCLINKDIR}"
61
62
.if ${ARCH}=="i386"
63
CCACHE_COMPILERS+=	icc icpc
64
.endif
65
66
GNU_COMPILERS+=		48 8 9 10 11 12
67
CCACHE_COMPILERS+=	cc c++ CC gcc g++ ${GNU_COMPILERS:S|^|gcc|} \
68
			${GNU_COMPILERS:S|^|g++|} \
69
			${GNU_COMPILERS:S|^|cpp|}
70
71
.if ${PORT_OPTIONS:MCLANGLINK}
72
CLANG_COMPILERS+=	10 11 12 13 14 15 16 -devel
73
CCACHE_COMPILERS+=	clang clang++ ${CLANG_COMPILERS:S|^|clang|} \
74
			${CLANG_COMPILERS:S|^|clang++|} \
75
			${CLANG_COMPILERS:S|^|cpp|}
76
.endif
77
78
.if ${PORT_OPTIONS:MLLVMLINK}
79
CCACHE_COMPILERS+=	llvm-gcc llvm-c++ llvm-g++
80
.endif
81
82
CCACHE_COMPILERS+=	${EXTRA_COMPILERS}
83
SUB_LIST+=		CCACHE_COMPILERS="${CCACHE_COMPILERS}" \
84
			CCLINKDIR="${CCLINKDIR}"
85
86
post-install:
87
	${MKDIR} ${STAGEDIR}${PREFIX}/${CCLINKDIR}/world
88
	${INSTALL_SCRIPT} ${WRKDIR}/world-ccache \
89
		${STAGEDIR}${PREFIX}/${CCLINKDIR}/world/ccache
90
	${INSTALL_SCRIPT} ${WRKDIR}/ccache-update-links.sh \
91
		${STAGEDIR}${PREFIX}/bin/ccache-update-links
92
	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/periodic/daily
93
	${INSTALL_SCRIPT} ${WRKDIR}/ccache_clean \
94
		${STAGEDIR}${PREFIX}/etc/periodic/daily
95
96
post-install-DOCS-on:
97
	${MKDIR} ${STAGEDIR}${DOCSDIR}
98
	${INSTALL_DATA} ${BUILD_WRKSRC}/doc/*.html ${STAGEDIR}${DOCSDIR}
99
	${INSTALL_DATA} ${WRKSRC}/doc/*.adoc ${STAGEDIR}${DOCSDIR}
100
101
.include <bsd.port.post.mk>
(-)b/devel/ccache4/distinfo (+3 lines)
Added Link Here
1
TIMESTAMP = 1678706114
2
SHA256 (ccache-ccache-v4.8_GH0.tar.gz) = 47c9ff1668c9c6892b34642f9f09027f4a41e719dad1062f82265ff0087299ce
3
SIZE (ccache-ccache-v4.8_GH0.tar.gz) = 767312
(-)b/devel/ccache4/files/ccache-update-links.sh.in (+72 lines)
Added Link Here
1
#!/bin/sh
2
#
3
# Author: Emanuel Haupt <ehaupt@FreeBSD.org>
4
#
5
# $FreeBSD: head/devel/ccache/files/ccache-update-links.sh.in 435560 2017-03-06 17:50:14Z bdrewery $
6
#
7
8
CCACHE_COMPILERS="%%CCACHE_COMPILERS%% ${EXTRA_COMPILERS}"
9
CCLINKDIR="%%CCLINKDIR%%"
10
PREFIX="%%PREFIX%%"
11
12
usage() {
13
	cat << "EOUSAGE"
14
Usage: ccache-update-links [hv]
15
16
ccache-update-links maintains symlinks needed by ccache to work with additional
17
compilers.
18
19
    -h, --help   this help
20
    -v           verbose
21
22
EOUSAGE
23
}
24
25
case "$1"
26
in
27
	-h|--help)
28
	usage
29
	;;
30
esac
31
32
strip_path() {
33
	local IFS=":"
34
	local path
35
	set -- ${PATH}
36
	while [ $# -gt 0 ]; do
37
		if ! [ "${1}" = "${PREFIX}/libexec/ccache" ]; then
38
			path="${path}${path:+:}${1}"
39
		fi
40
		shift
41
	done
42
	echo "${path}"
43
}
44
45
# Remove ccache wrappers from PATH
46
PATH=$(strip_path)
47
48
# create compiler links
49
for comp in ${CCACHE_COMPILERS}
50
do
51
	if command -v "${comp}" >/dev/null; then
52
		if [ ! -L "${PREFIX}/${CCLINKDIR}/${comp}" ]; then
53
			[ "$1" = "-v" ] && echo "create symlink for ${comp}"
54
        		ln -sf ${PREFIX}/bin/ccache ${PREFIX}/${CCLINKDIR}/${comp}
55
		fi
56
57
		if [ ! -L "${PREFIX}/${CCLINKDIR}/world/${comp}" ]; then
58
			[ "$1" = "-v" ] && echo "create symlink for ${comp} (world)"
59
        		ln -sf ccache ${PREFIX}/${CCLINKDIR}/world/${comp}
60
		fi
61
	else
62
		if [ -L "${PREFIX}/${CCLINKDIR}/${comp}" ]; then
63
			[ "$1" = "-v" ] && echo "remove symlink for ${comp}"
64
			rm -f ${PREFIX}/${CCLINKDIR}/${comp}
65
		fi
66
67
		if [ -L "${PREFIX}/${CCLINKDIR}/world/${comp}" ]; then
68
			[ "$1" = "-v" ] && echo "remove symlink for ${comp} (world)"
69
			rm -f ${PREFIX}/${CCLINKDIR}/world/${comp}
70
		fi
71
	fi
72
done
(-)b/devel/ccache4/files/ccache_clean.in (+71 lines)
Added Link Here
1
#!/bin/sh
2
#
3
# Copyright (c) 2020 Rozhuk Ivan <rozhuk.im@gmail.com>
4
# All rights reserved.
5
#
6
# Redistribution and use in source and binary forms, with or without
7
# modification, are permitted provided that the following conditions
8
# are met:
9
# 1. Redistributions of source code must retain the above copyright
10
#    notice, this list of conditions and the following disclaimer.
11
# 2. Redistributions in binary form must reproduce the above copyright
12
#    notice, this list of conditions and the following disclaimer in the
13
#    documentation and/or other materials provided with the distribution.
14
#
15
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25
# SUCH DAMAGE.
26
#
27
# $FreeBSD$
28
#
29
30
if [ -r /etc/defaults/periodic.conf ]; then
31
	. /etc/defaults/periodic.conf
32
	source_periodic_confs
33
fi
34
35
36
case "${daily_ccache_clean_enable:-YES}" in
37
[Nn][Oo])
38
	;;
39
*)
40
	SYS_CCACHE_DIR=`make -V CCACHE_DIR`
41
	if [ -z "${SYS_CCACHE_DIR}" ]; then
42
		SYS_CCACHE_DIR='/var/cache/ccache'
43
	fi
44
	if [ -d "${SYS_CCACHE_DIR}" ]; then
45
		echo "ccache dir: ${SYS_CCACHE_DIR}"
46
		env CCACHE_DIR="${SYS_CCACHE_DIR}" \
47
			/usr/bin/nice -n 15 \
48
				%%PREFIX%%/bin/ccache --cleanup
49
	fi
50
51
	_USERS_HOME_DIRS=`pw usershow -a | awk -F":" '{print $9}' | sort -u`
52
	for _USER_HOME in ${_USERS_HOME_DIRS}; do
53
		if [ -d "${_USER_HOME}/.ccache" ]; then
54
			echo "ccache dir: ${_USER_HOME}/.ccache"
55
			env CCACHE_DIR="${_USER_HOME}/.ccache" \
56
				/usr/bin/nice -n 15 \
57
					%%PREFIX%%/bin/ccache --cleanup
58
		fi
59
		if [ -d "${_USER_HOME}/.cache/ccache" ]; then
60
			echo "ccache dir: ${_USER_HOME}/.cache/ccache"
61
			env CCACHE_DIR="${_USER_HOME}/.cache/ccache" \
62
			    CCACHE_CONFIGPATH="${_USER_HOME}/.config/ccache/ccache.conf" \
63
				/usr/bin/nice -n 15 \
64
					%%PREFIX%%/bin/ccache --cleanup
65
		fi
66
	done
67
	;;
68
esac
69
70
71
exit 0
(-)b/devel/ccache4/files/pkg-message.in (+10 lines)
Added Link Here
1
[
2
{ type: install
3
  message: <<EOM
4
This version of ccache has large nubmer of dependencies and will cause
5
warnings and errors due to dependency loops when used with ports and poudriere.
6
The easiest way to workaround them is to temporary disable ccache builds until
7
all ccache dependencies are built.
8
EOM
9
}
10
]
(-)b/devel/ccache4/files/world-ccache.in (+9 lines)
Added Link Here
1
#!/bin/sh
2
3
[ "${0##*/}" = "ccache" ] &&
4
    printf "Please, use one of the compiler links in\n%%PREFIX%%/%%CCLINKDIR%%/world\nto invoke ccache\n" >&2 &&
5
    exit 1
6
7
unset CCACHE_PATH
8
export CCACHE_COMPILERCHECK=content
9
exec %%PREFIX%%/%%CCLINKDIR%%/${0##*/} "$@"
(-)b/devel/ccache4/pkg-descr (+6 lines)
Added Link Here
1
ccache is a compiler cache.  It acts as a caching pre-processor to C/C++
2
compilers, using the -E compiler switch and a hash to detect when a
3
compilation can be satisfied from cache.  This often results in a 5 to 10
4
times speedup in common compilations.
5
6
WWW: https://ccache.dev/
(-)b/devel/ccache4/pkg-plist (-1 / +9 lines)
Added Link Here
0
- 
1
etc/periodic/daily/ccache_clean
2
bin/ccache
3
bin/ccache-update-links
4
%%PORTDOCS%%share/man/man1/ccache.1.gz
5
%%PORTDOCS%%%%DOCSDIR%%/LICENSE.html
6
%%CCLINKDIR%%/world/ccache
7
@postexec echo "Create compiler links..."
8
@postexec %D/bin/ccache-update-links -v
9
@preunexec find %D/%%CCLINKDIR%% -type l -exec rm -f {} \;

Return to bug 234971