From 9ddff8b5c90b522f7dbeb3614b8ef00ceb45f4f2 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Mon, 29 Jun 2020 01:11:21 +0100 Subject: Core Xorg libraries necessary for Ghostscript now included Until now, in order to build Ghostscript, the project used the host's Xorg libraries. This was because we hadn't yet added the necessary build rules for them. With this commit, the instructions to build the necessary Xorg libraries for Ghostscript have also been added. Also, the shared Ghostscript library has been built with this commit and two sets of standard fonts are also included, setting us on the path to build TeXLive from source later. This task was done with the help and support of Raul Infante-Sainz. --- .file-metadata | Bin 9163 -> 9050 bytes reproduce/software/config/checksums.conf | 23 +++- reproduce/software/config/urls.conf | 17 +++ reproduce/software/config/versions.conf | 21 ++++ reproduce/software/make/basic.mk | 3 +- reproduce/software/make/high-level.mk | 186 +++++++++++++++++++++++-------- reproduce/software/make/xorg.mk | 180 ++++++++++++++++++++++++++++++ 7 files changed, 380 insertions(+), 50 deletions(-) create mode 100644 reproduce/software/make/xorg.mk diff --git a/.file-metadata b/.file-metadata index 4957fa0..dfcf2ed 100644 Binary files a/.file-metadata and b/.file-metadata differ diff --git a/reproduce/software/config/checksums.conf b/reproduce/software/config/checksums.conf index d108c41..62af1e1 100644 --- a/reproduce/software/config/checksums.conf +++ b/reproduce/software/config/checksums.conf @@ -92,7 +92,10 @@ flex-checksum = b4ef58d4a1d66b213e2f59df06959decf46d26b253cdc3f51cd26e2e2b505461 freetype-checksum = 02f0f4211f9cee5b5e46ebe61190482fca5b41bc26be06fcf0d2d717e9fb119229308398c420eeea476fa2511ca2d52948f1a3242efad30ca82ed0b07cd50e3a gdb-checksum = b4161df5adfce3eb51b3b3fc6072b2ef9f612f5e0f95b25bc57382812854836e9d1b24807c68cc8987e37e90112c6d75ffc1de3ea67a9f92858b4ce1af85c479 ghostscript-checksum = acee64fae78771bffa19b0b2bfaba3c345b420f93ceb4fc9df5fb705f785c8ed720fde2aef53546fac6aca2f7366c64c68a6e373a71999a42dc71aadc9aa782f +ghostscript-fonts-gnu-checksum = 222cb81e6956d9724e746f5f4d5c7b47b04bfd75b889f437f946c29a5bf16b5ed57b7584cf7fb0d8561287ef9f2e1ac53e4d231b6eaf23cba2612b47e8a5f919 +ghostscript-fonts-std-checksum = d4fe6b097a3bdd9694dc704a2d986e22d649fbb7ca8302f872dff573525596a3f38246bd6dd166a5970a4fbca8cce6ebfb9a7030806b4662630afdf243438e1f gnuastro-checksum = 718b391cc59e8f6b57afc963fb27161ecc9f32b18dcef1cf9c24c88f61d264d8d1154e59a74c36f6ac3a970e1a6f77eee288ec881899beb57e51cc55b56c089b +gperf-checksum = 855ebce5ff36753238a44f14c95be7afdc3990b085960345ca2caf1a2db884f7db74d406ce9eec2f4a52abb8a063d4ed000a36b317c9a353ef4e25e2cca9a3f4 gsl-checksum = 0be8240715f0b86aba2c63d9f12da4dba4719d4e350e9308d279e0dd3b2f0519ea26fd2e38a17f3e8cf43aacbaa2455207a7ca0d6c305f3b8725e8ece2250a74 hdf5-checksum = f828ee9d63533effe1ad358230e5ce7b64c5016e49291d9533575f713cbfba496290fc0151fd9617898bdf36785984ddb38a9207f529d7702d4e23838fe050d8 healpix-checksum = 29fe680d757bd94651bf029654257cb67286643aad510df4c2f0b06245174411376ec1beca64feebfac14a6fc0194525170635842916d79dcaddeddd9ac6f6c7 @@ -101,6 +104,7 @@ imagemagick-checksum = ad4325df57769f9c4edf8ac71370cb9bb19e090e588d47eb0311e3f48 imfit-checksum = 15edd2349232c1c8e611b31d3a46b0700112d274515f54d0a0085bb4bfa6d3d5f8a15cd926516e043a29ce841accf3534ae58dbfb952d858dc9445199c957096 lapack-checksum = 17786cb7306fccdc9b4a242de7f64fc261ebe6a10b6ec55f519deb4cb673cb137e8742aa5698fd2dc52f1cd56d3bd116af3f593a01dcf6770c4dcc86c50b2a7f libffi-checksum = 980ca30a8d76f963fca722432b1fe5af77d7a4e4d2eac5144fbc5374d4c596609a293440573f4294207e1bdd9fda80ad1e1cafb2ffb543df5a275bc3bd546483 +libidn-checksum = 782260f73b1fd8ebea8a40e2b3a6866c4f67494b2b3df03748daa9c0f842a9578932e746eb4bbf2547fccb1d65d7fc99a7977759dbe58f87f2fdd26d0fe45a09 libgit2-checksum = 0879c162e2e1dc00eadfbda22cd1f9d3a95b4ec2b653c108983f37c2f695140882de4d50d7cbc04ced247125a4e9fe6df16130e1267891aecdb2411d920db5c6 libjpeg-checksum = 74ea5af3545657d4ac03f8f7933913112cc2d982f0e379d0e5647f1acac21931468e53806297c30ebe180c7bcf84919a0ac20a4195afb03db03060d57904ef6c libnsl-checksum = a3c8f674357674b7ed4b26c05adde607f39be8d6dc9ff715448e1fcc5fc23d11fbb4ce85a6e493b79bdb0bb450dc3ffb1fb480715779f738d7bc016fae91621d @@ -125,14 +129,27 @@ sextractor-checksum = 4035710f9b8a20a0bb1a3913dab2dadd8444c179bf6dee425e0e8bb66a swarp-checksum = 80f4ade59738df3d4c9b47bda04148b53c6ba995d523fa8d1e02fb5d952b6078a53cc7d273849a033505de127a4f318b95adf2bf5a2dc38e8cc9bdaf5658487a swig-checksum = 5eaa2e06d8e4197fd02194051db1e518325dbb074a4c55a91099ad9c55193874f577764afc9029409a41bd520a95154095f26e33ef5add5c102bb2c1d98d33eb tides-checksum = c3360ff0d023b43749ba09a33302ca059f017a157b3ce7cdcf4f1a1578e90d3e7fa420077043adbee6b1ebf94bd698c8d6b279012f36d2a05b4de5351e30e108 +util-linux-checksum = c95d26b9037d6b877a247e6aeb58d17aa80f7e1bd6b523a4e0fde559fe07b3d924ece6d373300fefb65d1f206b3f990aeddb3a03605040e72ce6d6ee88591021 wcslib-checksum = fed47771defb2a93fb50aa2e701c46f8ce35773dd3de91eeaed311b5a0474c096c7f9be6996fe95f82faa30b1d5c0aba892bca5da80bc32b15919dfaf551aeb7 xlsxio-checksum = 22870fda7bd4eefd5fea2a9ad7530c9049135129d9b69805091777e6b54b2fc6c3f0e69c6954f36bce54eebbfeccaf637cce9e271a593221a4296d6632470a6c yaml-checksum = 13d2197135946204323dbfccafa0ac7b3d05437e920545a56f46811fd7319c01419a58083090ce85fccd4d6901a620ceb9f1190078cc0830bc0ce769bb024f51 zlib-checksum = 73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae - - - +# Xorg related packages +util-macros-checksum = 3f51504b27f0478c136126f15110cf3cdbba218c4d74a8e974cca1381c6e8364609bd0c444f2fb19aa86a7f4e848dfce4f4da940463b224036f75a60b3d88619 +xorgproto-checksum = 2d10533e54987f293e1c8578aa742c38cf2fac8551db1d317cf5ee4a6a9600eced50f59c57c38b35dd210fe02d350294c967512f04cb9876d6c0c1f7e89cb199 +libxau-checksum = 3ca454ba466a807ea28b0f715066d73dc76ad312697b121d43e4d5766215052e9b7ffb8fe3ed3e496fa3f2a13f164ac692ff85cc428e26731b679f0f06a1d562 +libxdmcp-checksum = cb1d4650f97d66e73acd2465ec7d757b9b797cce2f85e301860a44997a461837eea845ec9bd5b639ec5ca34c804f8bdd870697a5ce3f4e270b687c9ef74f25ec +xcb-proto-checksum = de66d568163b6da2be9d6c59984f3afa3acd119a781378638045fd68018665ef5c9af98f024e9962ba3eb7c7a4d85c27ba70ffafceb2324ccc6940f34de16690 +libxcb-checksum = b90a23204b0d2c29d8b115577edb01df0465e02d6a8876550fecd62375d24a5d5f872ddd5946772ddba077cadce75b12c7a6d218469dc30b5b92bc82188e8bc6 +fontconfig-checksum = f97f2a9db294fd72d416a7d76dd7db5934ade2cf76903764b09e7decc33e0e2eed1a1d35c5f1c7fd9ea39e2c7653b9e65365f0c6205e047e95e38ba5000dd100 +xtrans-checksum = 4fea89a3455c0e13321cbefa43340016dbb59bdd0dbdb5b796c1a6d2a6b1fd63cf1327b769ab426286b9c54b32ec764a50cd2b46228e4e43b841bda6b94de214 +libx11-checksum = fc18f0dc17ade1fc37402179f52e1f2b9c7b7d3a1a9590fea13046eb0c5193b4796289431cd99388eac01e8e59de77db45d2c9675d4f05ef8cf3ba6382c3dd31 +libxext-checksum = 09146397d95f80c04701be1cc0a9c580ab5a085842ac31d17dfb6d4c2e42b4253b89cba695e54444e520be359883a76ffd02f42484c9e2ba2c33a5a40c29df4a +libice-checksum = 2f1ef2c32c833c71894a08fa7e7ed53f301f6c7bd22485d71c12884d8e8b36b99f362ec886349dcc84d08edc81c8b2cea035320831d64974edeba021b433c468 +libsm-checksum = 74c42e27029db78475e62025b4711dbac5e22d2f8e8a24be98a1c31b03c0fc4afe859928f851800ea0b76854f12147900dc4f27bbfd3d8ea45daaaf24b70a903 +libxt-checksum = 06248508b6fe5dfba8ceb4518475f656162351d78136eeb5d65086d680dabe9aca7bba3c94347f9c13ef03f82dab3ac19d0952ee610bc8c51c14cee7cf65f0b1 +libpthread-stubs-checksum = 5293c847f5d0c47a6956dd85b6630866f717e51e1e9c48fa10f70aa1e8268adc778eaf92504989c5df58c0dcde656f036248993b0ea5f79d4303012bfeff3c72 # Python packages # --------------- diff --git a/reproduce/software/config/urls.conf b/reproduce/software/config/urls.conf index dc5a9d8..945537d 100644 --- a/reproduce/software/config/urls.conf +++ b/reproduce/software/config/urls.conf @@ -94,6 +94,8 @@ #freetype-url = https://download.savannah.gnu.org/releases/freetype #gdb-url = http://ftp.gnu.org/gnu/gdb #ghostscript-url = $(shell v=$$(echo $(ghostscript-version) | sed -e's/\.//'); echo https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs$$v) +#gs-fonts-std-url = https://downloads.sourceforge.net/gs-fonts +#gs-fonts-gnu-url = https://downloads.sourceforge.net/gs-fonts #gnuastro-url = http://ftp.gnu.org/gnu/gnuastro #gsl-url = http://ftp.gnu.org/gnu/gsl #hdf5-url = $(shell majorver=$$(echo $(hdf5-version) | sed -e 's/\./ /g' | awk '{printf("%d.%d", $$1, $$2)}'); echo https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-$$majorver/hdf5-$(hdf5-version)/src) @@ -103,6 +105,7 @@ #imfit-url = http://www.mpe.mpg.de/~erwin/resources/imfit #lapack-url = http://www.netlib.org/lapack #libffi-url = ftp://sourceware.org/pub/libffi +#libidn-url = https://ftp.gnu.org/gnu/libidn #libgit2-url = https://github.com/libgit2/libgit2/archive #libjpeg-url = http://ijg.org/files #libnsl-url = http://akhlaghi.org/maneage-software @@ -127,11 +130,25 @@ #swarp-url = https://www.astromatic.net/download/swarp #swig-url = https://sourceforge.net/projects/swig/files/swig/swig-$(swig-version) #tides-url = http://akhlaghi.org/maneage-software +#util-linux-url = https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.35/ #valgrind-url = https://sourceware.org/pub/valgrind #wcslib-url = ftp://ftp.atnf.csiro.au/pub/software/wcslib #xlsxio-url = https://github.com/brechtsanders/xlsxio/archive #yaml-url = pyyaml.org/download/libyaml +# Xorg packages +# ------------- +#util-macros-url = https://www.x.org/pub/individual/util +#xorgproto-url = https://xorg.freedesktop.org/archive/individual/proto +#libxau-url = https://www.x.org/pub/individual/lib +#libxdmcp-url = https://www.x.org/pub/individual/lib +#xcb-proto-url = https://xorg.freedesktop.org/archive/individual/proto +#fontconfig-url = https://www.freedesktop.org/software/fontconfig/release +#xtrans-url = https://www.x.org/pub/individual/lib +#libx11-url = https://www.x.org/pub/individual/lib +#libxext-url = https://www.x.org/pub/individual/lib +#libpthread-stubs-url = https://xcb.freedesktop.org/dist + diff --git a/reproduce/software/config/versions.conf b/reproduce/software/config/versions.conf index 2e3406a..7998345 100644 --- a/reproduce/software/config/versions.conf +++ b/reproduce/software/config/versions.conf @@ -100,7 +100,10 @@ flex-version = 2.6.4-91-ga631f5d freetype-version = 2.9 gdb-version = 8.3 ghostscript-version = 9.50 +ghostscript-fonts-gnu-version = 6.0 +ghostscript-fonts-std-version = 8.11 gnuastro-version = 0.11 +gperf-version = 3.1 gsl-version = 2.6 hdf5-version = 1.10.5 healpix-version = 3.50 @@ -108,6 +111,7 @@ help2man-version = 1.47.11 imagemagick-version = 7.0.8-67 imfit-version = 1.6.1 libffi-version = 3.2.1 +libidn-version = 1.35 libjpeg-version = v9b libnsl-version = 1.2.0-4a062cf libpaper-version = 1.1.28 @@ -130,9 +134,26 @@ sextractor-version = 2.25.0 swarp-version = 2.38.0 swig-version = 3.0.12 tides-version = 2.0 +util-linux-version = 2.35 xlsxio-version = 0.2.21 yaml-version = 0.2.2 +# Xorg packages +util-macros-version = 1.19.2 +xorgproto-version = 2020.1 +libxau-version = 1.0.9 +libxdmcp-version = 1.1.3 +xcb-proto-version = 1.14 +libxcb-version = 1.14 +fontconfig-version = 2.13.1 +xtrans-version = 1.4.0 +libx11-version = 1.6.9 +libxext-version = 1.3.4 +libice-version = 1.0.10 +libsm-version = 1.2.3 +libxt-version = 1.2.0 +libpthread-stubs-version = 0.4 + # Version-dependent build # ----------------------- lapack-version = 3.8.0 diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk index 94bb5d4..453eddb 100644 --- a/reproduce/software/make/basic.mk +++ b/reproduce/software/make/basic.mk @@ -191,9 +191,8 @@ $(ibidir)/low-level-links: $(ibidir)/coreutils-$(coreutils-version) \ # Libdl (for dynamic loading libraries at runtime) # POSIX Threads library for multi-threaded programs. for l in dl pthread; do - rm -f $(ildir)/lib$$l*; if [ -f /usr/lib/lib$$l.a ]; then - ln -s /usr/lib/lib$$l.* $(ildir)/ + ln -sf /usr/lib/lib$$l.* $(ildir)/ fi done diff --git a/reproduce/software/make/high-level.mk b/reproduce/software/make/high-level.mk index b756cb9..ac84c87 100644 --- a/reproduce/software/make/high-level.mk +++ b/reproduce/software/make/high-level.mk @@ -70,10 +70,10 @@ ifeq ($(strip $(all_highlevel)),1) # we'll need to filter it out, then add it in the end: minizip (has same # version as zlib) # - # Packages that are installed in the same recipe as others. These need to - # be totally removed when testing all the builds (they will be built - # anyway). lapack (installed with ATLAS) - targets-proglib := $(filter-out minizip-% lapack-%, \ + # Packages that are installed in the same recipe as others shouldn't be + # included here because there is no explicit target for them: they will + # be built as part of the other package. + targets-proglib := $(filter-out minizip-% lapack-% ghostscript-fonts-%, \ $(shell awk '/^# CLASS:PYTHON/{good=0} \ good==1 && !/^#/ && $$1 ~ /-version$$/ { \ printf("%s %s ", $$1, $$3)} \ @@ -126,14 +126,16 @@ export CCACHE_DISABLE := 1 export SHELL := $(ibdir)/bash export CPPFLAGS := -I$(idir)/include .SHELLFLAGS := --noprofile --norc -ec -export PKG_CONFIG_PATH := $(ildir)/pkgconfig export LDFLAGS := $(rpath_command) -L$(ildir) export PKG_CONFIG_LIBDIR := $(ildir)/pkgconfig +export PKG_CONFIG_PATH := $(ildir)/pkgconfig:$(idir)/share/pkgconfig # Settings specific to this Makefile. export CC := $(ibdir)/gcc export CXX := $(ibdir)/g++ export F77 := $(ibdir)/gfortran +export C_INCLUDE_PATH := $(iidir) +export CPLUS_INCLUDE_PATH := $(iidir) export LD_RUN_PATH := $(ildir):$(il64dir) export LD_LIBRARY_PATH := $(ildir):$(il64dir) @@ -156,7 +158,15 @@ export DYLD_LIBRARY_PATH := # library, it is thus necessary to include this location here. On systems # that don't need it, `sys_library_path' is just empty. This is necessary # for `ld'. -export LIBRARY_PATH := $(sys_library_path) +# +# If this variable is not defined, it will be interpretted as the current +# directory. In this case, when the program source has a 'specs' directory, +# GCC will crash because it expects it to be special file. +ifeq ($(strip $(sys_library_path)),) +export LIBRARY_PATH := $(ildir) +else +export LIBRARY_PATH := $(ildir):$(sys_library_path) +endif # Building flags: # @@ -190,7 +200,8 @@ backupservers = $(filter-out $(topbackupserver),$(backupservers_all)) -# Import rules to build Python packages, +# Import rules to build specialized software +include reproduce/software/make/xorg.mk include reproduce/software/make/python.mk @@ -466,6 +477,12 @@ $(ibidir)/freetype-$(freetype-version): $(ibidir)/libpng-$(libpng-version) $(call gbuild, freetype-$(freetype-version), static) echo "FreeType $(freetype-version)" > $@ +$(ibidir)/gperf-$(gperf-version): + tarball=gperf-$(gperf-version).tar.gz + $(call import-source, $(gperf-url), $(gperf-checksum)) + $(call gbuild, gperf-$(gperf-version), static) + echo "GNU gperf $(gperf-version)" > $@ + $(ibidir)/gsl-$(gsl-version): tarball=gsl-$(gsl-version).tar.gz $(call import-source, $(gsl-url), $(gsl-checksum)) @@ -533,6 +550,13 @@ $(ibidir)/healpix-$(healpix-version): $(healpix-python-dep) \ cp $(dtexdir)/healpix.tex $(ictdir)/ echo "HEALPix $(healpix-version) \citep{healpix}" > $@ +$(ibidir)/libidn-$(libidn-version): + tarball=libidn-$(libidn-version).tar.gz + $(call import-source, $(libidn-url), $(libidn-checksum)) + $(call gbuild, libidn-$(libidn-version), static, \ + --disable-doc, -j$(numthreads) V=1) + echo "Libjpeg $(libjpeg-version)" > $@ + $(ibidir)/libjpeg-$(libjpeg-version): tarball=jpegsrc.$(libjpeg-version).tar.gz $(call import-source, $(libjpeg-url), $(libjpeg-checksum)) @@ -893,50 +917,58 @@ $(ibidir)/gdb-$(gdb-version): $(ibidir)/python-$(python-version) echo "GNU Project Debugger (GDB) $(gdb-version)" > $@ $(ibidir)/ghostscript-$(ghostscript-version): \ + $(ibidir)/libxt-$(libxt-version) \ + $(ibidir)/expat-$(expat-version) \ + $(ibidir)/libidn-$(libidn-version) \ $(ibidir)/libpng-$(libpng-version) \ - $(ibidir)/libtiff-$(libtiff-version) + $(ibidir)/libtiff-$(libtiff-version) \ + $(ibidir)/libpaper-$(libpaper-version) - # Import the tarball. + # Download the standard collection of Ghostscript fonts. + tarball=ghostscript-fonts-std-$(ghostscript-fonts-std-version).tar.gz + $(call import-source, $(ghostscript-fonts-std-url), \ + $(ghostscript-fonts-std-checksum)) + + # Download the extra GNU fonts for Ghostscript. + tarball=ghostscript-fonts-gnu-$(ghostscript-fonts-gnu-version).tar.gz + $(call import-source, $(ghostscript-fonts-gnu-url), \ + $(ghostscript-fonts-gnu-checksum)) + + # Download the tarball tarball=ghostscript-$(ghostscript-version).tar.gz $(call import-source, $(ghostscript-url), $(ghostscript-checksum)) - # First we need to make sure some necessary X11 libraries that we - # don't yet install in this template are present on the host - # system, see https://savannah.nongnu.org/task/?15481 . - # Adding `-L/opt/X11/lib' to LDFLAGS is necessary for macOS systems - # because X11 libraries used to be installed there. - echo; - echo "Template: testing necessary X11 libraries for ghostscript" - echo "---------------------------------------------------------" - oprog=$(ddir)/libXext-test-for-ghostscript - cprog=$(ddir)/libXext-test-for-ghostscript.c - echo "#include " > $$cprog - echo "int main(void) {return 0;}" >> $$cprog - export LDFLAGS="$$LDFLAGS -L/opt/X11/lib" - if $$CC $$LDFLAGS $$cprog -o$$oprog -lXt -lSM -lICE -lXext; then - echo "Necessary X11 libraries are present. Proceeding to the build." - rm $$cprog $$oprog - else - rm $$cprog - echo "" - echo "Problem in building Ghostscript" - echo "-------------------------------" - echo "Some necessary X11 libraries (that we don't yet install" - echo "within the template) couldn't be found on your system, see" - echo "the 'ld' error message above. Please install them manually" - echo "so Ghostscript can be built." - echo - echo "For example if you use Debian-based OSs, run this command:" - echo " sudo apt install libxext-dev libxt-dev libsm-dev libice-dev ghostscript" - echo "" - echo "This notice will be removed once these packages are built" - echo "within the project (Task #15481)." - echo "-------------------------------" - exit 1 - fi + # Unpack it and configure Ghostscript. + cd $(ddir) + tar xf $(tdir)/$$tarball + cd ghostscript-$(ghostscript-version) + ./configure --prefix=$(idir) \ + --disable-cups \ + --enable-dynamic \ + --with-system-libtiff \ + --disable-compile-inits + + # Build and install the program and the shared libraries. + make V=1 -j$(numthreads) + make so V=1 -j$(numthreads) + make install + make soinstall + + # Install headers and set PostScript (PS) headers to point there. + install -v -m644 base/*.h $(iidir)/ghostscript + ln -sfvn $(iidir)/ghostscript $(iidir)/ps - # If they were present, go onto building Ghostscript. - $(call gbuild, ghostscript-$(ghostscript-version),,,V=1 -j$(numthreads)) + # Install the fonts. + tar -xvf $(tdir)/ghostscript-fonts-std-$(ghostscript-fonts-std-version).tar.gz \ + -C $(idir)/share/ghostscript + tar -xvf $(tdir)/ghostscript-fonts-gnu-$(ghostscript-fonts-gnu-version).tar.gz \ + -C $(idir)/share/ghostscript + fc-cache -v $(idir)/share/ghostscript/fonts/ + echo; echo "Ghostscript fonts added to Fontconfig."; echo; + + # Clean up and write the output target. + cd .. + rm -rf ghostscript-$(ghostscript-version) echo "GPL Ghostscript $(ghostscript-version)" > $@ $(ibidir)/gnuastro-$(gnuastro-version): \ @@ -1203,6 +1235,70 @@ $(ibidir)/swig-$(swig-version): $(call gbuild, swig-$(swig-version), static, --without-pcre) echo "Swig $(swig-version)" > $@ +# The disables: +# For macOS: +# --disable-dependency-tracking +# --disable-silent-rules +# --disable-ipcrm +# --disable-ipcs +# Because they need root: +# --disable-mount +# --disable-wall +# --disable-su +# +# NOTE ON INSTALLATION DIRECTORY: Util-linux libraries are relatively +# low-level and may cause conflicts with system libraries (especilly when +# we don't build the C compiler in Maneage). The precise conflict that +# triggered this was building CMake on macOS (it was expecting the host's +# uuid library, but would crash because of conflicts with the installed +# 'uuid.h' headers of Maneage's 'util-linux'. +# +# Since many programs don't actually need 'util-linux' libraries, to avoid +# low-level conflicts, we will install util-linux in a unique top-level +# directory and put symbolic links of its binaries in the main +# '$(ibdir)'. If any program does need 'util-linux' libraries, they can +# simply add the proper directories to the environment variables, see +# 'fontconfig' for example. +$(ibidir)/util-linux-$(util-linux-version): + + # Import the source. + tarball=util-linux-$(util-linux-version).tar.xz + $(call import-source, $(util-linux-url), $(util-linux-checksum)) + + # Unpack the source and set it to install in a special directory + # (as explained above). As shown below, later, we'll put a symbolic + # link of all the necessary binaries in the main '$(idir)/bin'. + cd $(ddir) + tar xf $(tdir)/$$tarball + cd util-linux-$(util-linux-version) + ./configure --prefix=$(idir)/util-linux \ + --disable-dependency-tracking \ + --disable-silent-rules \ + --without-systemd \ + --enable-libuuid \ + --disable-mount \ + --disable-ipcrm \ + --disable-ipcs \ + --disable-wall \ + --disable-su + + # Build and install it. + make V=1 -j$(numthreads) + make install + + # Put a symbolic link to installed programs in main installation + # directory. If 'sbin' exists in the main installation directory, + # put util-linux's 'sbin/' directory there too. + ln -sf $(idir)/util-linux/bin/* $(ibdir)/ + if [ -d $(idir)/sbin ]; then + ln -sf $(idir)/util-linux/sbin/* $(idir)/sbin + else + ln -sf $(idir)/util-linux/sbin/* $(idir)/bin + fi + + # Write the main target. + echo "util-Linux $(util-linux-version)" > $@ + $(ibidir)/xlsxio-$(xlsxio-version): \ $(ibidir)/cmake-$(cmake-version) \ $(ibidir)/expat-$(expat-version) \ diff --git a/reproduce/software/make/xorg.mk b/reproduce/software/make/xorg.mk new file mode 100644 index 0000000..e3b1f71 --- /dev/null +++ b/reproduce/software/make/xorg.mk @@ -0,0 +1,180 @@ +# Build the project's Xorg dependencies. +# +# ------------------------------------------------------------------------ +# !!!!! IMPORTANT NOTES !!!!! +# +# This Makefile will be loaded into 'high-level.mk', which is called by the +# `./project configure' script. It is not included into the project +# afterwards. +# +# This Makefile contains instructions to build all the Xorg-related +# software within the project. The build instructions here are taken from +# Linux From Scratch: +# http://www.linuxfromscratch.org/blfs/view/svn/x/xorg7.html +# +# ------------------------------------------------------------------------ +# +# Copyright (C) 2020 Mohammad Akhlaghi +# +# This Makefile is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This Makefile is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this Makefile. If not, see . + + + + + +# Environment variables +export XORG_PREFIX=$(idir) + +# Common configuration options for all Xorg programs +export XORG_CONFIG = --disable-static --prefix=$(XORG_PREFIX) \ + --sysconfdir=$(idir)/etc --localstatedir=$(idir)/var + + + + + +# This is the basic Xorg configuration script. Note that '$(idir)/etc' was +# built in 'basic.mk'. +$(idir)/etc/profile.d:; mkdir +$(idir)/etc/profile.d/xorg.sh: | $(idir)/etc/profile.d + echo "export XORG_PREFIX=\"$(XORG_PREFIX)\"" > $@ + echo "export XORG_CONFIG=\"$(XORG_CONFIG)\"" >> $@ + chmod 644 $@ + +# A set of m4 macros used in all Xorg packages. +$(ibidir)/util-macros-$(util-macros-version): \ + $(idir)/etc/profile.d/xorg.sh \ + $(ibidir)/automake-$(automake-version) + tarball=util-macros-$(util-macros-version).tar.bz2 + $(call import-source, $(util-macros-url), $(util-macros-checksum)) + $(call gbuild, util-macros-$(util-macros-version),,$(XORG_CONFIG),V=1) + echo "util-macros (Xorg) $(util-macros-version)" > $@ + +# Necessaary headers to define the Xorg protocols. +$(ibidir)/xorgproto-$(xorgproto-version): \ + $(ibidir)/util-macros-$(util-macros-version) + tarball=xorgproto-$(xorgproto-version).tar.bz2 + $(call import-source, $(xorg-proto-url), $(xorgproto-checksum)) + $(call gbuild, xorgproto-$(xorgproto-version),,$(XORG_CONFIG),V=1) + echo "xorgproto $(xorgproto-version)" > $@ + +# Necessaary headers to define the Xorg protocols. +$(ibidir)/libxau-$(libxau-version): $(ibidir)/xorgproto-$(xorgproto-version) + tarball=libXau-$(libxau-version).tar.bz2 + $(call import-source, $(libaxu-url), $(libxau-checksum)) + $(call gbuild, libXau-$(libxau-version),,$(XORG_CONFIG), V=1) + echo "libXau (Xorg) $(libxau-version)" > $@ + +# Library implementing the X Display Manager Control Protocol. +$(ibidir)/libxdmcp-$(libxdmcp-version): $(ibidir)/libxau-$(libxau-version) + tarball=libXdmcp-$(libxdmcp-version).tar.bz2 + $(call import-source, $(libxdmcp-url), $(libxdmcp-checksum)) + $(call gbuild, libXdmcp-$(libxdmcp-version),,$(XORG_CONFIG), V=1) + echo "libXdmcp (Xorg) $(libxdmcp-version)" > $@ + +# XML-XCB protocol descriptions +$(ibidir)/xcb-proto-$(xcb-proto-version): \ + $(ibidir)/python-$(python-version) \ + $(ibidir)/libxml2-$(libxml2-version) + tarball=xcb-proto-$(xcb-proto-version).tar.xz + $(call import-source, $(xcb-proto-url), $(xcb-proto-checksum)) + $(call gbuild, xcb-proto-$(xcb-proto-version),,$(XORG_CONFIG), V=1) + echo "XCB-proto (Xorg) $(xcb-proto-version)" > $@ + +# Interface to the X Window System protocol, replaces current Xlib interface. +$(ibidir)/libxcb-$(libxcb-version): \ + $(ibidir)/libxdmcp-$(libxdmcp-version) \ + $(ibidir)/xcb-proto-$(xcb-proto-version) \ + $(ibidir)/libpthread-stubs-$(libpthread-stubs-version) + tarball=libxcb-$(libxcb-version).tar.xz + $(call import-source, $(libxcb-url), $(libxcb-checksum)) + $(call gbuild, libxcb-$(libxcb-version),, \ + $(XORG_CONFIG) --without-doxygen, \ + V=1 -j$(numthreads)) + echo "libxcb (Xorg) $(libxcb-version)" > $@ + +$(ibidir)/libpthread-stubs-$(libpthread-stubs-version): \ + $(ibidir)/automake-$(automake-version) + tarball=libpthread-stubs-$(libpthread-stubs-version).tar.gz + $(call import-source, $(libpthread-stubs-url), $(libpthread-stubs-checksum)) + $(call gbuild, libpthread-stubs-$(libpthread-stubs-version),, V=1) + echo "libpthread-stubs (Xorg) $(libpthread-stubs-version)" > $@ + +# Library for configuring fonts, it needs util-linux for libuuid. +$(ibidir)/fontconfig-$(fontconfig-version): \ + $(ibidir)/gperf-$(gperf-version) \ + $(ibidir)/expat-$(expat-version) \ + $(ibidir)/libxml2-$(libxml2-version) \ + $(ibidir)/freetype-$(freetype-version) \ + $(ibidir)/util-linux-$(util-linux-version) + # Import the source. + tarball=fontconfig-$(fontconfig-version).tar.bz2 + $(call import-source, $(fontconfig-url), $(fontconfig-checksum)) + + # Add the extra environment variables for using 'libuuid' of + # 'util-linux'. + ulidir=$(idir)/util-linux + export LDFLAGS="-L$$ulidir/lib $(LDFLAGS)" + export CPPFLAGS="-I$$ulidir/include $(CPPFLAGS)" + export PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):$$ulidir/lib/pkgconfig + + # Build it. + $(call gbuild, fontconfig-$(fontconfig-version),, \ + $(XORG_CONFIG) --sysconfdir=$(idir)/etc \ + --disable-docs, V=1 -j$(numthreads)) + echo "Fontconfig $(fontconfig-version)" > $@ + +$(ibidir)/xtrans-$(xtrans-version): \ + $(ibidir)/libxcb-$(libxcb-version) \ + $(ibidir)/fontconfig-$(fontconfig-version) + tarball=xtrans-$(xtrans-version).tar.bz2 + $(call import-source, $(xtrans-url), $(xtrans-checksum)) + $(call gbuild, xtrans-$(xtrans-version),,$(XORG_CONFIG), V=1) + echo "xtrans (Xorg) $(xtrans-version)" > $@ + +$(ibidir)/libx11-$(libx11-version): $(ibidir)/xtrans-$(xtrans-version) + tarball=libX11-$(libx11-version).tar.bz2 + $(call import-source, $(libx11-url), $(libx11-checksum)) + $(call gbuild, libX11-$(libx11-version),,$(XORG_CONFIG), \ + -j$(numthreads) V=1) + echo "X11 library $(libx11-version)" > $@ + +$(ibidir)/libxext-$(libxext-version): $(ibidir)/libx11-$(libx11-version) + tarball=libXext-$(libxext-version).tar.bz2 + $(call import-source, $(libxext-url), $(libxext-checksum)) + $(call gbuild, libXext-$(libxext-version),,$(XORG_CONFIG), \ + -j$(numthreads) V=1) + echo "libXext $(libxext-version)" > $@ + +$(ibidir)/libice-$(libice-version): $(ibidir)/libxext-$(libxext-version) + tarball=libICE-$(libice-version).tar.bz2 + $(call import-source, $(libice-url), $(libice-checksum)) + $(call gbuild, libICE-$(libice-version),, \ + $(XORG_CONFIG) ICE_LIBS=-lpthread, \ + -j$(numthreads) V=1) + echo "libICE $(libice-version)" > $@ + +$(ibidir)/libsm-$(libsm-version): $(ibidir)/libice-$(libice-version) + tarball=libSM-$(libsm-version).tar.bz2 + $(call import-source, $(libsm-url), $(libsm-checksum)) + $(call gbuild, libSM-$(libsm-version),, \ + $(XORG_CONFIG), -j$(numthreads) V=1) + echo "libSM $(libsm-version)" > $@ + +$(ibidir)/libxt-$(libxt-version): $(ibidir)/libsm-$(libsm-version) + tarball=libXt-$(libxt-version).tar.bz2 + $(call import-source, $(libxt-url), $(libxt-checksum)) + $(call gbuild, libXt-$(libxt-version),, \ + $(XORG_CONFIG), -j$(numthreads) V=1) + echo "libXt $(libxt-version)" > $@ -- cgit v1.2.1