aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2020-08-27 16:47:26 +0100
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2020-08-28 15:02:30 +0100
commit87948105390c035a0f0ad409db622b3850988ddb (patch)
tree78b11cacf8fbf8737ac8bc9b1226dbfb59d1c1f7
parentc6a4aaad62a90af9a72f9bc58650696419474239 (diff)
Plain text editors: nano in basic, emacs and vim in high-level
While a project is under development, the raw analysis software are not the only necessary software in a project. We also need tools to all the edit plain-text files within the Maneaged project. Usually people use their operating system's plain-text editor. However, when working on the project on a new computer, or in a container, the plain-text editors will have different versions, or may not be present at all! This can be very annoying and frustrating! With this commit, Maneage now installs GNU Nano as part of the basic tools. GNU Nano is a very simple and small plain text editor (the installed size is only ~3.5MB, and it is friendly to new users). Therefore, any Maneaged project can assume atleast Nano will be present (in particular when no editor is available on the running system!). GNU Emacs and VIM (both without extra dependencies, in particular without GUI support) are also optionally available in 'high-level.mk' (by adding them to 'TARGETS.conf'). The basic idea for the more advanced editors (Emacs and VIM) is that project authors can add their favorite editor while they are working on the project, but upon publication they can remove them from 'TARGETS.conf'. A few other minor things came up during this work and are now also fixed: - The 'file' program and its libraries like 'libmagic' were linking to system's 'libseccomp'! This dependency then leaked into Nano (which depends on 'libmagic'). But this is just an extra feature of 'file', only for the Linux kernel. Also, we have no dependency on it so far. So 'file' is not configured to not build with 'libseccomp'. - A typo was fixed in the line where the physical core information is being read on macOS. - The top-level directories when running './project shell' are now quoted (in case they have special characters).
-rwxr-xr-xproject24
-rw-r--r--reproduce/software/config/checksums.conf3
-rw-r--r--reproduce/software/config/urls.conf3
-rw-r--r--reproduce/software/config/versions.conf3
-rw-r--r--reproduce/software/make/basic.mk25
-rw-r--r--reproduce/software/make/high-level.mk45
-rwxr-xr-xreproduce/software/shell/configure.sh2
7 files changed, 87 insertions, 18 deletions
diff --git a/project b/project
index 29d633d..d6ad891 100755
--- a/project
+++ b/project
@@ -494,22 +494,24 @@ case $operation in
fi
# Run the project's own shell without inheriting any environment
- # from the host.
+ # from the host. The 'TERM' environment variable is necessary for
+ # tools like some text editors.
bdir=`.local/bin/realpath .build`
- instdir=$bdir/software/installed
+ instdir="$bdir"/software/installed
.local/bin/env -i \
- HOME=$bdir \
+ HOME="$bdir" \
+ TERM="$TERM" \
CCACHE_DISABLE=1 \
- PATH=$instdir/bin \
- LDFLAGS=-L$instdir/lib \
- SHELL=$instdir/bin/bash \
- CPPFLAGS=-I$instdir/include \
- LD_LIBRARY_PATH=$instdir/lib \
+ PATH="$instdir"/bin \
+ LDFLAGS=-L"$instdir"/lib \
+ SHELL="$instdir"/bin/bash \
+ CPPFLAGS=-I"$instdir"/include \
+ LD_LIBRARY_PATH="$instdir"/lib \
OMPI_MCA_plm_rsh_agent=/bin/false \
- PYTHONPATH=$instdir/lib/python/site-packages \
- PYTHONPATH3=$instdir/lib/python/site-packages \
+ PYTHONPATH="$instdir"/lib/python/site-packages \
+ PYTHONPATH3="$instdir"/lib/python/site-packages \
PS1="[\[\033[32m\](maneage)\[\033[00m\] \u@\h \W]$ " \
- $instdir/bin/bash
+ "$instdir"/bin/bash
;;
diff --git a/reproduce/software/config/checksums.conf b/reproduce/software/config/checksums.conf
index b516a61..e7a0e63 100644
--- a/reproduce/software/config/checksums.conf
+++ b/reproduce/software/config/checksums.conf
@@ -44,6 +44,7 @@ make-checksum = ddf0fdcb9ee1b182ef294c5da70c1275288c99bef60e63a25c0abed2ddd44aba
metastore-checksum = b2a5fdde9de5ddc1e6c368d5da1b2e97e4fdbaa138a7be281ccb40a81dd4a9bb1849d36b2d5d3f01205079bace60441f82a7002097ff3a7037340a35b0f1574a
mpc-checksum = 72d657958b07c7812dc9c7cbae093118ce0e454c68a585bfb0e2fa559f1bf7c5f49b93906f580ab3f1073e5b595d23c6494d4d76b765d16dde857a18dd239628
mpfr-checksum = d583555d08863bf36c89b289ae26bae353d9a31f08ee3894520992d2c26e5683c4c9c193d7ad139632f71c0a476d85ea76182702a98bf08dde7b6f65a54f8b88
+nano-checksum = d101e7f4802c079254e79340b433749dcd699fa9adec3f96e4218ec12f066a1f6b0954c27254bb6f019bc370ee2116817717870f4e2bc782c552442f2cc75195
ncurses-checksum = 4c1333dcc30e858e8a9525d4b9aefb60000cfc727bc4a1062bace06ffc4639ad9f6e54f6bdda0e3a0e5ea14de995f96b52b3327d9ec633608792c99a1e8d840d
openssl-checksum = 1523985ba90f38aa91aa6c2d57652f4e243cb2a095ce6336bf34b39b5a9b5b876804299a6825c758b65990e57948da532cca761aa12b10958c97478d04dd6d34
patchelf-checksum = 39745662651cf0a9915685b2767a611ceab4286f8fa57eace342b3f44248431616e8563d4ac6709c97d8534229c73c05470239e462b7e74b36bf629a876dfbad
@@ -86,6 +87,7 @@ cdsclient-checksum = 2d7abf0079189b9dd19cb8919061445fd19ea9f7dfd54e8ceee26b74321
cfitsio-checksum = 08a13931726b0ee15bd4e2ad6dd4debb8268f3b0bc33adadec5c6a29295dd536bcccb3cc949721c6cebac6f43b6118e5e38332ac0ba8a07a43553416d8debae5
cmake-checksum = e0591d5fb234f3e7b74d6d2aad44fbf3e19e69547bd428681ba6ad0461d4f3d2a154605808b4733531d2c66f0e91eb39a179ae0d89a37e92a3f20e9cae691468
eigen-checksum = 34cf600914cce719d61511577ef9cd26fbdcb7a6fad1d0ab8396f98b887fac6a5577d3967e84a8f56225cc50de38f3b91f34f447d14312028383e32b34ea1972
+emacs-checksum = dfb26531d2c19cf9fb56505f03d799654b45e5f9528e777900e8280ed2c1d21e04c52f510528e31e015977c471ae63164cedee6174b7439ebcf479a21fc18064
expat-checksum = 514ff2ef3c93af0b1715b7a08732db33c13a113c4c72422716a22ee26c09235deed71ec55510cee24c33bcd6b2347602bd71ce70a432d5583fb63765ff9e0e09
fftw-checksum = ab918b742a7c7dcb56390a0a0014f517a6dff9a2e4b4591060deeb2c652bf3c6868aa74559a422a276b853289b4b701bdcbd3d4d8c08943acf29167a7be81a38
flex-checksum = b4ef58d4a1d66b213e2f59df06959decf46d26b253cdc3f51cd26e2e2b505461ef23dafa974dd2005b1f0cafa5a83fe9258baf78004b2fdae6dfc299bc17bfd1
@@ -130,6 +132,7 @@ swarp-checksum = 80f4ade59738df3d4c9b47bda04148b53c6ba995d523fa8d1e02fb5d952b607
swig-checksum = 5eaa2e06d8e4197fd02194051db1e518325dbb074a4c55a91099ad9c55193874f577764afc9029409a41bd520a95154095f26e33ef5add5c102bb2c1d98d33eb
tides-checksum = c3360ff0d023b43749ba09a33302ca059f017a157b3ce7cdcf4f1a1578e90d3e7fa420077043adbee6b1ebf94bd698c8d6b279012f36d2a05b4de5351e30e108
util-linux-checksum = c95d26b9037d6b877a247e6aeb58d17aa80f7e1bd6b523a4e0fde559fe07b3d924ece6d373300fefb65d1f206b3f990aeddb3a03605040e72ce6d6ee88591021
+vim-checksum = 06ba43386fcf308520d88d7a68e9bc1fabd824b05078b8f9112500a2ad4e50a91f1a1c2925889b7c06dbce34307f12abf508e2172b05fd283f965cc06552eb6d
wcslib-checksum = 8c98c4b575056e2d966b77a4bc951256d02ecee3a11847e140fd38d93afd0f76b3e906d590c952dc9fc58ceeb1ba062b19d8e1e676ee0032f5b7ed13a9dfa892
xlsxio-checksum = 22870fda7bd4eefd5fea2a9ad7530c9049135129d9b69805091777e6b54b2fc6c3f0e69c6954f36bce54eebbfeccaf637cce9e271a593221a4296d6632470a6c
yaml-checksum = dadd7d8e0d88b5ebab005e5d521d56d541580198aa497370966b98c904586e642a1cd4f3881094eb57624f218d50db77417bbfd0ffdce50340f011e35e8c4c02
diff --git a/reproduce/software/config/urls.conf b/reproduce/software/config/urls.conf
index 34c4d89..417f5ed 100644
--- a/reproduce/software/config/urls.conf
+++ b/reproduce/software/config/urls.conf
@@ -47,6 +47,7 @@
#metastore-url = http://akhlaghi.org/maneage-software
#mpc-url = http://ftp.gnu.org/gnu/mpc
#mpfr-url = http://www.mpfr.org/mpfr-current
+#nano-url = https://www.nano-editor.org/dist/v$(word 1, $(subst ., ,$(nano-version)))
#ncurses-url = http://ftp.gnu.org/gnu/ncurses
#openssl-url = http://www.openssl.org/source
#patchelf-url = http://nixos.org/releases/patchelf/patchelf-$(patchelf-version)
@@ -88,6 +89,7 @@
#cfitsio-url = https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c
#cmake-url = $(shell majv=$$(echo $(cmake-version) | sed -e's/\./ /' | awk '{printf("%d.%d", $$1, $$2)}'); echo https://cmake.org/files/v$$majv)
#eigen-url = http://bitbucket.org/eigen/eigen/get/$(eigen-version).tar.gz
+#emacs-url = http://ftp.gnu.org/gnu/emacs
#expat-url = $(shell vstr=$$(echo $(expat-version) | sed -e's/\./_/g'); echo https://github.com/libexpat/libexpat/releases/download/R_$$vstr/expat-$(expat-version).tar.lz)
#fftw-url = ftp://ftp.fftw.org/pub/fftw
#flex-url = https://github.com/westes/flex/files/981163
@@ -133,6 +135,7 @@
#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
+#vim-url = ftp://ftp.vim.org/pub/vim/unix
#wcslib-url = ftp://ftp.atnf.csiro.au/pub/software/wcslib
#xlsxio-url = https://github.com/brechtsanders/xlsxio/archive
#yaml-url = pyyaml.org/download/libyaml
diff --git a/reproduce/software/config/versions.conf b/reproduce/software/config/versions.conf
index 0a9e21e..0b3a4d2 100644
--- a/reproduce/software/config/versions.conf
+++ b/reproduce/software/config/versions.conf
@@ -44,6 +44,7 @@ make-version = 4.3
metastore-version = 1.1.2-23-fa9170b
mpc-version = 1.1.0
mpfr-version = 4.0.2
+nano-version = 5.2
ncurses-version = 6.2
patchelf-version = 0.10
perl-version = 5.32.0
@@ -94,6 +95,7 @@ cdsclient-version = 3.84
cfitsio-version = 3.48
cmake-version = 3.18.1
eigen-version = 3.3.7
+emacs-version = 27.1
expat-version = 2.2.9
fftw-version = 3.3.8
flex-version = 2.6.4-91-ga631f5d
@@ -134,6 +136,7 @@ swarp-version = 2.38.0
swig-version = 3.0.12
tides-version = 2.0
util-linux-version = 2.35
+vim-version = 8.2
xlsxio-version = 0.2.21
yaml-version = 0.2.5
diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk
index 0b672d8..934580a 100644
--- a/reproduce/software/make/basic.mk
+++ b/reproduce/software/make/basic.mk
@@ -56,8 +56,13 @@ ibdir = $(BDIR)/software/installed/bin
ildir = $(BDIR)/software/installed/lib
ibidir = $(BDIR)/software/installed/version-info/proglib
-# Ultimate Makefile target.
-targets-proglib = low-level-links gcc-$(gcc-version)
+# Ultimate Makefile target. GNU Nano (a simple and very light-weight text
+# editor) is installed by default, it is recommended to have it in the
+# 'basic.mk', so Maneaged projects can be edited on any system (even when
+# there is no command-line text editor is available).
+targets-proglib = low-level-links \
+ gcc-$(gcc-version) \
+ nano-$(nano-version)
all: $(foreach p, $(targets-proglib), $(ibidir)/$(p))
# Define the shell environment
@@ -852,7 +857,8 @@ $(ibidir)/diffutils-$(diffutils-version): \
$(ibidir)/file-$(file-version): $(ibidir)/coreutils-$(coreutils-version)
tarball=file-$(file-version).tar.gz
$(call import-source, $(file-url), $(file-checksum))
- $(call gbuild, file-$(file-version), static,,V=1)
+ $(call gbuild, file-$(file-version), static, \
+ --disable-libseccomp, V=1)
echo "File $(file-version)" > $@
$(ibidir)/findutils-$(findutils-version): \
@@ -1145,11 +1151,22 @@ $(ibidir)/texinfo-$(texinfo-version): \
echo "GNU Texinfo $(texinfo-version)" > $@
$(ibidir)/which-$(which-version): $(ibidir)/coreutils-$(coreutils-version)
- tarball=/which-$(which-version).tar.gz
+ tarball=which-$(which-version).tar.gz
$(call import-source, $(which-url), $(which-checksum))
$(call gbuild, which-$(which-version), static)
echo "GNU Which $(which-version)" > $@
+# GNU Nano is a very light-weight and small, command-line text editor (in
+# total around 3.5 Mb after installation!). It is top-level target in the
+# basic tools (nothing depends on it, it just depends on GCC). This is
+# because some projects may choose to not have it by manually removing it
+# from 'targets-proglib' above (it has no effect on processing after all!).
+$(ibidir)/nano-$(nano-version): $(ibidir)/gcc-$(gcc-version)
+ tarball=nano-$(nano-version).tar.xz
+ $(call import-source, $(nano-url), $(nano-checksum))
+ $(call gbuild, nano-$(nano-version), static)
+ echo "GNU Nano $(nano-version)" > $@
+
diff --git a/reproduce/software/make/high-level.mk b/reproduce/software/make/high-level.mk
index cf9c5a1..3c5e518 100644
--- a/reproduce/software/make/high-level.mk
+++ b/reproduce/software/make/high-level.mk
@@ -449,6 +449,25 @@ $(ibidir)/eigen-$(eigen-version):
rm -rf $(ddir)/eigen-eigen-*
echo "Eigen $(eigen-version)" > $@
+# GNU Emacs is an advanced text editor (among many other things!), so it
+# isn't directly related to the analysis phase of a project. However, it
+# can be useful during the development of a project on systems that don't
+# have it natively. So probably after the project is finished and is ready
+# for publication, you can remove it from 'TARGETS.conf'.
+#
+# However, the full Emacs build has a very large number of dependencies
+# which aren't necessary in many scenarios so we are disabling everything
+# except the core Emacs functionality (using '--without-all') and we are
+# also disabling all graphic user interface features (using '--without-x').
+$(ibidir)/emacs-$(emacs-version):
+ tarball=emacs-$(emacs-version).tar.xz
+ $(call import-source, $(emacs-url), $(emacs-checksum))
+ $(call gbuild, emacs-$(emacs-version), static, \
+ --without-all --without-x \
+ --without-gnutls --with-ns=no, \
+ -j$(numthreads) V=1)
+ echo "GNU Emacs $(emacs-version)" > $@
+
$(ibidir)/expat-$(expat-version):
tarball=expat-$(expat-version).tar.lz
$(call import-source, $(expat-url), $(expat-checksum))
@@ -1374,8 +1393,30 @@ $(ibidir)/xlsxio-$(xlsxio-version): \
rm $(ibdir)/example_xlsxio_*
echo "XLSX I/O $(xlsxio-version)" > $@
-
-
+# VIM is a text editor which doesn't directly affect processing but can be
+# useful in projects during its development, for more see the comment above
+# GNU Emacs.
+$(ibidir)/vim-$(vim-version):
+ tarball=vim-$(vim-version).tar.bz2
+ $(call import-source, $(vim-url), $(vim-checksum))
+ cd $(ddir)
+ tar xf $(tdir)/$$tarball
+ n=$$(echo $(vim-version) | sed -e's|\.||')
+ cd $(ddir)/vim$$n
+ ./configure --prefix=$(idir) \
+ --disable-canberra \
+ --enable-multibyte \
+ --disable-netbeans \
+ --disable-fontset \
+ --disable-gpm \
+ --disable-acl \
+ --disable-gui \
+ --with-x=no
+ make -j$(numthreads)
+ make install
+ cd ..
+ rm -rf vim$$n
+ echo "VIM $(vim-version)" > $@
diff --git a/reproduce/software/shell/configure.sh b/reproduce/software/shell/configure.sh
index 2b4300b..21fe1d6 100755
--- a/reproduce/software/shell/configure.sh
+++ b/reproduce/software/shell/configure.sh
@@ -254,7 +254,7 @@ elif [ x$on_mac_os = xyes ]; then
if [ x$hw_byteorder = x1234 ]; then byte_order="Little Endian";
elif [ x$hw_byteorder = x4321 ]; then byte_order="Big Endian";
fi
- address_size_physical=$(sysctl -n machdep.cpu.address_bits.phyiscal)
+ address_size_physical=$(sysctl -n machdep.cpu.address_bits.physical)
address_size_virtual=$(sysctl -n machdep.cpu.address_bits.virtual)
address_sizes="$address_size_physical bits physical, "
address_sizes+="$address_size_virtual bits virtual"