about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/science/astronomy/cfitsio/default.nix
blob: aa8c3f54e2fe0403094d8f2067a184a3b18016e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{ stdenv
, lib
, fetchurl
, bzip2
, curl
, zlib
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "cfitsio";
  version = "4.3.1";

  src = fetchurl {
    url = "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-${finalAttrs.version}.tar.gz";
    hash = "sha256-R6fI7gVoe+Hh2O7rlPuI8GD7882KTfUsy4jV6w9QYr4=";
  };

  patches = [
    ./darwin-rpath-universal.patch
  ];

  buildInputs = [
    bzip2
    curl
    zlib
  ];

  configureFlags = [
    "--with-bzip2=${bzip2.out}"
    "--enable-reentrant"
  ];

  hardeningDisable = [ "format" ];

  # Shared-only build
  buildFlags = [ "shared" ];

  postPatch = ''
    sed -e '/^install:/s/libcfitsio.a //' -e 's@/bin/@@g' -i Makefile.in
  '';

  meta = {
    homepage = "https://heasarc.gsfc.nasa.gov/fitsio/";
    description = "Library for reading and writing FITS data files";
    longDescription = ''
      CFITSIO is a library of C and Fortran subroutines for reading and
      writing data files in FITS (Flexible Image Transport System) data
      format.  CFITSIO provides simple high-level routines for reading and
      writing FITS files that insulate the programmer from the internal
      complexities of the FITS format.  CFITSIO also provides many
      advanced features for manipulating and filtering the information in
      FITS files.
    '';
    changelog = "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/docs/changes.txt";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ xbreak hjones2199 ];
    platforms = lib.platforms.linux ++ lib.platforms.darwin;
  };
})