summary refs log tree commit diff
path: root/pkgs/development/octave-modules/fits/default.nix
blob: 9d236cb9f1fa50a8b04db4a5681baab8171809be (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
{ buildOctavePackage
, lib
, fetchurl
, cfitsio
, hdf5
, pkg-config
}:

buildOctavePackage rec {
  pname = "fits";
  version = "1.0.7";

  src = fetchurl {
    url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz";
    sha256 = "0jab5wmrpifqphmrfkqcyrlpc0h4y4m735yc3avqqjajz1rl24lm";
  };

  # Found here: https://build.opensuse.org/package/view_file/science/octave-forge-fits/octave-forge-fits.spec?expand=1
  patchPhase = ''
    sed -i -s -e 's/D_NINT/octave::math::x_nint/g' src/*.cc
  '';

  nativeBuildInputs = [
    pkg-config
  ];

  buildInputs = [
    hdf5
  ];

  propagatedBuildInputs = [
    cfitsio
  ];

  meta = with lib; {
    homepage = "https://octave.sourceforge.io/fits/index.html";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ KarlJoad ];
    description = "Functions for reading, and writing FITS (Flexible Image Transport System) files using cfitsio";
  };
}