diff options
author | Pavol Rusnak <pavol@rusnak.io> | 2021-01-17 18:28:51 +0100 |
---|---|---|
committer | Pavol Rusnak <pavol@rusnak.io> | 2021-01-21 20:45:23 +0100 |
commit | c3bbfb77ad81ad86c43f9e957de5c3e528ee593d (patch) | |
tree | 61b780a90857ebfcf6905ec7c52d179feb2085d6 /pkgs/development/mobile/xcodeenv | |
parent | 7ed3d2df76cd1f637c6163858ac0e1db9cdf7b00 (diff) | |
download | nixlib-c3bbfb77ad81ad86c43f9e957de5c3e528ee593d.tar nixlib-c3bbfb77ad81ad86c43f9e957de5c3e528ee593d.tar.gz nixlib-c3bbfb77ad81ad86c43f9e957de5c3e528ee593d.tar.bz2 nixlib-c3bbfb77ad81ad86c43f9e957de5c3e528ee593d.tar.lz nixlib-c3bbfb77ad81ad86c43f9e957de5c3e528ee593d.tar.xz nixlib-c3bbfb77ad81ad86c43f9e957de5c3e528ee593d.tar.zst nixlib-c3bbfb77ad81ad86c43f9e957de5c3e528ee593d.zip |
pkgs/development/mobile: stdenv.lib -> lib
Diffstat (limited to 'pkgs/development/mobile/xcodeenv')
-rw-r--r-- | pkgs/development/mobile/xcodeenv/build-app.nix | 20 | ||||
-rw-r--r-- | pkgs/development/mobile/xcodeenv/default.nix | 6 | ||||
-rw-r--r-- | pkgs/development/mobile/xcodeenv/simulate-app.nix | 6 |
3 files changed, 16 insertions, 16 deletions
diff --git a/pkgs/development/mobile/xcodeenv/build-app.nix b/pkgs/development/mobile/xcodeenv/build-app.nix index adf64f9561c6..ae8416c8d769 100644 --- a/pkgs/development/mobile/xcodeenv/build-app.nix +++ b/pkgs/development/mobile/xcodeenv/build-app.nix @@ -1,4 +1,4 @@ -{stdenv, composeXcodeWrapper}: +{stdenv, lib, composeXcodeWrapper}: { name , src , sdkVersion ? "13.1" @@ -53,13 +53,13 @@ let extraArgs = removeAttrs args ([ "name" "scheme" "xcodeFlags" "release" "certificateFile" "certificatePassword" "provisioningProfile" "signMethod" "generateIPA" "generateXCArchive" "enableWirelessDistribution" "installURL" "bundleId" "version" ] ++ builtins.attrNames xcodewrapperFormalArgs); in stdenv.mkDerivation ({ - name = stdenv.lib.replaceChars [" "] [""] name; # iOS app names can contain spaces, but in the Nix store this is not allowed + name = lib.replaceChars [" "] [""] name; # iOS app names can contain spaces, but in the Nix store this is not allowed buildPhase = '' # Be sure that the Xcode wrapper has priority over everything else. # When using buildInputs this does not seem to be the case. export PATH=${xcodewrapper}/bin:$PATH - ${stdenv.lib.optionalString release '' + ${lib.optionalString release '' export HOME=/Users/$(whoami) keychainName="$(basename $out)" @@ -91,10 +91,10 @@ stdenv.mkDerivation ({ # Do the building export LD=/usr/bin/clang # To avoid problem with -isysroot parameter that is unrecognized by the stock ld. Comparison with an impure build shows that it uses clang instead. Ugly, but it works - xcodebuild -target ${_target} -configuration ${_configuration} ${stdenv.lib.optionalString (scheme != null) "-scheme ${scheme}"} -sdk ${_sdk} TARGETED_DEVICE_FAMILY="1, 2" ONLY_ACTIVE_ARCH=NO CONFIGURATION_TEMP_DIR=$TMPDIR CONFIGURATION_BUILD_DIR=$out ${if generateIPA || generateXCArchive then "-archivePath \"${name}.xcarchive\" archive" else ""} ${if release then '' PROVISIONING_PROFILE=$PROVISIONING_PROFILE OTHER_CODE_SIGN_FLAGS="--keychain $HOME/Library/Keychains/$keychainName-db"'' else ""} ${xcodeFlags} + xcodebuild -target ${_target} -configuration ${_configuration} ${lib.optionalString (scheme != null) "-scheme ${scheme}"} -sdk ${_sdk} TARGETED_DEVICE_FAMILY="1, 2" ONLY_ACTIVE_ARCH=NO CONFIGURATION_TEMP_DIR=$TMPDIR CONFIGURATION_BUILD_DIR=$out ${if generateIPA || generateXCArchive then "-archivePath \"${name}.xcarchive\" archive" else ""} ${if release then '' PROVISIONING_PROFILE=$PROVISIONING_PROFILE OTHER_CODE_SIGN_FLAGS="--keychain $HOME/Library/Keychains/$keychainName-db"'' else ""} ${xcodeFlags} - ${stdenv.lib.optionalString release '' - ${stdenv.lib.optionalString generateIPA '' + ${lib.optionalString release '' + ${lib.optionalString generateIPA '' # Create export plist file cat > "${name}.plist" <<EOF <?xml version="1.0" encoding="UTF-8"?> @@ -112,7 +112,7 @@ stdenv.mkDerivation ({ <string>manual</string> <key>method</key> <string>${signMethod}</string> - ${stdenv.lib.optionalString (signMethod == "enterprise" || signMethod == "ad-hoc") '' + ${lib.optionalString (signMethod == "enterprise" || signMethod == "ad-hoc") '' <key>compileBitcode</key> <false/> ''} @@ -127,14 +127,14 @@ stdenv.mkDerivation ({ mkdir -p $out/nix-support echo "file binary-dist \"$(echo $out/*.ipa)\"" > $out/nix-support/hydra-build-products - ${stdenv.lib.optionalString enableWirelessDistribution '' + ${lib.optionalString enableWirelessDistribution '' # Add another hacky build product that enables wireless adhoc installations appname="$(basename "$(echo $out/*.ipa)" .ipa)" sed -e "s|@INSTALL_URL@|${installURL}?bundleId=${bundleId}\&version=${appVersion}\&title=$appname|" ${./install.html.template} > $out/''${appname}.html echo "doc install \"$out/''${appname}.html\"" >> $out/nix-support/hydra-build-products ''} ''} - ${stdenv.lib.optionalString generateXCArchive '' + ${lib.optionalString generateXCArchive '' mkdir -p $out mv "${name}.xcarchive" $out ''} @@ -144,7 +144,7 @@ stdenv.mkDerivation ({ ''} ''; - failureHook = stdenv.lib.optionalString release deleteKeychain; + failureHook = lib.optionalString release deleteKeychain; installPhase = "true"; } // extraArgs) diff --git a/pkgs/development/mobile/xcodeenv/default.nix b/pkgs/development/mobile/xcodeenv/default.nix index 47686e6d69e9..90642ca7d9ac 100644 --- a/pkgs/development/mobile/xcodeenv/default.nix +++ b/pkgs/development/mobile/xcodeenv/default.nix @@ -1,4 +1,4 @@ -{stdenv}: +{ stdenv, lib }: rec { composeXcodeWrapper = import ./compose-xcodewrapper.nix { @@ -6,10 +6,10 @@ rec { }; buildApp = import ./build-app.nix { - inherit stdenv composeXcodeWrapper; + inherit stdenv lib composeXcodeWrapper; }; simulateApp = import ./simulate-app.nix { - inherit stdenv composeXcodeWrapper; + inherit stdenv lib composeXcodeWrapper; }; } diff --git a/pkgs/development/mobile/xcodeenv/simulate-app.nix b/pkgs/development/mobile/xcodeenv/simulate-app.nix index 1a55f8366a3b..ea0502eb9818 100644 --- a/pkgs/development/mobile/xcodeenv/simulate-app.nix +++ b/pkgs/development/mobile/xcodeenv/simulate-app.nix @@ -1,4 +1,4 @@ -{stdenv, composeXcodeWrapper}: +{stdenv, lib, composeXcodeWrapper}: {name, app ? null, bundleId ? null, ...}@args: assert app != null -> bundleId != null; @@ -9,7 +9,7 @@ let xcodewrapper = composeXcodeWrapper xcodewrapperArgs; in stdenv.mkDerivation { - name = stdenv.lib.replaceChars [" "] [""] name; + name = lib.replaceChars [" "] [""] name; buildCommand = '' mkdir -p $out/bin cat > $out/bin/run-test-simulator << "EOF" @@ -30,7 +30,7 @@ stdenv.mkDerivation { # Open the simulator instance open -a "$(readlink "${xcodewrapper}/bin/Simulator")" --args -CurrentDeviceUDID $udid - ${stdenv.lib.optionalString (app != null) '' + ${lib.optionalString (app != null) '' # Copy the app and restore the write permissions appTmpDir=$(mktemp -d -t appTmpDir) cp -r "$(echo ${app}/*.app)" "$appTmpDir" |