File: oggenc-reproducibly.patch

package info (click to toggle)
colobot 0.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 416,412 kB
  • sloc: cpp: 144,638; ansic: 3,063; python: 2,119; sh: 682; awk: 91; xml: 32; makefile: 31
file content (23 lines) | stat: -rw-r--r-- 1,315 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Description: pass the original flac file's bytesize as serial integer to oggenc
 to avoid picking unreproducibilty from current time and process id
Author: Didier Raboud <odyx@debian.org>
Thanks-To: Chris Lamb <lamby@debian.org>
Thanks-To: Clint Adams <clint@debian.org>
Bug-Debian: https://bugs.debian.org/846976
Last-Update: 2016-12-05

--- a/data/music/CMakeLists.txt
+++ b/data/music/CMakeLists.txt
@@ -84,9 +84,11 @@
                 install(FILES ${DOWNLOAD_FILE_LOC} DESTINATION ${COLOBOT_INSTALL_MUSIC_DIR})
             else()
                 message(STATUS "Adding OGG convert target for ${FILE}")
+                find_program(STAT stat)
+                execute_process(COMMAND ${STAT} --printf="%s" "${DOWNLOAD_FILE_LOC}" OUTPUT_VARIABLE FILENAME_INT)
                 add_custom_command(
                     OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FILENAME}.ogg"
-                    COMMAND ${OGGENC} -q ${MUSIC_QUALITY} -o "${FILENAME}.ogg" "${DOWNLOAD_FILE_LOC}"
+                    COMMAND ${OGGENC} --serial ${FILENAME_INT} -q ${MUSIC_QUALITY} -o "${FILENAME}.ogg" "${DOWNLOAD_FILE_LOC}"
                     DEPENDS download-${FILENAME} "${DOWNLOAD_FILE_LOC}"
                 )
                 add_custom_target(generate-${FILENAME} ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${FILENAME}.ogg")