Merge pull request #299961 from wegank/insert-dylib-refactor

darwin.insert_dylib: refactor, drop xcbuildHook
This commit is contained in:
Weijia Wang 2024-04-03 13:20:07 +02:00 committed by GitHub
commit 5c20a69c8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,22 +1,43 @@
{ lib, stdenv, fetchFromGitHub, xcbuildHook }: {
lib,
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "insert_dylib"; pname = "insert-dylib";
version = "unstable-2016-08-28"; version = "0-unstable-2016-08-28";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "Tyilo"; owner = "Tyilo";
repo = "insert_dylib"; repo = "insert_dylib";
rev = "c8beef66a08688c2feeee2c9b6eaf1061c2e67a9"; rev = "c8beef66a08688c2feeee2c9b6eaf1061c2e67a9";
sha256 = "0az38y06pvvy9jf2wnzdwp9mp98lj6nr0ldv0cs1df5p9x2qvbya"; hash = "sha256-yq+NRU+3uBY0A7tRkK2RFKVb0+XtWy6cTH7va4BH4ys=";
}; };
nativeBuildInputs = [ xcbuildHook ]; buildPhase = ''
runHook preBuild
installPhase = '' mkdir -p Products/Release
mkdir -p $out/bin $CC -o Products/Release/insert_dylib insert_dylib/main.c
install -m755 Products/Release/insert_dylib $out/bin
runHook postBuild
''; '';
meta.platforms = lib.platforms.darwin; 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;
};
} }