summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2019-08-10 22:17:42 +0200
committerDavid Seifert <soap@gentoo.org>2019-08-10 22:17:42 +0200
commit35347b119f54654434e1d2f2fec9c07327b3e6e2 (patch)
treeb5a9f2e66bc63292dd35b9d1cd88d68f08ff3cf3 /app-crypt/libnitrokey/files
parentmedia-libs/opencv: Fix py3.7 build (diff)
downloadgentoo-35347b119f54654434e1d2f2fec9c07327b3e6e2.tar.gz
gentoo-35347b119f54654434e1d2f2fec9c07327b3e6e2.tar.bz2
gentoo-35347b119f54654434e1d2f2fec9c07327b3e6e2.zip
app-crypt/libnitrokey: Fix tests when git is not installed
Closes: https://bugs.gentoo.org/689614 Package-Manager: Portage-2.3.71, Repoman-2.3.17 Signed-off-by: David Seifert <soap@gentoo.org>
Diffstat (limited to 'app-crypt/libnitrokey/files')
-rw-r--r--app-crypt/libnitrokey/files/libnitrokey-3.5-tests-version-gitless.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/app-crypt/libnitrokey/files/libnitrokey-3.5-tests-version-gitless.patch b/app-crypt/libnitrokey/files/libnitrokey-3.5-tests-version-gitless.patch
new file mode 100644
index 000000000000..99fc5af03787
--- /dev/null
+++ b/app-crypt/libnitrokey/files/libnitrokey-3.5-tests-version-gitless.patch
@@ -0,0 +1,18 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -129,7 +129,14 @@
+ ERROR_QUIET
+ )
+ ENDIF()
+-IF((NOT ${ADD_GIT_INFO}) OR (${PROJECT_VERSION_GIT_RETURN_CODE}))
++# the version.h generation logic is tricky in a number of ways:
++# 1. git describe on a release tarball will always fail with
++# a non-zero return code, usually 128
++# 2. If git is not installed, PROJECT_VERSION_GIT_RETURN_CODE
++# will contain the string 'No such file or directory'
++# Hence fallback to PROJECT_VERSION when the return code is NOT 0.
++IF((NOT ${ADD_GIT_INFO}) OR (NOT ${PROJECT_VERSION_GIT_RETURN_CODE} STREQUAL "0"))
++ MESSAGE(STATUS "Setting fallback Git library version")
+ SET(PROJECT_VERSION_GIT "v${PROJECT_VERSION}")
+ ENDIF()
+ MESSAGE(STATUS "Setting Git library version to: " ${PROJECT_VERSION_GIT} )