2021-01-19 07:50:56 +01:00
|
|
|
{ lib, stdenv, fetchurl, gtk2-x11 , pkg-config , python3 , gfortran , lesstif
|
2020-01-07 14:43:36 +01:00
|
|
|
, cfitsio , getopt , perl , groff , which, darwin, ncurses
|
2018-05-31 14:00:33 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2022-10-19 22:12:52 +02:00
|
|
|
python3Env = python3.withPackages(ps: with ps; [ numpy setuptools ]);
|
2018-05-31 14:00:33 +02:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-10-12 16:42:29 +02:00
|
|
|
srcVersion = "oct22b";
|
|
|
|
version = "20221001_b";
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "gildas";
|
2018-05-31 14:00:33 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-09-06 16:10:21 +02:00
|
|
|
# For each new release, the upstream developers of Gildas move the
|
|
|
|
# source code of the previous release to a different directory
|
2019-04-01 14:53:02 +02:00
|
|
|
urls = [ "http://www.iram.fr/~gildas/dist/gildas-src-${srcVersion}.tar.xz"
|
|
|
|
"http://www.iram.fr/~gildas/dist/archive/gildas/gildas-src-${srcVersion}.tar.xz" ];
|
2022-10-12 16:42:29 +02:00
|
|
|
sha256 = "sha256-MGfU2gzBbJ8ITpU7OiwCaHbi8s9Y6gvcAvSUuEZjfqk=";
|
2018-05-31 14:00:33 +02:00
|
|
|
};
|
|
|
|
|
2021-01-19 07:50:56 +01:00
|
|
|
nativeBuildInputs = [ pkg-config groff perl getopt gfortran which ];
|
2018-05-31 14:00:33 +02:00
|
|
|
|
2020-01-07 14:43:36 +01:00
|
|
|
buildInputs = [ gtk2-x11 lesstif cfitsio python3Env ncurses ]
|
2021-01-15 14:21:58 +01:00
|
|
|
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation ]);
|
2018-05-31 14:00:33 +02:00
|
|
|
|
2022-10-19 22:12:52 +02:00
|
|
|
patches = [ ./wrapper.patch ./clang.patch ./aarch64.patch ./python-ldflags.patch ];
|
2018-05-31 14:00:33 +02:00
|
|
|
|
2021-01-15 14:21:58 +01:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument";
|
2018-09-05 12:17:05 +02:00
|
|
|
|
2021-01-15 14:21:58 +01:00
|
|
|
NIX_LDFLAGS = lib.optionalString stdenv.isDarwin (with darwin.apple_sdk.frameworks; "-F${CoreFoundation}/Library/Frameworks");
|
2019-08-01 15:48:16 +02:00
|
|
|
|
2018-05-31 14:00:33 +02:00
|
|
|
configurePhase=''
|
|
|
|
substituteInPlace admin/wrapper.sh --replace '%%OUT%%' $out
|
2020-01-07 14:43:36 +01:00
|
|
|
substituteInPlace admin/wrapper.sh --replace '%%PYTHONHOME%%' ${python3Env}
|
2018-07-09 19:23:22 +02:00
|
|
|
substituteInPlace utilities/main/gag-makedepend.pl --replace '/usr/bin/perl' ${perl}/bin/perl
|
2018-06-26 17:15:51 +02:00
|
|
|
source admin/gildas-env.sh -c gfortran -o openmp
|
2018-05-31 14:00:33 +02:00
|
|
|
echo "gag_doc: $out/share/doc/" >> kernel/etc/gag.dico.lcl
|
|
|
|
'';
|
|
|
|
|
2018-06-14 09:31:51 +02:00
|
|
|
postInstall=''
|
2018-05-31 14:00:33 +02:00
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -a ../gildas-exe-${srcVersion}/* $out
|
|
|
|
mv $out/$GAG_EXEC_SYSTEM $out/libexec
|
|
|
|
cp admin/wrapper.sh $out/bin/gildas-wrapper.sh
|
|
|
|
chmod 755 $out/bin/gildas-wrapper.sh
|
|
|
|
for i in $out/libexec/bin/* ; do
|
|
|
|
ln -s $out/bin/gildas-wrapper.sh $out/bin/$(basename "$i")
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Radioastronomy data analysis software";
|
|
|
|
longDescription = ''
|
|
|
|
GILDAS is a collection of state-of-the-art software
|
|
|
|
oriented toward (sub-)millimeter radioastronomical
|
|
|
|
applications (either single-dish or interferometer).
|
|
|
|
It is daily used to reduce all data acquired with the
|
|
|
|
IRAM 30M telescope and Plateau de Bure Interferometer
|
|
|
|
PDBI (except VLBI observations). GILDAS is easily
|
|
|
|
extensible. GILDAS is written in Fortran-90, with a
|
|
|
|
few parts in C/C++ (mainly keyboard interaction,
|
|
|
|
plotting, widgets).'';
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://www.iram.fr/IRAMFR/GILDAS/gildas.html";
|
2021-01-15 14:21:58 +01:00
|
|
|
license = lib.licenses.free;
|
|
|
|
maintainers = [ lib.maintainers.bzizou lib.maintainers.smaret ];
|
|
|
|
platforms = lib.platforms.all;
|
2022-10-13 15:45:20 +02:00
|
|
|
broken = stdenv.isDarwin && stdenv.isAarch64;
|
2018-05-31 14:00:33 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|