commit 4129992654a3b456e8792602608ab50142e45953 Author: Sukhbir Singh sukhbir@torproject.org Date: Fri Sep 1 16:06:30 2017 -0400
Ensure deterministic builds for libotr on macOS --- projects/libgcrypt/build | 7 +++++++ projects/libgcrypt/config | 4 ++++ projects/libgpg-error/build | 7 +++++++ projects/libgpg-error/config | 4 ++++ projects/libotr/build | 7 +++++++ projects/libotr/config | 4 ++++ 6 files changed, 33 insertions(+)
diff --git a/projects/libgcrypt/build b/projects/libgcrypt/build index ac27285..d5e1848 100644 --- a/projects/libgcrypt/build +++ b/projects/libgcrypt/build @@ -14,8 +14,15 @@ cd /var/tmp/build/[% project %]-[% c('version') %] sed -i 's/^BUILD_TIMESTAMP=.*/BUILD_TIMESTAMP=2000-01-01T00:00+0000/' configure export SOURCE_DATE_EPOCH=$(stat -c %Y ChangeLog) ./configure --prefix=$distdir [% c("var/configure_opt") %][% IF c('var/windows') or c('var/osx') %] --enable-static --disable-shared[% END %] +[% IF c("var/osx") -%] + export LD_PRELOAD=[% c("var/faketime_path") %] + export FAKETIME="[% USE date; GET date.format(c('timestamp'), format = '%Y-%m-%d %H:%M:%S') %]" +[% END -%] make -j4 make prefix=$distdir install +[% IF c("var/osx") -%] + unset LD_PRELOAD +[% END -%] cd /var/tmp/dist [% c('tar', { tar_src => [ project ], diff --git a/projects/libgcrypt/config b/projects/libgcrypt/config index d9f08fe..33a49a2 100644 --- a/projects/libgcrypt/config +++ b/projects/libgcrypt/config @@ -13,6 +13,10 @@ targets: var: arch_deps: - gettext + osx-x86_64: + var: + arch_deps: + - faketime input_files: - URL: 'ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-[% c("version") %].tar.bz2' sig_ext: sig diff --git a/projects/libgpg-error/build b/projects/libgpg-error/build index 1319786..e2680eb 100644 --- a/projects/libgpg-error/build +++ b/projects/libgpg-error/build @@ -13,8 +13,15 @@ echo 'int main() {}' > src/gen-posix-lock-obj.c [% END -%] export SOURCE_DATE_EPOCH=$(stat -c %Y ChangeLog) ./configure --prefix="$distdir" [% c("var/configure_opt") %][% IF c('var/windows') or c('var/osx') %] --enable-static --disable-shared[% END %] +[% IF c("var/osx") -%] + export LD_PRELOAD=[% c("var/faketime_path") %] + export FAKETIME="[% USE date; GET date.format(c('timestamp'), format = '%Y-%m-%d %H:%M:%S') %]" +[% END -%] make -j4 make prefix="$distdir" install +[% IF c("var/osx") -%] + unset LD_PRELOAD +[% END -%] cd /var/tmp/dist [% c('tar', { tar_src => [ project ], diff --git a/projects/libgpg-error/config b/projects/libgpg-error/config index 07d5d22..a815397 100644 --- a/projects/libgpg-error/config +++ b/projects/libgpg-error/config @@ -13,6 +13,10 @@ targets: var: arch_deps: - gettext + osx-x86_64: + var: + arch_deps: + - faketime input_files: - URL: 'ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-[% c("version") %].tar.bz2' sig_ext: sig diff --git a/projects/libotr/build b/projects/libotr/build index 2f49602..6edb5d1 100755 --- a/projects/libotr/build +++ b/projects/libotr/build @@ -15,8 +15,15 @@ tar -C /var/tmp/build -xf libotr-[% c('version') %].tar.gz cd /var/tmp/build/libotr-[% c('version') %] export SOURCE_DATE_EPOCH=$(stat -c %Y ChangeLog) ./configure --prefix=$distdir [% c("var/configure_opt") %] +[% IF c("var/osx") -%] + export LD_PRELOAD=[% c("var/faketime_path") %] + export FAKETIME="[% USE date; GET date.format(c('timestamp'), format = '%Y-%m-%d %H:%M:%S') %]" +[% END -%] make -j4 [% IF c("var/windows") %]LDFLAGS='-no-undefined -lssp'[% END %] make prefix=$distdir install +[% IF c("var/osx") -%] + unset LD_PRELOAD +[% END -%] cd /var/tmp/dist [% c('tar', { tar_src => [ project ], diff --git a/projects/libotr/config b/projects/libotr/config index 14a8ea4..12cf34b 100644 --- a/projects/libotr/config +++ b/projects/libotr/config @@ -17,6 +17,10 @@ targets: configure_opt: '--host=i686-w64-mingw32 CFLAGS="[% c("var/CFLAGS_otr") %]" LDFLAGS="[% c("var/LDFLAGS_otr") %]" CC="i686-w64-mingw32-gcc -static-libgcc"' CFLAGS_otr: '[% c("var/CFLAGS") %] -Wl,-Bstatic,-L/var/tmp/dist/libgcrypt/lib,-lgcrypt,-L/var/tmp/dist/libgpg-error/lib,-lgpg-error,-Bdynamic' LDFLAGS_otr: '[% c("var/LDFLAGS") %] -Wl,-Bstatic,-L/var/tmp/dist/libgcrypt/lib,-lgcrypt,-L/var/tmp/dist/libgpg-error/lib,-lgpg-error,-Bdynamic' + osx-x86_64: + var: + arch_deps: + - faketime input_files: - filename: 'libotr-[% c("version") %].tar.gz' URL: 'https://otr.cypherpunks.ca/libotr-%5B% c("version") %].tar.gz'