Package: libappimage / 0.1.9+dfsg-1

0001-Make-release-builds-reproducible-mk.-1.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From f73c293a493a7cc6f3fb7d1e713674abf563227c Mon Sep 17 00:00:00 2001
From: TheAssassin <theassassin@assassinate-you.net>
Date: Sun, 10 Feb 2019 04:00:11 +0100
Subject: [PATCH] Make release builds reproducible, mk. 1

---
 CMakeLists.txt | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 338f27b..616f2ae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.2)
+cmake_minimum_required(VERSION 3.4)
 
 project(libappimage)
 
@@ -7,6 +7,19 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
 
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
 
+# help produce reproducible builds
+if(CMAKE_BUILD_TYPE STREQUAL Release)
+    message(STATUS "Release build detected, enabling reproducible builds mode")
+    get_filename_component(abs_source_path ${PROJECT_SOURCE_DIR} ABSOLUTE)
+    file(RELATIVE_PATH rel_source_path ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR})
+
+    set(map_fix ${abs_source_path}=${rel_source_path})
+
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdebug-prefix-map=${map_fix} -fmacro-prefix-map=${map_fix}")
+    set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fdebug-prefix-map=${map_fix} -fmacro-prefix-map=${map_fix}")
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_C_FLAGS} -fdebug-prefix-map=${map_fix} -fmacro-prefix-map=${map_fix}")
+endif()
+
 # versioning
 set(V_MAJOR 0)
 set(V_MINOR 1)
-- 
2.20.1