Package: gkl / 0.8.10+dfsg-3

dont_run_cmakeBuild_twice.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Description: the CMake build task should be run only once.
 Yet it would be called twice when we run the build and then the tests. We add
 a check to prevent such situation.
Author: Pierre Gruet <pgt@debian.org>
Forwarded: not-needed
Last-Update: 2021-12-24

--- a/build.gradle
+++ b/build.gradle
@@ -45,12 +45,13 @@
 }
 
 task cmakeBuild(type: Exec) {
+    def soCompression = file("$nativeBuildDir/libgkl_compression.so")
     // hide stdout, but print stderr
     standardOutput = new ByteArrayOutputStream()
     workingDir nativeBuildDir
-    commandLine 'make', 'install'
-    // always run this task
-    outputs.upToDateWhen {false}
+    //Run only if we never executed copyNativeLib.
+    if (!soCompression.exists()) commandLine 'make', 'install'
+    else commandLine 'true'
 }
 
 task copyNativeLib(type: Copy) {