From bb563a8fbefbc636d34247df735801a23badc750 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Wed, 14 Nov 2018 20:01:19 +0000 Subject: Lzip and Tar also built as basic dependencies To ensure the easy unpacking and building of the programs, Lzip and Tar are now also build during the initial setup phase. Some minor corrections were also applied to make things cleaner and smoother. --- reproduce/config/pipeline/dependency-versions.mk | 2 + reproduce/src/make/dependencies-basic.mk | 88 +++++++++++++----------- reproduce/src/make/dependencies-build-rules.mk | 2 +- reproduce/src/make/dependencies.mk | 66 +++++++++--------- reproduce/src/make/initialize.mk | 6 +- 5 files changed, 90 insertions(+), 74 deletions(-) (limited to 'reproduce') diff --git a/reproduce/config/pipeline/dependency-versions.mk b/reproduce/config/pipeline/dependency-versions.mk index ad8dd2c..6d305cb 100644 --- a/reproduce/config/pipeline/dependency-versions.mk +++ b/reproduce/config/pipeline/dependency-versions.mk @@ -10,8 +10,10 @@ git-version = 2.19.1 gnuastro-version = 0.7.60-4c9eb grep-version = 3.1 libtool-version = 2.4.6 +lzip-version = 1.20 make-version = 4.2.90 sed-version = 4.5 +tar-version = 1.30 # Libraries cfitsio-version = 3.45 diff --git a/reproduce/src/make/dependencies-basic.mk b/reproduce/src/make/dependencies-basic.mk index 33b682b..ed6e971 100644 --- a/reproduce/src/make/dependencies-basic.mk +++ b/reproduce/src/make/dependencies-basic.mk @@ -47,7 +47,11 @@ idir = $(BDIR)/dependencies/installed ibdir = $(BDIR)/dependencies/installed/bin ildir = $(BDIR)/dependencies/installed/lib -top-level-programs = bash make +# As we build more programs, we want to use our own pipeline's built +# programs, not the systems. +PATH := $(ibdir):$(PATH) + +top-level-programs = bash all: $(foreach p, $(top-level-programs), $(ibdir)/$(p)) @@ -61,56 +65,62 @@ all: $(foreach p, $(top-level-programs), $(ibdir)/$(p)) # is not recognized by some versions of Make (even older GNU Makes). So # we'll have to make sure the recipe doesn't break into multiple shell # calls (so we can preserve the variables). -tarballs = $(foreach t, bash-$(bash-version).tar.gz \ - make-$(make-version).tar.gz \ +tarballs = $(foreach t, bash-$(bash-version).tar.gz \ + lzip-$(lzip-version).tar.gz \ + make-$(make-version).tar.gz \ + tar-$(tar-version).tar.gz \ , $(tdir)/$(t) ) $(tarballs): $(tdir)/%: - if [ -f $(DEPENDENCIES-DIR)/$* ]; then \ - cp $(DEPENDENCIES-DIR)/$* $@; \ - else \ - n=$$(echo $* | sed -e's/[0-9\-]/ /g' \ - -e's/\./ /g' \ - | awk '{print $$1}' ); \ - \ - mergenames=1; \ - if [ $$n = bash ]; then w=http://ftp.gnu.org/gnu/bash; \ - elif [ $$n = make ]; then w=http://akhlaghi.org/src; \ - else \ - echo; echo; echo; \ - echo "'$$n' not recognized as a dependency name to download." \ - echo; echo; echo; \ - exit 1; \ - fi; \ - \ - if [ $$mergenames = 1 ]; then tarballurl=$$w/"$*"; \ - else tarballurl=$$w; \ - fi; \ - echo "Downloading $$tarballurl"; \ - $(DOWNLOADER) $@ $$tarballurl; \ + if [ -f $(DEPENDENCIES-DIR)/$* ]; then \ + cp $(DEPENDENCIES-DIR)/$* $@; \ + else \ + n=$$(echo $* | sed -e's/[0-9\-]/ /g' \ + -e's/\./ /g' \ + | awk '{print $$1}' ); \ + \ + mergenames=1; \ + if [ $$n = bash ]; then w=http://ftp.gnu.org/gnu/bash; \ + elif [ $$n = lzip ]; then w=http://download.savannah.gnu.org/releases/lzip; \ + elif [ $$n = make ]; then w=http://akhlaghi.org/src; \ + elif [ $$n = tar ]; then w=http://ftp.gnu.org/gnu/tar; \ + else \ + echo; echo; echo; \ + echo "'$$n' not a dependency name (for downloading)." \ + echo; echo; echo; \ + exit 1; \ + fi; \ + \ + if [ $$mergenames = 1 ]; then tarballurl=$$w/"$*"; \ + else tarballurl=$$w; \ + fi; \ + echo "Downloading $$tarballurl"; \ + $(DOWNLOADER) $@ $$tarballurl; \ fi -# GNU Bash -# -------- -# -# Everything is standard and we can make it statically. -$(ibdir)/bash: $(tdir)/bash-$(bash-version).tar.gz - $(call gbuild,$(subst $(tdir),,$<), bash-$(bash-version), static) - - - +# Basic programs (sorted alphabetically), see prerequisites for which one +# will be built first. +$(ibdir)/bash: $(tdir)/bash-$(bash-version).tar.gz \ + $(ibdir)/make + $(call gbuild,$(subst $(tdir)/,,$<), bash-$(bash-version), static) +$(ibdir)/lzip: $(tdir)/lzip-$(lzip-version).tar.gz + $(call gbuild,$(subst $(tdir)/,,$<), lzip-$(lzip-version), static) -# GNU Make -# -------- -# # Unfortunately GNU Make needs dynamic linking in two instances: when # loading objects (dynamically linked libraries), or when using the # `getpwnam' function (for tilde expansion). The first can be disabled with # `--disable-load', but unfortunately I don't know any way to fix the # second. So, we'll have to build it dynamically for now. -$(ibdir)/make: $(tdir)/make-$(make-version).tar.gz - $(call gbuild,$(subst $(tdir),,$<), make-$(make-version), , , ,) +$(ibdir)/make: $(tdir)/make-$(make-version).tar.gz \ + $(ibdir)/tar + $(call gbuild,$(subst $(tdir)/,,$<), make-$(make-version), , , ,) + +# When built statically, tar gives a segmentation fault on unpacking +# Bash. So we'll build it dynamically. +$(ibdir)/tar: $(tdir)/tar-$(tar-version).tar.gz \ + $(ibdir)/lzip + $(call gbuild,$(subst $(tdir)/,,$<), tar-$(tar-version)) diff --git a/reproduce/src/make/dependencies-build-rules.mk b/reproduce/src/make/dependencies-build-rules.mk index a4d25aa..b53bc52 100644 --- a/reproduce/src/make/dependencies-build-rules.mk +++ b/reproduce/src/make/dependencies-build-rules.mk @@ -71,7 +71,7 @@ cbuild = if [ $(3)x = staticx ]; then \ opts="-DBUILD_SHARED_LIBS=OFF"; \ fi; \ cd $(ddir) && rm -rf $(2) && tar xf $(tdir)/$(1) && cd $(2) && \ - rm -rf my-build && mkdir my-build && cd my-build && opts="" && \ + rm -rf my-build && mkdir my-build && cd my-build && \ cmake .. $$opts $(4) && \ cmake --build . && \ cmake .. -DCMAKE_INSTALL_PREFIX=$(idir) && \ diff --git a/reproduce/src/make/dependencies.mk b/reproduce/src/make/dependencies.mk index 6da554c..45ceadc 100644 --- a/reproduce/src/make/dependencies.mk +++ b/reproduce/src/make/dependencies.mk @@ -151,46 +151,42 @@ $(tarballs): $(tdir)/%: # Libraries # --------- -$(ildir)/libcfitsio.a: $(tdir)/cfitsio-$(cfitsio-version).tar.gz \ - $(ildir)/libcurl.a \ +$(ildir)/libcfitsio.a: $(tdir)/cfitsio-$(cfitsio-version).tar.gz \ + $(ildir)/libcurl.a \ $(ibdir)/ls - $(call gbuild,$(subst $(tdir),,$<), cfitsio, static, \ + $(call gbuild,$(subst $(tdir)/,,$<), cfitsio, static, \ --enable-sse2 --enable-reentrant) -$(ildir)/libcurl.a: $(tdir)/curl-$(curl-version).tar.gz \ - $(ildir)/libz.a \ - $(ibdir)/ls - $(call gbuild,$(subst $(tdir),,$<), curl-$(curl-version), static, \ - --without-brotli) -$(ildir)/libgit2.a: $(tdir)/libgit2-$(libgit2-version).tar.gz \ - $(ildir)/libcurl.a \ +$(ildir)/libgit2.a: $(tdir)/libgit2-$(libgit2-version).tar.gz \ + $(ildir)/libcurl.a \ $(ibdir)/cmake - $(call cbuild,$(subst $(tdir),,$<), libgit2-$(libgit2-version), \ - static, -DUSE_SSH=OFF -DUSE_OPENSSL=OFF \ - -DBUILD_CLAR=OFF -DTHREADSAFE=ON, ) + $(call cbuild,$(subst $(tdir)/,,$<), libgit2-$(libgit2-version), \ + static, -DUSE_SSH=OFF -DUSE_OPENSSL=OFF \ + -DBUILD_CLAR=OFF -DTHREADSAFE=ON) -$(ildir)/libgsl.a: $(tdir)/gsl-$(gsl-version).tar.gz \ +$(ildir)/libgsl.a: $(tdir)/gsl-$(gsl-version).tar.gz \ $(ibdir)/ls - $(call gbuild,$(subst $(tdir),,$<), gsl-$(gsl-version), static) + $(call gbuild,$(subst $(tdir)/,,$<), gsl-$(gsl-version), static) $(ildir)/libjpeg.a: $(tdir)/jpegsrc.$(libjpeg-version).tar.gz - $(call gbuild,$(subst $(tdir),,$<), jpeg-9b, static) + $(call gbuild,$(subst $(tdir)/,,$<), jpeg-9b, static) -$(ildir)/libtiff.a: $(tdir)/tiff-$(libtiff-version).tar.gz \ +$(ildir)/libtiff.a: $(tdir)/tiff-$(libtiff-version).tar.gz \ $(ibdir)/ls - $(call gbuild,$(subst $(tdir),,$<), tiff-$(libtiff-version), static) + $(call gbuild,$(subst $(tdir)/,,$<), tiff-$(libtiff-version), \ + static) -$(ildir)/libwcs.a: $(tdir)/wcslib-$(wcslib-version).tar.bz2 \ +$(ildir)/libwcs.a: $(tdir)/wcslib-$(wcslib-version).tar.bz2 \ $(ildir)/libcfitsio.a - $(call gbuild,$(subst $(tdir),,$<), wcslib-$(wcslib-version), \ - static, LIBS="-pthread -lcurl -lm" --without-pgplot \ + $(call gbuild,$(subst $(tdir)/,,$<), wcslib-$(wcslib-version), \ + static, LIBS="-pthread -lcurl -lm" --without-pgplot \ --disable-fortran) # Zlib's `./configure' doesn't use Autoconf's configure script, it just # accepts a direct `--static' option. $(ildir)/libz.a: $(tdir)/zlib-$(zlib-version).tar.gz - $(call gbuild,$(subst $(tdir),,$<), zlib-$(zlib-version), , \ + $(call gbuild,$(subst $(tdir)/,,$<), zlib-$(zlib-version), , \ --static) @@ -199,37 +195,43 @@ $(ildir)/libz.a: $(tdir)/zlib-$(zlib-version).tar.gz # Programs # -------- -$(ibdir)/cmake: $(tdir)/cmake-$(cmake-version).tar.gz \ +$(ibdir)/cmake: $(tdir)/cmake-$(cmake-version).tar.gz \ $(ibdir)/ls - $(call cbuild,$(subst $(tdir),,$<), cmake-$(cmake-version)) + $(call cbuild,$(subst $(tdir)/,,$<), cmake-$(cmake-version)) + +$(ibdir)/curl: $(tdir)/curl-$(curl-version).tar.gz \ + $(ildir)/libz.a \ + $(ibdir)/ls + $(call gbuild,$(subst $(tdir)/,,$<), curl-$(curl-version), static, \ + --without-brotli) $(ibdir)/ls: $(tdir)/coreutils-$(coreutils-version).tar.xz - $(call gbuild,$(subst $(tdir),,$<), coreutils-$(coreutils-version), \ + $(call gbuild,$(subst $(tdir)/,,$<), coreutils-$(coreutils-version), \ static) $(ibdir)/gawk: $(tdir)/gawk-$(gawk-version).tar.gz \ $(ibdir)/ls - $(call gbuild,$(subst $(tdir),,$<), gawk-$(gawk-version), static) + $(call gbuild,$(subst $(tdir)/,,$<), gawk-$(gawk-version), static) $(ibdir)/sed: $(tdir)/sed-$(sed-version).tar.xz \ $(ibdir)/ls - $(call gbuild,$(subst $(tdir),,$<), sed-$(sed-version), static) + $(call gbuild,$(subst $(tdir)/,,$<), sed-$(sed-version), static) $(ibdir)/grep: $(tdir)/grep-$(grep-version).tar.xz \ $(ibdir)/ls - $(call gbuild,$(subst $(tdir),,$<), grep-$(grep-version), static) + $(call gbuild,$(subst $(tdir)/,,$<), grep-$(grep-version), static) $(ibdir)/libtool: $(tdir)/libtool-$(libtool-version).tar.gz \ $(ibdir)/ls - $(call gbuild,$(subst $(tdir),,$<), libtool-$(libtool-version), static) + $(call gbuild,$(subst $(tdir)/,,$<), libtool-$(libtool-version), static) $(ibdir)/gs: $(tdir)/ghostscript-$(ghostscript-version).tar.gz \ $(ibdir)/ls - $(call gbuild,$(subst $(tdir),,$<), ghostscript-$(ghostscript-version)) + $(call gbuild,$(subst $(tdir)/,,$<), ghostscript-$(ghostscript-version)) $(ibdir)/git: $(tdir)/git-$(git-version).tar.xz \ $(ibdir)/ls - $(call gbuild,$(subst $(tdir),,$<), git-$(git-version), static) + $(call gbuild,$(subst $(tdir)/,,$<), git-$(git-version), static) $(ibdir)/astnoisechisel: $(tdir)/gnuastro-$(gnuastro-version).tar.lz \ $(ildir)/libgsl.a \ @@ -240,5 +242,5 @@ $(ibdir)/astnoisechisel: $(tdir)/gnuastro-$(gnuastro-version).tar.lz \ $(ildir)/libtiff.a \ $(ildir)/libgit2.a \ - $(call gbuild,$(subst $(tdir),,$<), gnuastro-$(gnuastro-version), \ + $(call gbuild,$(subst $(tdir)/,,$<), gnuastro-$(gnuastro-version), \ static, , -j8, make check -j8) diff --git a/reproduce/src/make/initialize.mk b/reproduce/src/make/initialize.mk index d0f69a3..1acec9f 100644 --- a/reproduce/src/make/initialize.mk +++ b/reproduce/src/make/initialize.mk @@ -191,8 +191,9 @@ $(mtexdir)/initialize.tex: | $(mtexdir) # Versions of programs (same order as 'dependency-versions.mk'). $(call pvcheck, bash, $(bash-version), GNU Bash, bashversion) $(call pvcheck, cmake, $(cmake-version), CMake, cmakeversion) + $(call pvcheck, curl, $(curl-version), cURL, curlversion) $(call pvcheck, ls, $(coreutils-version), GNU Coreutils, \ - coreutilsversion) + coreutilsversion) $(call pvcheck, awk, $(gawk-version), GNU AWK, gawkversion) $(call pvcheck, gs, $(ghostscript-version), GPL Ghostscript, \ ghostscriptversion) @@ -202,12 +203,13 @@ $(mtexdir)/initialize.tex: | $(mtexdir) $(call pvcheck, grep, $(grep-version), GNU Grep, grepversion) $(call pvcheck, libtool, $(libtool-version), GNU Libtool, \ libtoolversion) + $(call pvcheck, lzip, $(lzip-version), Lzip, lzipversion) $(call pvcheck, make, $(make-version), GNU Make, makeversion) $(call pvcheck, sed, $(sed-version), GNU SED, sedversion) + $(call pvcheck, tar, $(tar-version), GNU Tar, tarversion) # Versions of libraries. $(call lvcheck, fitsio.h, $(cfitsio-version), CFITSIO, cfitsioversion) - ########## Curl library not yet checked. $(call lvcheck, gsl/gsl_version.h, $(gsl-version), \ GNU Scientific Library (GSL), gslversion) ########## libjpeg not yet checked. -- cgit v1.2.1