Package: liblcms2-dev
Version: 2.6-3
Severity: wishlist
Tag: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps toolchain

Hi!

liblcms will currently always use the current time to set the creation
time in profile headers. In the context of the “Reproducible Builds”
effort [1], this will prevent colord from building its profiles
bit-for-bit identical, despite having the exact same source.

The attached patch adds cmsSetHeaderCreationDateTime() to allow clients
to set an explicit creation date/time for a profile.

 [1]: https://wiki.debian.org/ReproducibleBuilds

-- 
Lunar                                .''`. 
lu...@debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
diff -Nru lcms2-2.6/debian/patches/add_set_header_creation_date_time.patch lcms2-2.6/debian/patches/add_set_header_creation_date_time.patch
--- lcms2-2.6/debian/patches/add_set_header_creation_date_time.patch	1970-01-01 01:00:00.000000000 +0100
+++ lcms2-2.6/debian/patches/add_set_header_creation_date_time.patch	2016-02-16 09:35:33.000000000 +0100
@@ -0,0 +1,51 @@
+Description: add cmsSetHeaderCreationDateTime
+ Clients might want to set an explicit value for the creation date/time
+ of a profile, e.g. to match the creation date/time of a description
+ file.
+Author: Jérémy Bobbio <lu...@debian.org>
+
+--- lcms2-2.6.orig/include/lcms2.h
++++ lcms2-2.6/include/lcms2.h
+@@ -1446,6 +1446,7 @@ CMSAPI cmsUInt32Number   CMSEXPORT cmsGe
+ CMSAPI void              CMSEXPORT cmsSetHeaderModel(cmsHPROFILE hProfile, cmsUInt32Number model);
+ CMSAPI void              CMSEXPORT cmsSetHeaderAttributes(cmsHPROFILE hProfile, cmsUInt64Number Flags);
+ CMSAPI void              CMSEXPORT cmsSetHeaderProfileID(cmsHPROFILE hProfile, cmsUInt8Number* ProfileID);
++CMSAPI void              CMSEXPORT cmsSetHeaderCreationDateTime(cmsHPROFILE hProfile, const struct tm *DateTime);
+ CMSAPI void              CMSEXPORT cmsSetHeaderRenderingIntent(cmsHPROFILE hProfile, cmsUInt32Number RenderingIntent);
+ 
+ CMSAPI cmsColorSpaceSignature
+--- lcms2-2.6.orig/src/cmsio0.c
++++ lcms2-2.6/src/cmsio0.c
+@@ -908,6 +908,12 @@ cmsBool  CMSEXPORT cmsGetHeaderCreationD
+     return TRUE;
+ }
+ 
++void CMSEXPORT cmsSetHeaderCreationDateTime(cmsHPROFILE hProfile, const struct tm *DateTime)
++{
++    _cmsICCPROFILE*  Icc = (_cmsICCPROFILE*) hProfile;
++    memmove(&Icc ->Created, DateTime, sizeof(struct tm));
++}
++
+ cmsColorSpaceSignature CMSEXPORT cmsGetPCS(cmsHPROFILE hProfile)
+ {
+     _cmsICCPROFILE*  Icc = (_cmsICCPROFILE*) hProfile;
+--- lcms2-2.6.orig/src/lcms2.def
++++ lcms2-2.6/src/lcms2.def
+@@ -272,6 +272,7 @@ cmsSetHeaderFlags
+ cmsSetHeaderManufacturer                 =    cmsSetHeaderManufacturer
+ cmsSetHeaderModel                        =    cmsSetHeaderModel
+ cmsSetHeaderProfileID                    =    cmsSetHeaderProfileID
++cmsSetHeaderCreationDateTime             =    cmsSetHeaderCreationDateTime
+ cmsSetHeaderRenderingIntent              =    cmsSetHeaderRenderingIntent
+ cmsSetLogErrorHandler                    =    cmsSetLogErrorHandler
+ cmsSetPCS                                =    cmsSetPCS
+--- lcms2-2.6.orig/utils/delphi/lcms2dll.pas
++++ lcms2-2.6/utils/delphi/lcms2dll.pas
+@@ -1251,6 +1251,7 @@ PROCEDURE cmsGetHeaderProfileID(hProfile
+ 
+ // TODO:
+ // FUNCTION  cmsGetHeaderCreationDateTime(hProfile: cmsHPROFILE; struct tm *Dest): cmsBool; StdCall;
++// PROCEDURE cmsSetHeaderCreationDate(hProfile: cmsHPROFILE; const struct tm *DateTime); StdCall;
+ 
+ FUNCTION  cmsGetHeaderRenderingIntent(hProfile: cmsHPROFILE): cmsUInt32Number; StdCall;
+ PROCEDURE cmsSetHeaderFlags(hProfile: cmsHPROFILE; Flags: cmsUInt32Number); StdCall;
diff -Nru lcms2-2.6/debian/patches/series lcms2-2.6/debian/patches/series
--- lcms2-2.6/debian/patches/series	2014-06-16 17:15:31.000000000 +0200
+++ lcms2-2.6/debian/patches/series	2016-02-16 09:30:45.000000000 +0100
@@ -4,3 +4,4 @@
 sanity-check-profiles-CVE-2014-0459.patch
 fix-unaligned-access.patch
 endianness-verification-fix-powerpc.patch
+add_set_header_creation_date_time.patch
diff -Nru lcms2-2.6/debian/liblcms2-2.symbols lcms2-2.6/debian/liblcms2-2.symbols
--- lcms2-2.6/debian/liblcms2-2.symbols	2014-06-16 17:15:31.000000000 +0200
+++ lcms2-2.6/debian/liblcms2-2.symbols	2016-02-16 09:23:06.000000000 +0100
@@ -389,6 +389,7 @@
  cmsSetDeviceClass@Base 2.2+git20110628
  cmsSetEncodedICCversion@Base 2.2+git20110628
  cmsSetHeaderAttributes@Base 2.2+git20110628
+ cmsSetHeaderCreationDateTime@Base 2.6-3.0~reproducible1
  cmsSetHeaderFlags@Base 2.2+git20110628
  cmsSetHeaderManufacturer@Base 2.2+git20110628
  cmsSetHeaderModel@Base 2.2+git20110628

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to