Dominique Leuenberger 2018-08-07 08:49:24 +00:00 committed by Git OBS Bridge
commit c134f94233
6 changed files with 194 additions and 6 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:15cabf350fddf7b231c52ba6dcf3ae607ed2b71f87c8f231a5b345406e289bfa
size 43916570

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8d9737722d06501228af2c9f3b25bf40bc54bf7411503b93761f0b87a76750fc
size 30215008

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Aug 1 03:37:01 UTC 2018 - bwiedemann@suse.com
- Add reproducible.patch to override font build dates (boo#1047218)
- repack sources to .xz since we have to repack already
-------------------------------------------------------------------
Mon Dec 18 10:41:08 UTC 2017 - pgajdos@suse.com

View File

@ -24,12 +24,14 @@ License: GPL-3.0+
Group: Productivity/Graphics/Vector Editors
Url: http://fontforge.org/
# Source: https://github.com/fontforge/fontforge/archive/%{version}.tar.gz
# see bug 926061, fontforge-*-repacked.tar.gz does not contain fontforge-*/win/gold/libX11-*.noarch.rpm
Source0: fontforge-%{version}-repacked.tar.gz
# see bug 926061, fontforge-*-repacked.tar.xz does not contain fontforge-*/win/gold/libX11-*.noarch.rpm
Source0: fontforge-%{version}-repacked.tar.xz
Source1: get-source.sh
# workardound for bug 930076, imho upstream should fix this
# https://github.com/fontforge/fontforge/issues/2270
Patch0: fontforge-version.patch
# PATCH-FIX-UPSTREAM bmwiedemann https://github.com/fontforge/fontforge/pull/3152
Patch1: reproducible.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: cairo-devel
@ -96,6 +98,7 @@ to develop applications that use FontForge libraries.
%prep
%setup -q
%patch0
%patch1 -p1
sed -i 's/\r$//' doc/html/{Big5.txt,corpchar.txt}
# workaround for bug 930076; we just need the _version_of_the_release_! (see also fontforge-version.patch) ---
grep 'doversion(FONTFORGE_MODTIME_STR)' fontforgeexe/startnoui.c && \

View File

@ -17,11 +17,12 @@ tar xf $VERSION.tar.gz
pushd fontforge-$VERSION
# do not depend on git
git clone https://github.com/troydhanson/uthash
git clone --depth 1 https://github.com/coreutils/gnulib.git gnulib
# remove not shippable files (bug 926061)
rm win/gold/libX11-*.noarch.rpm
./bootstrap --copy --force
popd
tar czf fontforge-$VERSION-repacked.tar.gz fontforge-$VERSION
tar cJf fontforge-$VERSION-repacked.tar.xz fontforge-$VERSION
rm -rf fontforge-$VERSION
rm $VERSION.tar.gz

178
reproducible.patch Normal file
View File

@ -0,0 +1,178 @@
From 4e850c134200d5a62bdecdd68a4ee31ef7688360 Mon Sep 17 00:00:00 2001
From: Gioele Barabucci <gioele@svario.it>
Date: Sat, 2 Sep 2017 12:08:06 +0200
Subject: [PATCH 1/3] Add GetTime function: override time(2) in case
SOURCE_DATE_EPOCH is set
---
fontforge/splinefont.c | 6 ++----
gutils/gutils.c | 10 ++++++++++
inc/gutils.h | 3 +++
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/fontforge/splinefont.c b/fontforge/splinefont.c
index 4cd7d6a7b..92c8ef1c5 100644
--- a/fontforge/splinefont.c
+++ b/fontforge/splinefont.c
@@ -55,7 +55,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <gfile.h>
-#include <time.h>
+#include <gutils.h>
#include "unicoderange.h"
#include "psfont.h"
#include <locale.h>
@@ -604,9 +604,7 @@ return( true );
}
void SFSetModTime(SplineFont *sf) {
- time_t now;
- time(&now);
- sf->modificationtime = now;
+ sf->modificationtime = GetTime();
}
static SplineFont *_SFReadPostScript(FILE *file,char *filename) {
diff --git a/gutils/gutils.c b/gutils/gutils.c
index bc945e8b9..72334fc2f 100644
--- a/gutils/gutils.c
+++ b/gutils/gutils.c
@@ -89,3 +89,13 @@ return( ret );
#endif
}
+time_t GetTime(void) {
+ time_t now;
+ if (getenv("SOURCE_DATE_EPOCH")) {
+ now = atol(getenv("SOURCE_DATE_EPOCH"));
+ } else {
+ now = time(NULL);
+ }
+
+ return now;
+}
diff --git a/inc/gutils.h b/inc/gutils.h
index 90b087641..112de734f 100644
--- a/inc/gutils.h
+++ b/inc/gutils.h
@@ -27,8 +27,11 @@
#ifndef _GUTILS_H
#define _GUTILS_H
+#include <time.h>
+
extern int16 div_tables[257][2];
extern const char *GetAuthor(void);
+extern time_t GetTime(void);
#endif
From 24aeddf65139ee50753537070e51b08c80346423 Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Date: Mon, 18 Sep 2017 14:23:26 +0200
Subject: [PATCH 2/3] Improve GetTime function
to only call getenv once
---
gutils/gutils.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gutils/gutils.c b/gutils/gutils.c
index 72334fc2f..de2c3e207 100644
--- a/gutils/gutils.c
+++ b/gutils/gutils.c
@@ -91,8 +91,9 @@ return( ret );
time_t GetTime(void) {
time_t now;
- if (getenv("SOURCE_DATE_EPOCH")) {
- now = atol(getenv("SOURCE_DATE_EPOCH"));
+ const char *source_date_epoch = getenv("SOURCE_DATE_EPOCH");
+ if (source_date_epoch) {
+ now = atol(source_date_epoch);
} else {
now = time(NULL);
}
From 078a1738a86717b46e02276bd85bb76893688eea Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Date: Mon, 18 Sep 2017 14:34:32 +0200
Subject: [PATCH 3/3] Use GetTime in more places
in order to make more kinds of font operations reproducible
---
fontforge/dumppfa.c | 4 ++--
fontforge/splinesaveafm.c | 4 ++--
fontforge/tottf.c | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/fontforge/dumppfa.c b/fontforge/dumppfa.c
index 524b06f85..b88d124a8 100644
--- a/fontforge/dumppfa.c
+++ b/fontforge/dumppfa.c
@@ -52,7 +52,7 @@
# include <pwd.h>
#endif
#include <stdarg.h>
-#include <time.h>
+#include <gutils.h>
#include "psfont.h"
#include "splinefont.h"
#include <gdraw.h> /* For image defn */
@@ -1763,7 +1763,7 @@ static void dumpfontcomments(void (*dumpchar)(int ch,void *data), void *data,
time_t now;
const char *author = GetAuthor();
- time(&now);
+ now = GetTime();
/* Werner points out that the DSC Version comment has a very specific */
/* syntax. We can't just put in a random string, must be <real> <int> */
/* So we can sort of do that for CID fonts (give it a <revsion> of 0 */
diff --git a/fontforge/splinesaveafm.c b/fontforge/splinesaveafm.c
index d37a69f32..420770cb4 100644
--- a/fontforge/splinesaveafm.c
+++ b/fontforge/splinesaveafm.c
@@ -46,7 +46,7 @@
#include "splineutil.h"
#include <utype.h>
#include <ustring.h>
-#include <time.h>
+#include <gutils.h>
#include <math.h>
#include <sys/types.h> /* For stat */
@@ -1183,7 +1183,7 @@ static void AfmSplineFontHeader(FILE *afm, SplineFont *sf, int formattype,
iscid ? "StartFontMetrics 4.1\n" :
"StartFontMetrics 2.0\n" );
fprintf( afm, "Comment Generated by FontForge %d\n", FONTFORGE_VERSIONDATE_RAW );
- time(&now);
+ now = GetTime();
fprintf(afm,"Comment Creation Date: %s", ctime(&now));
fprintf( afm, "FontName %s\n", sf->fontname );
if ( sf->fullname!=NULL ) fprintf( afm, "FullName %s\n", sf->fullname );
diff --git a/fontforge/tottf.c b/fontforge/tottf.c
index f53da3fee..b3e065fdb 100644
--- a/fontforge/tottf.c
+++ b/fontforge/tottf.c
@@ -52,7 +52,7 @@
#include "ttfspecial.h"
#include <math.h>
#include <unistd.h>
-#include <time.h>
+#include <gutils.h>
#include <locale.h>
#include <utype.h>
#include <ustring.h>
@@ -3831,8 +3831,8 @@ void DefaultTTFEnglishNames(struct ttflangname *dummy, SplineFont *sf) {
if ( dummy->names[ttf_subfamily]==NULL || *dummy->names[ttf_subfamily]=='\0' )
dummy->names[ttf_subfamily] = utf8_verify_copy(SFGetModifiers(sf));
if ( dummy->names[ttf_uniqueid]==NULL || *dummy->names[ttf_uniqueid]=='\0' ) {
- time(&now);
- tm = localtime(&now);
+ now = GetTime();
+ tm = gmtime(&now);
snprintf( buffer, sizeof(buffer), "%s : %s : %d-%d-%d",
BDFFoundry?BDFFoundry:TTFFoundry?TTFFoundry:"FontForge 2.0",
sf->fullname!=NULL?sf->fullname:sf->fontname,