about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/minilibx/default.nix
blob: 0551993e438a2b1f3f20784a0f1b1611bbd70db3 (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
60
61
62
{ lib
, stdenv
, fetchFromGitHub
, installShellFiles
, libX11
, libXext
, unstableGitUpdater
}:

stdenv.mkDerivation {
  pname = "minilibx";
  version = "unstable-2021-10-30";

  src = fetchFromGitHub {
    owner = "42Paris";
    repo = "minilibx-linux";
    rev = "7dc53a411a7d4ae286c60c6229bd1e395b0efb82";
    hash = "sha256-aRYMpaPC7dC6EHmmXugvwcQnaizRCQZKFcQX0K2MLM4=";
  };

  outputs = [ "out" "dev" "man" ];

  nativeBuildInputs = [
    installShellFiles
  ];

  buildInputs = [
    libX11
    libXext
  ];

  dontConfigure = true;

  makefile = "Makefile.mk";

  makeFlags = [
    "CC=${stdenv.cc.targetPrefix}cc"
  ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/{include,lib}
    cp mlx*.h $out/include
    cp libmlx*.a $out/lib
    installManPage man/man*/*

    runHook postInstall
  '';

  passthru = {
    updateScript = unstableGitUpdater { };
  };

  meta = with lib; {
    description = "A simple X-Window (X11R6) programming API in C";
    homepage = "https://github.com/42Paris/minilibx-linux";
    license = licenses.bsd2;
    maintainers = with maintainers; [ wegank ];
    platforms = platforms.unix;
  };
}