ccache: Update to 4.1

This commit is contained in:
Alexey Pavlov
2021-01-12 15:08:05 +03:00
parent 9bcfd1fd3c
commit e587622fa7
2 changed files with 17 additions and 187 deletions

View File

@@ -2,48 +2,41 @@
# Contributor: Renato Silva <br.renatosilva@gmail.com>
pkgname=ccache
pkgver=3.7.11
pkgver=4.1
pkgrel=1
pkgdesc="A compiler cache (mingw-w64)"
arch=('i686' 'x86_64')
url="https://ccache.samba.org/"
license=("GPL3")
replaces=("${pkgname}-git")
makedepends=("gcc" "pkg-config" "zlib-devel")
makedepends=("gcc"
"cmake"
"pkg-config"
"zlib-devel")
depends=("gcc-libs" "zlib")
options=('staticlibs' 'strip')
install="${pkgname}.install"
source=(https://github.com/ccache/ccache/releases/download/v${pkgver}/ccache-${pkgver}.tar.xz{,.asc}
"ccache-3.4.2-msys.patch")
source=(https://github.com/ccache/ccache/releases/download/v${pkgver}/ccache-${pkgver}.tar.xz{,.asc})
validpgpkeys=("5A939A71A46792CF57866A51996DDA075594ADB8") #Joel Rosdahl <joel@rosdahl.net>
sha256sums=('8d450208099a4d202bd7df87caaec81baee20ce9dd62da91e9ea7b95a9072f68'
'SKIP'
'4880623ad5f4292964d7cd2e1f38afdc6979eb070312a9435a60afb144a8c60e')
prepare() {
cd ${pkgname}-${pkgver}
patch -p1 -i ${srcdir}/ccache-3.4.2-msys.patch
}
sha256sums=('5fdc804056632d722a1182e15386696f0ea6c59cb4ab4d65a54f0b269ae86f99'
'SKIP')
build() {
[[ -d build-${CHOST} ]] && rm -rf build-${CHOST}
mkdir -p build-${CHOST} && cd build-${CHOST}
../${pkgname}-${pkgver}/configure \
--prefix=/usr \
--build=${CHOST} \
--host=${CHOST} \
--target=${CHOST}
/usr/bin/cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
../${pkgname}-${pkgver}
make
}
check() {
cd "${srcdir}/build-${CHOST}"
make check
}
package() {
cd "${srcdir}/build-${CHOST}"
make DESTDIR="${pkgdir}" install
install -Dm644 ${srcdir}/${pkgname}-${pkgver}/GPL-3.0.txt ${pkgdir}/usr/share/licenses/${pkgname}/GPL-3.0.txt
install -Dm644 ${srcdir}/${pkgname}-${pkgver}/LGPL-3.0.txt ${pkgdir}/usr/share/licenses/${pkgname}/LGPL-3.0.txt
}

View File

@@ -1,163 +0,0 @@
diff --git a/test/run b/test/run
index 82a80541..6b907f3f 100755
--- a/test/run
+++ b/test/run
@@ -295,6 +295,7 @@ COMPILER_USES_MINGW=false
HOST_OS_LINUX=false
HOST_OS_FREEBSD=false
HOST_OS_WINDOWS=false
+HOST_OS_CYGWIN=false
compiler_version="`$COMPILER --version 2>&1 | head -1`"
case $compiler_version in
@@ -323,6 +324,9 @@ case $(uname -s) in
*MINGW*|*mingw*)
HOST_OS_WINDOWS=true
;;
+ *CYGWIN*|*MSYS*)
+ HOST_OS_CYGWIN=true
+ ;;
*Darwin*)
HOST_OS_APPLE=true
;;
diff --git a/test/suites/base.bash b/test/suites/base.bash
index 307100e8..07c005b4 100644
--- a/test/suites/base.bash
+++ b/test/suites/base.bash
@@ -822,6 +822,7 @@ EOF
expect_stat 'cache miss' 1
# -------------------------------------------------------------------------
+if ! $HOST_OS_WINDOWS && ! $HOST_OS_CYGWIN; then
TEST "Symlink to source directory"
mkdir dir
@@ -842,7 +843,9 @@ EOF
test_failed "Incorrect header file used"
fi
+fi
# -------------------------------------------------------------------------
+if ! $HOST_OS_WINDOWS && ! $HOST_OS_CYGWIN; then
TEST "Symlink to source file"
mkdir dir
@@ -863,6 +866,7 @@ EOF
test_failed "Incorrect header file used"
fi
+fi
# -------------------------------------------------------------------------
TEST ".incbin"
diff --git a/test/suites/basedir.bash b/test/suites/basedir.bash
index 4660dc29..fe1be8f7 100644
--- a/test/suites/basedir.bash
+++ b/test/suites/basedir.bash
@@ -4,7 +4,7 @@ SUITE_basedir_SETUP() {
mkdir -p dir1/src dir1/include
cat <<EOF >dir1/src/test.c
#include <stdarg.h>
-#include <test.h>
+#include "test.h"
EOF
cat <<EOF >dir1/include/test.h
int test;
@@ -45,6 +45,7 @@ SUITE_basedir() {
expect_stat 'cache miss' 2
# -------------------------------------------------------------------------
+ if ! $HOST_OS_WINDOWS && ! $HOST_OS_CYGWIN; then
TEST "Path normalization"
cd dir1
@@ -64,6 +65,7 @@ SUITE_basedir() {
expect_stat 'cache hit (preprocessed)' 0
expect_stat 'cache miss' 1
+ fi
# -------------------------------------------------------------------------
TEST "Rewriting in stderr"
diff --git a/test/suites/debug_prefix_map.bash b/test/suites/debug_prefix_map.bash
index 25cc36ff..98067cb3 100644
--- a/test/suites/debug_prefix_map.bash
+++ b/test/suites/debug_prefix_map.bash
@@ -25,6 +24,8 @@ EOF
xcrun dwarfdump -r0 $1
elif $HOST_OS_FREEBSD; then
objdump -W $1
+ elif $HOST_OS_WINDOWS || $HOST_OS_CYGWIN; then
+ strings $1 # for some reason objdump only shows the basename of the file, so fall back to brute force and ignorance
else
objdump -g $1
fi
@@ -33,6 +35,8 @@ objdump_cmd() {
grep_cmd() {
if $HOST_OS_APPLE; then
grep "( \"$1\" )"
+ elif $HOST_OS_WINDOWS || $HOST_OS_CYGWIN; then
+ test -n "$2" && grep -E "$1|$2" || grep "$1" # accept a relative path for source code, in addition to relocation dir
else
grep ": $1[[:space:]]*$"
fi
@@ -51,6 +55,9 @@ SUITE_debug_prefix_map() {
if objdump_cmd test.o | grep_cmd "`pwd`" >/dev/null 2>&1; then
test_failed "Source dir (`pwd`) found in test.o"
fi
+ if ! objdump_cmd test.o | grep_cmd "dir" src/test.c >/dev/null 2>&1; then
+ test_failed "Relocation (dir) not found in test.o"
+ fi
cd ../dir2
CCACHE_BASEDIR=`pwd` $CCACHE_COMPILE -I`pwd`/include -g -fdebug-prefix-map=`pwd`=dir -c `pwd`/src/test.c -o `pwd`/test.o
@@ -74,7 +81,7 @@ SUITE_debug_prefix_map() {
if objdump_cmd test.o | grep_cmd "`pwd`" >/dev/null 2>&1; then
test_failed "Source dir (`pwd`) found in test.o"
fi
- if ! objdump_cmd test.o | grep_cmd "name" >/dev/null 2>&1; then
+ if ! objdump_cmd test.o | grep_cmd "name" src/test.c >/dev/null 2>&1; then
test_failed "Relocation (name) not found in test.o"
fi
diff --git a/test/suites/masquerading.bash b/test/suites/masquerading.bash
index 0b42eef3..3e254dc2 100644
--- a/test/suites/masquerading.bash
+++ b/test/suites/masquerading.bash
@@ -4,6 +4,10 @@ SUITE_masquerading_PROBE() {
if [ "$(dirname $compiler_binary)" != . ]; then
echo "compiler ($compiler_binary) not taken from PATH"
fi
+ if $HOST_OS_WINDOWS || $HOST_OS_CYGWIN; then
+ echo "symlinks not supported on $(uname -s)"
+ return
+ fi
}
SUITE_masquerading_SETUP() {
diff --git a/test/suites/upgrade.bash b/test/suites/upgrade.bash
index 202dcd2d..81fd1336 100644
--- a/test/suites/upgrade.bash
+++ b/test/suites/upgrade.bash
@@ -1,7 +1,7 @@
SUITE_upgrade() {
TEST "Keep maxfiles and maxsize settings"
- rm $CCACHE_CONFIGPATH
+ rm -f $CCACHE_CONFIGPATH
mkdir -p $CCACHE_DIR/0
echo "0 0 0 0 0 0 0 0 0 0 0 0 0 2000 131072" >$CCACHE_DIR/0/stats
expect_stat 'max files' 32000
diff --git a/unittest/test_lockfile.c b/unittest/test_lockfile.c
index 98811c68..5c566091 100644
--- a/unittest/test_lockfile.c
+++ b/unittest/test_lockfile.c
@@ -26,7 +26,7 @@ TEST(acquire_should_create_symlink)
{
CHECK(lockfile_acquire("test", 1000));
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__CYGWIN__)
CHECK(path_exists("test.lock"));
#else
CHECK(is_symlink("test.lock"));