Skip to content

Commit

Permalink
Add a patch for memcached to ccache along with a slave devel/ccache-m…
Browse files Browse the repository at this point in the history
…emcached port.

This patch is not safe for WITH_CCACHE_BUILD support yet as that causes all
ports to depend on devel/ccache.  Enabling that patch would then cause the
new devel/libmemcached dependency to require devel/ccache which is a cyclic
dependency.  The autoconf dependency also causes issues.

Add a devel/ccache-memcached slave port that would allow a user to use
the ccache+memcached package manually with ports without WITH_CCACHE_BUILD.

This patch comes from ccache/ccache#58 and has been
an ongoing effort over a few years to be merged into the mainline of ccache.
Documenation for it can be found in the MANUAL file at:

  /usr/local/share/doc/ccache/MANUAL.txt

Sponsored by:	Dell EMC Isilon
  • Loading branch information
bdrewery committed Feb 17, 2017
1 parent af35831 commit b408ef5
Show file tree
Hide file tree
Showing 5 changed files with 2,447 additions and 2 deletions.
1 change: 1 addition & 0 deletions devel/Makefile
Expand Up @@ -234,6 +234,7 @@
SUBDIR += cbrowser
SUBDIR += cc65
SUBDIR += ccache
SUBDIR += ccache-memcached
SUBDIR += cccc
SUBDIR += ccdoc
SUBDIR += ccons
Expand Down
11 changes: 11 additions & 0 deletions devel/ccache-memcached/Makefile
@@ -0,0 +1,11 @@
# $FreeBSD$

PKGNAMESUFFIX= -memcached

MASTERDIR= ${.CURDIR}/../ccache

OPTIONS_SLAVE= MEMCACHED

CONFLICTS_INSTALL= ccache-[0-9]*

.include "${MASTERDIR}/Makefile"
22 changes: 20 additions & 2 deletions devel/ccache/Makefile
Expand Up @@ -13,26 +13,43 @@ COMMENT= Tool to minimize the compile time of C/C++ programs

LICENSE= GPLv3

CONFLICTS_INSTALL= ccache-memcached-[0-9]*

GNU_CONFIGURE= yes

HOWTO= ccache-howto-freebsd.txt
CCLINKDIR= libexec/ccache
SUB_FILES= ${HOWTO} world-ccache pkg-message ccache-update-links.sh

PORTDOCS= ccache-howto-freebsd.txt MANUAL.html
PORTDOCS= ccache-howto-freebsd.txt MANUAL.html MANUAL.txt

OPTIONS_DEFINE= CLANGLINK LLVMLINK STATIC DOCS TINDERBOX
OPTIONS_DEFINE= CLANGLINK LLVMLINK STATIC DOCS TINDERBOX MEMCACHED
OPTIONS_DEFAULT=CLANGLINK LLVMLINK

CLANGLINK_DESC= Create clang compiler links if clang is installed
LLVMLINK_DESC= Create llvm compiler links if llvm is installed
TINDERBOX_DESC= Create tarball for tinderbox usage
MEMCACHED_DESC= Build in experimental Memcached support

USES= compiler

MEMCACHED_EXTRA_PATCHES= ${FILESDIR}/extra-patch-memcached:-p1
MEMCACHED_CONFIGURE_ENABLE= memcached
MEMCACHED_USES= autoreconf pkgconfig
MEMCACHED_LIB_DEPENDS= libmemcached.so:databases/libmemcached
MEMCACHED_LDFLAGS= -L${LOCALBASE}/lib
MEMCACHED_CFLAGS= -I${LOCALBASE}/include

.if defined(WITH_CCACHE_BUILD) && empty(OPTIONS_SLAVE:MMEMCACHED)
# Don't allow autoreconf. We want no dependencies on this to keep
# WITH_CCACHE_BUILD working.
USES:= ${USES:Nautoreconf}

MEMCACHED_IGNORE= MEMCACHED cannot be combined with WITH_CCACHE_BUILD. Use devel/ccache-memcached
# XXX: This needs more testing with Poudriere before enabling. Also bsd.options.mk support.
#MEMCACHED_DEPENDS_ARGS+= NO_CCACHE=1
.endif

OPTIONS_SUB= yes

STATIC_LDFLAGS= -static
Expand Down Expand Up @@ -93,6 +110,7 @@ do-install-TINDERBOX-on:
do-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/MANUAL.html ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/MANUAL.txt ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKDIR}/${HOWTO} ${STAGEDIR}${DOCSDIR}

.include <bsd.port.post.mk>

0 comments on commit b408ef5

Please sign in to comment.