diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2024-04-03 13:20:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-03 13:20:07 +0200 |
commit | 5c20a69c8cf31425883bd84c91d3fe0b094bee26 (patch) | |
tree | 3500ffa61ecd83cb9159a6f54409b25e5937bfe4 | |
parent | f58a66be4aa20733557ca448387be5e5a59ab193 (diff) | |
parent | 65f9315740e80c70e8c4ed99b3d3cb6486aa5e83 (diff) |
Merge pull request #299961 from wegank/insert-dylib-refactor
darwin.insert_dylib: refactor, drop xcbuildHook
-rw-r--r-- | pkgs/os-specific/darwin/insert_dylib/default.nix | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/pkgs/os-specific/darwin/insert_dylib/default.nix b/pkgs/os-specific/darwin/insert_dylib/default.nix index 7ab9692f0d427..f3ea2c9a09ebe 100644 --- a/pkgs/os-specific/darwin/insert_dylib/default.nix +++ b/pkgs/os-specific/darwin/insert_dylib/default.nix @@ -1,22 +1,43 @@ -{ lib, stdenv, fetchFromGitHub, xcbuildHook }: +{ + lib, + stdenv, + fetchFromGitHub, +}: stdenv.mkDerivation { - pname = "insert_dylib"; - version = "unstable-2016-08-28"; + pname = "insert-dylib"; + version = "0-unstable-2016-08-28"; src = fetchFromGitHub { owner = "Tyilo"; repo = "insert_dylib"; rev = "c8beef66a08688c2feeee2c9b6eaf1061c2e67a9"; - sha256 = "0az38y06pvvy9jf2wnzdwp9mp98lj6nr0ldv0cs1df5p9x2qvbya"; + hash = "sha256-yq+NRU+3uBY0A7tRkK2RFKVb0+XtWy6cTH7va4BH4ys="; }; - nativeBuildInputs = [ xcbuildHook ]; + buildPhase = '' + runHook preBuild + + mkdir -p Products/Release + $CC -o Products/Release/insert_dylib insert_dylib/main.c + + runHook postBuild + ''; installPhase = '' - mkdir -p $out/bin - install -m755 Products/Release/insert_dylib $out/bin + runHook preInstall + + install -Dm755 Products/Release/insert_dylib -t $out/bin + + runHook postInstall ''; - meta.platforms = lib.platforms.darwin; + 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; + }; } |