about summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/insert_dylib/default.nix
blob: f3ea2c9a09ebe546b05bf18f6ca953e7496bc947 (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
{
  lib,
  stdenv,
  fetchFromGitHub,
}:

stdenv.mkDerivation {
  pname = "insert-dylib";
  version = "0-unstable-2016-08-28";

  src = fetchFromGitHub {
    owner = "Tyilo";
    repo = "insert_dylib";
    rev = "c8beef66a08688c2feeee2c9b6eaf1061c2e67a9";
    hash = "sha256-yq+NRU+3uBY0A7tRkK2RFKVb0+XtWy6cTH7va4BH4ys=";
  };

  buildPhase = ''
    runHook preBuild

    mkdir -p Products/Release
    $CC -o Products/Release/insert_dylib insert_dylib/main.c

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    install -Dm755 Products/Release/insert_dylib -t $out/bin

    runHook postInstall
  '';

  meta = {
    description = "Command line utility for inserting a dylib load command into a Mach-O binary";
    homepage = "https://github.com/tyilo/insert_dylib";
    license = lib.licenses.unfree; # no license specified
    mainProgram = "insert_dylib";
    maintainers = with lib.maintainers; [ wegank ];
    platforms = lib.platforms.darwin;
  };
}