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

stdenv.mkDerivation {
  pname = "memorymapping";
  version = "unstable-2014-02-20";

  src = fetchFromGitHub {
    owner = "NimbusKit";
    repo = "memorymapping";
    rev = "fc285afe13cb9d56a40c647b8ed6d6bd40636af7";
    sha256 = "sha256-9u/QvK9TDsKxcubINH2OAbx5fXXkKF0+YT7LoLDaF0M=";
  };

  dontConfigure = true;

  buildPhase = ''
    runHook preBuild

    $CC -c src/fmemopen.c
    $AR rcs libmemorymapping.a fmemopen.o
    sed -e '1i#include <stdio.h>' -i src/fmemopen.h

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    install -D libmemorymapping.a "$out"/lib/libmemorymapping.a
    install -D src/fmemopen.h "$out"/include/fmemopen.h

    runHook postInstall
  '';

  meta = with lib; {
    homepage = "https://nimbuskit.github.io/memorymapping/";
    description = "fmemopen for Mac OS and iOS";
    license = licenses.asl20;
    maintainers = with maintainers; [ veprbl ];
    # Uses BSD-style funopen() to implement glibc-style fmemopen().
    # Add more BSDs if you need to.
    platforms = platforms.darwin;
    broken = stdenv.isAarch64;
  };
}