You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

default.nix 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. { stdenv, fetchurl, gtk2-x11 , pkgconfig , python27 , gfortran , lesstif
  2. , cfitsio , getopt , perl , groff , which, darwin
  3. }:
  4. let
  5. python27Env = python27.withPackages(ps: with ps; [ numpy ]);
  6. in
  7. stdenv.mkDerivation rec {
  8. srcVersion = "oct19a";
  9. version = "20191001_a";
  10. pname = "gildas";
  11. src = fetchurl {
  12. # For each new release, the upstream developers of Gildas move the
  13. # source code of the previous release to a different directory
  14. urls = [ "http://www.iram.fr/~gildas/dist/gildas-src-${srcVersion}.tar.xz"
  15. "http://www.iram.fr/~gildas/dist/archive/gildas/gildas-src-${srcVersion}.tar.xz" ];
  16. sha256 = "0h6g16ra7v8x15j21z5hnb3midwm0asc7bjm9gs5v5sw66vn3wc1";
  17. };
  18. enableParallelBuilding = true;
  19. nativeBuildInputs = [ pkgconfig groff perl getopt gfortran which ];
  20. buildInputs = [ gtk2-x11 lesstif cfitsio python27Env ]
  21. ++ stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation ]);
  22. patches = [ ./wrapper.patch ./clang.patch ./aarch64.patch ];
  23. NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument";
  24. NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin (with darwin.apple_sdk.frameworks; "-F${CoreFoundation}/Library/Frameworks");
  25. configurePhase=''
  26. substituteInPlace admin/wrapper.sh --replace '%%OUT%%' $out
  27. substituteInPlace admin/wrapper.sh --replace '%%PYTHONHOME%%' ${python27Env}
  28. substituteInPlace utilities/main/gag-makedepend.pl --replace '/usr/bin/perl' ${perl}/bin/perl
  29. source admin/gildas-env.sh -c gfortran -o openmp
  30. echo "gag_doc: $out/share/doc/" >> kernel/etc/gag.dico.lcl
  31. '';
  32. postInstall=''
  33. mkdir -p $out/bin
  34. cp -a ../gildas-exe-${srcVersion}/* $out
  35. mv $out/$GAG_EXEC_SYSTEM $out/libexec
  36. cp admin/wrapper.sh $out/bin/gildas-wrapper.sh
  37. chmod 755 $out/bin/gildas-wrapper.sh
  38. for i in $out/libexec/bin/* ; do
  39. ln -s $out/bin/gildas-wrapper.sh $out/bin/$(basename "$i")
  40. done
  41. '';
  42. meta = {
  43. description = "Radioastronomy data analysis software";
  44. longDescription = ''
  45. GILDAS is a collection of state-of-the-art software
  46. oriented toward (sub-)millimeter radioastronomical
  47. applications (either single-dish or interferometer).
  48. It is daily used to reduce all data acquired with the
  49. IRAM 30M telescope and Plateau de Bure Interferometer
  50. PDBI (except VLBI observations). GILDAS is easily
  51. extensible. GILDAS is written in Fortran-90, with a
  52. few parts in C/C++ (mainly keyboard interaction,
  53. plotting, widgets).'';
  54. homepage = http://www.iram.fr/IRAMFR/GILDAS/gildas.html;
  55. license = stdenv.lib.licenses.free;
  56. maintainers = [ stdenv.lib.maintainers.bzizou stdenv.lib.maintainers.smaret ];
  57. platforms = stdenv.lib.platforms.all;
  58. };
  59. }