flake: Monterey-compatible dyld cache extractor

This commit is contained in:
Michael Roitzsch
2021-10-19 22:51:14 +02:00
parent 563347a6db
commit 2deea7c208
3 changed files with 20 additions and 29 deletions

View File

@@ -51,11 +51,11 @@ sqlite: $(DB)
ACEXTRACT = $(shell nix build --no-write-lock-file .\#acextract && \
readlink result && rm result)/bin/acextract
DSCU = $(shell nix build --no-write-lock-file .\#dyld-shared-cache && \
readlink result && rm result)/bin/dyld_shared_cache_util
DSCEXTRACTOR = $(shell nix build --no-write-lock-file .\#dsc-extractor && \
readlink result && rm result)/bin/dyld-shared-cache-extractor
dyld: /System/Library/dyld/dyld_shared_cache_$(shell uname -m)
$(DSCU) -extract $@ $<
$(DSCEXTRACTOR) $< $@ > /dev/null
find $@ -type f -print0 | xargs -0 chmod a+x
XCODE = $(lastword $(wildcard /Applications/Xcode.app /Applications/Xcode-beta.app))

18
flake.lock generated
View File

@@ -32,19 +32,19 @@
"type": "github"
}
},
"dyld-shared-cache": {
"dsc-extractor": {
"flake": false,
"locked": {
"lastModified": 1601538927,
"narHash": "sha256-56DevKMzcwN8kAWSKr4qrj9R8WgZVW4RCoktiKKfzR0=",
"owner": "antons",
"repo": "dyld-shared-cache-big-sur",
"rev": "abdd035bdfda33998cc80cd06b625cd99563ca33",
"lastModified": 1628793863,
"narHash": "sha256-AOwiwoEE8xYzxhkX7RCkLaiArNZAV2GJWbpqLbKOaXY=",
"owner": "keith",
"repo": "dyld-shared-cache-extractor",
"rev": "9ef13238a8f5717165c91291212d6f32617ab67e",
"type": "github"
},
"original": {
"owner": "antons",
"repo": "dyld-shared-cache-big-sur",
"owner": "keith",
"repo": "dyld-shared-cache-extractor",
"type": "github"
}
},
@@ -67,7 +67,7 @@
"inputs": {
"acextract": "acextract",
"command-line": "command-line",
"dyld-shared-cache": "dyld-shared-cache",
"dsc-extractor": "dsc-extractor",
"nixpkgs": "nixpkgs",
"snap-util": "snap-util",
"snapshot-header": "snapshot-header"

View File

@@ -9,8 +9,8 @@
url = "github:iHTCboy/CommandLine";
flake = false;
};
dyld-shared-cache = {
url = "github:antons/dyld-shared-cache-big-sur";
dsc-extractor = {
url = "github:keith/dyld-shared-cache-extractor";
flake = false;
};
snapshot-header = {
@@ -23,7 +23,7 @@
};
nixpkgs.url = "flake:nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs, acextract, command-line, dyld-shared-cache, snapshot-header, snap-util }: {
outputs = { self, nixpkgs, acextract, command-line, dsc-extractor, snapshot-header, snap-util }: {
packages.x86_64-darwin = {
acextract =
with import nixpkgs { system = "x86_64-darwin"; };
@@ -43,21 +43,12 @@
'';
dontStrip = true;
};
dyld-shared-cache =
dsc-extractor =
with import nixpkgs { system = "x86_64-darwin"; };
stdenv.mkDerivation {
name = "dyld-shared-cache-util-${lib.substring 0 8 self.inputs.dyld-shared-cache.lastModifiedDate}";
src = dyld-shared-cache;
nativeBuildInputs = [ xcbuildHook ];
xcbuildFlags = [
"-scheme dyld_shared_cache_util"
"-configuration Release"
"GCC_PREPROCESSOR_DEFINITIONS=CC_DIGEST_DEPRECATION_WARNING=\\\"\\\""
];
installPhase = ''
mkdir -p $out/bin
cp Products/Release/{dsc_extractor.bundle,dyld_shared_cache_util} $out/bin/
'';
rustPlatform.buildRustPackage {
name = "dsc-extractor-${lib.substring 0 8 self.inputs.dsc-extractor.lastModifiedDate}";
src = dsc-extractor;
cargoHash = "sha256-Z405Q9gV/mJL2WtCstZ+Y9rEw32zgwU1RiYaAjkIcfw=";
};
snap-util =
with import nixpkgs { system = "x86_64-darwin"; };