2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, gtk2-x11 , pkg-config , python3 , gfortran , lesstif
|
2020-04-24 23:36:52 +00:00
|
|
|
, cfitsio , getopt , perl , groff , which, darwin, ncurses
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2022-10-30 15:09:59 +00:00
|
|
|
python3Env = python3.withPackages(ps: with ps; [ numpy setuptools ]);
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2024-05-15 15:35:15 +00:00
|
|
|
srcVersion = "apr24a";
|
|
|
|
version = "20240401_a";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "gildas";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
# For each new release, the upstream developers of Gildas move the
|
|
|
|
# source code of the previous release to a different directory
|
|
|
|
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" ];
|
2024-05-15 15:35:15 +00:00
|
|
|
sha256 = "sha256-Eq6S5S8xrhkCo6O2wUaHnoMDVG9WeiSurGvOc+2JKbM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config groff perl getopt gfortran which ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [ gtk2-x11 lesstif cfitsio python3Env ncurses ]
|
2021-01-17 00:15:33 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation ]);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
patches = [ ./wrapper.patch ]
|
|
|
|
++ lib.optionals stdenv.isDarwin ([ ./clang.patch ./cpp-darwin.patch ]);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
# Workaround for https://github.com/NixOS/nixpkgs/issues/304528
|
|
|
|
env.GAG_CPP = lib.optionalString stdenv.isDarwin "${gfortran.outPath}/bin/cpp";
|
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
NIX_LDFLAGS = lib.optionalString stdenv.isDarwin (with darwin.apple_sdk.frameworks; "-F${CoreFoundation}/Library/Frameworks");
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configurePhase=''
|
|
|
|
substituteInPlace admin/wrapper.sh --replace '%%OUT%%' $out
|
|
|
|
substituteInPlace admin/wrapper.sh --replace '%%PYTHONHOME%%' ${python3Env}
|
|
|
|
substituteInPlace utilities/main/gag-makedepend.pl --replace '/usr/bin/perl' ${perl}/bin/perl
|
|
|
|
source admin/gildas-env.sh -c gfortran -o openmp
|
|
|
|
echo "gag_doc: $out/share/doc/" >> kernel/etc/gag.dico.lcl
|
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
userExec = "astro class greg imager mapping sic";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall=''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -a ../gildas-exe-${srcVersion}/* $out
|
|
|
|
mv $out/$GAG_EXEC_SYSTEM $out/libexec
|
2023-10-09 19:29:22 +00:00
|
|
|
for i in ${userExec} ; do
|
|
|
|
cp admin/wrapper.sh $out/bin/$i
|
|
|
|
chmod 755 $out/bin/$i
|
2020-04-24 23:36:52 +00:00
|
|
|
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).'';
|
|
|
|
homepage = "http://www.iram.fr/IRAMFR/GILDAS/gildas.html";
|
2021-01-17 00:15:33 +00:00
|
|
|
license = lib.licenses.free;
|
|
|
|
maintainers = [ lib.maintainers.bzizou lib.maintainers.smaret ];
|
|
|
|
platforms = lib.platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|