aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/libraries/jxrlib/default.nix
blob: f0f5b9d77934a94b3358dae999f3e7d87190b654 (plain)
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
{ stdenv, fetchFromGitHub, python }:

stdenv.mkDerivation rec {
  pname = "jxrlib";
  version = "1.1";

  # Use the source from a fork on github because CodePlex does not
  # deliver an easily downloadable tarball.
  src = fetchFromGitHub {
    owner = "4creators";
    repo = pname;
    rev = "f7521879862b9085318e814c6157490dd9dbbdb4";
    sha256 = "0rk3hbh00nw0wgbfbqk1szrlfg3yq7w6ar16napww3nrlm9cj65w";
  };

  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
    substituteInPlace Makefile \
      --replace '-shared' '-dynamiclib -undefined dynamic_lookup' \
      --replace '.so' '.dylib'
  '';

  nativeBuildInputs = [ python ];

  makeFlags = [ "DIR_INSTALL=$(out)" "SHARED=1" ];

  meta = with stdenv.lib; {
    description = "Implementation of the JPEG XR image codec standard";
    homepage = "https://jxrlib.codeplex.com";
    license = licenses.bsd2;
    platforms = platforms.unix;
    maintainers = with maintainers; [ romildo ];
  };
}