diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-10-07 05:46:25 +0200 |
---|---|---|
committer | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-10-07 05:46:25 +0200 |
commit | 6b5f9dde020084cf4981287ba42a241cd4687f72 (patch) | |
tree | a4e49f1e0ec07ff0fe84396d66646613390482fe /pkgs/os-specific/darwin | |
parent | d2f79d7443e96b7ea2beb96528c322530f4a54b3 (diff) |
darwin.ios-deploy: 1.11.0 -> 1.12.2, refactor
Diffstat (limited to 'pkgs/os-specific/darwin')
-rw-r--r-- | pkgs/os-specific/darwin/ios-deploy/default.nix | 71 |
1 files changed, 49 insertions, 22 deletions
diff --git a/pkgs/os-specific/darwin/ios-deploy/default.nix b/pkgs/os-specific/darwin/ios-deploy/default.nix index 6567093700df9..c405ac8e1c8bb 100644 --- a/pkgs/os-specific/darwin/ios-deploy/default.nix +++ b/pkgs/os-specific/darwin/ios-deploy/default.nix @@ -1,35 +1,62 @@ -{ lib, stdenvNoCC, rsync, fetchFromGitHub }: +{ lib +, stdenv +, fetchFromGitHub +, darwin +, testers +}: -# Note this is impure, using system XCode to build ios-deploy. We -# should have a special flag for users to enable this. - -let version = "1.11.0"; -in stdenvNoCC.mkDerivation { +let + privateFrameworks = "/Library/Apple/System/Library/PrivateFrameworks"; +in +stdenv.mkDerivation (finalAttrs: { pname = "ios-deploy"; - inherit version; + version = "1.12.2"; + src = fetchFromGitHub { owner = "ios-control"; repo = "ios-deploy"; - rev = version; - sha256 = "0hqwikdrcnslx4kkw9b0n7n443gzn2gbrw15pp2fnkcw5s0698sc"; + rev = finalAttrs.version; + hash = "sha256-TVGC+f+1ow3b93CK3PhIL70le5SZxxb2ug5OkIg8XCA="; }; - nativeBuildInputs = [ rsync ]; + + buildInputs = [ + darwin.apple_sdk.frameworks.Foundation + ]; + buildPhase = '' - LD=$CC - tmp=$(mktemp -d) - ln -s /usr/bin/xcodebuild $tmp - export PATH="$PATH:$tmp" - xcodebuild -configuration Release SYMROOT=build OBJROOT=$tmp - ''; - checkPhase = '' - xcodebuild test -scheme ios-deploy-tests -configuration Release SYMROOT=build + runHook preBuild + + awk '{ print "\""$0"\\n\""}' src/scripts/lldb.py >> src/ios-deploy/lldb.py.h + clang src/ios-deploy/ios-deploy.m \ + -framework Foundation \ + -F${privateFrameworks} -framework MobileDevice \ + -o ios-deploy + + runHook postBuild ''; + installPhase = '' - install -D build/Release/ios-deploy $out/bin/ios-deploy + runHook preInstall + + install -Dm755 ios-deploy $out/bin/ios-deploy + + runHook postInstall ''; + + __impureHostDeps = [ + privateFrameworks + ]; + + passthru.tests.version = testers.testVersion { + package = finalAttrs.finalPackage; + }; + meta = { + description = "Install and debug iPhone apps from the command line, without using Xcode"; + homepage = "https://github.com/ios-control/ios-deploy"; + license = lib.licenses.gpl3Plus; + mainProgram = "ios-deploy"; + maintainers = with lib.maintainers; [ wegank ]; platforms = lib.platforms.darwin; - description = "Install and debug iOS apps from the command line. Designed to work on un-jailbroken devices"; - license = lib.licenses.gpl3; }; -} +}) |