about summary refs log tree commit diff
path: root/pkgs/development/libraries/libcs50/default.nix
blob: 14c8190ccbf2a2af1f76e59cd945785a4f83f45f (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
{ lib, stdenv, fetchFromGitHub }:

stdenv.mkDerivation (finalAttrs: {
  pname = "libcs50";
  version = "11.0.2";

  src = fetchFromGitHub {
    owner = "cs50";
    repo = "libcs50";
    rev = "v${finalAttrs.version}";
    hash = "sha256-A4CEU5wfwykVTDIsKZnQ8co+6RwBGYGZEZxRFzQTKBI=";
  };

  installPhase = ''
    runHook preInstall
    mkdir $out
    cp -R build/lib $out/lib
    cp -R build/include $out/include
    ln -sf $out/lib/libcs50.so.11.0.2 $out/lib/libcs50.so.11
    runHook postInstall
  '';

  meta = with lib; {
    homepage = "https://github.com/cs50/libcs50";
    description = "CS50 Library for C";
    license = licenses.gpl3Only;
  };
})