From c3bbfb77ad81ad86c43f9e957de5c3e528ee593d Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sun, 17 Jan 2021 18:28:51 +0100 Subject: [PATCH] pkgs/development/mobile: stdenv.lib -> lib --- pkgs/development/mobile/abootimg/default.nix | 4 ++-- pkgs/development/mobile/adb-sync/default.nix | 2 +- pkgs/development/mobile/flashtool/default.nix | 10 +++++----- .../development/mobile/genymotion/default.nix | 10 +++++----- .../mobile/titaniumenv/build-app.nix | 14 ++++++------- .../mobile/titaniumenv/default.nix | 4 ++-- .../mobile/titaniumenv/titaniumsdk-8.2.nix | 4 ++-- .../mobile/titaniumenv/titaniumsdk-8.3.nix | 4 ++-- .../development/mobile/xcodeenv/build-app.nix | 20 +++++++++---------- pkgs/development/mobile/xcodeenv/default.nix | 6 +++--- .../mobile/xcodeenv/simulate-app.nix | 6 +++--- 11 files changed, 42 insertions(+), 42 deletions(-) diff --git a/pkgs/development/mobile/abootimg/default.nix b/pkgs/development/mobile/abootimg/default.nix index d2e43d106081..bec022f08c7e 100644 --- a/pkgs/development/mobile/abootimg/default.nix +++ b/pkgs/development/mobile/abootimg/default.nix @@ -28,10 +28,10 @@ stdenv.mkDerivation { install -D -m444 ./debian/abootimg.1 $out/share/man/man1/abootimg.1; install -D -m 755 abootimg-pack-initrd $out/bin - wrapProgram $out/bin/abootimg-pack-initrd --prefix PATH : ${stdenv.lib.makeBinPath [ coreutils cpio findutils gzip ]} + wrapProgram $out/bin/abootimg-pack-initrd --prefix PATH : ${lib.makeBinPath [ coreutils cpio findutils gzip ]} install -D -m 755 abootimg-unpack-initrd $out/bin - wrapProgram $out/bin/abootimg-unpack-initrd --prefix PATH : ${stdenv.lib.makeBinPath [ cpio gzip ]} + wrapProgram $out/bin/abootimg-unpack-initrd --prefix PATH : ${lib.makeBinPath [ cpio gzip ]} ''; meta = with lib; { diff --git a/pkgs/development/mobile/adb-sync/default.nix b/pkgs/development/mobile/adb-sync/default.nix index fc37eefc2121..c88ac5dbca5e 100644 --- a/pkgs/development/mobile/adb-sync/default.nix +++ b/pkgs/development/mobile/adb-sync/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation { dontBuild = true; installPhase = let - dependencies = stdenv.lib.makeBinPath [ platform-tools socat go-mtpfs adbfs-rootless ]; + dependencies = lib.makeBinPath [ platform-tools socat go-mtpfs adbfs-rootless ]; in '' runHook preInstall diff --git a/pkgs/development/mobile/flashtool/default.nix b/pkgs/development/mobile/flashtool/default.nix index 84c42c895ce1..e00ff3acce02 100644 --- a/pkgs/development/mobile/flashtool/default.nix +++ b/pkgs/development/mobile/flashtool/default.nix @@ -1,4 +1,4 @@ -{ stdenv, requireFile, p7zip, jre, libusb1, platform-tools, gtk2, glib, libXtst }: +{ stdenv, lib, requireFile, p7zip, jre, libusb1, platform-tools, gtk2, glib, libXtst }: # TODO: # @@ -42,7 +42,7 @@ stdenv.mkDerivation rec { sed -i \ -e 's|$(uname -m)|i686|' \ -e 's|export JAVA_HOME=.*|export JAVA_HOME=${jre}|' \ - -e 's|export LD_LIBRARY_PATH=.*|export LD_LIBRARY_PATH=${stdenv.lib.makeLibraryPath [ libXtst glib gtk2 ]}:./x10flasher_lib/linux/lib32|' \ + -e 's|export LD_LIBRARY_PATH=.*|export LD_LIBRARY_PATH=${lib.makeLibraryPath [ libXtst glib gtk2 ]}:./x10flasher_lib/linux/lib32|' \ FlashTool FlashToolConsole ''; @@ -51,12 +51,12 @@ stdenv.mkDerivation rec { mv * $out/ ''; - meta = { + meta = with lib; { homepage = "http://www.flashtool.net/"; description = "S1 flashing software for Sony phones from X10 to Xperia Z Ultra"; - license = stdenv.lib.licenses.unfreeRedistributableFirmware; + license = licenses.unfreeRedistributableFirmware; platforms = [ "i686-linux" ]; - hydraPlatforms = stdenv.lib.platforms.none; + hydraPlatforms = platforms.none; broken = true; }; } diff --git a/pkgs/development/mobile/genymotion/default.nix b/pkgs/development/mobile/genymotion/default.nix index 72a376d39a81..b44315065155 100644 --- a/pkgs/development/mobile/genymotion/default.nix +++ b/pkgs/development/mobile/genymotion/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, makeWrapper, which, zlib, libGL, glib, xorg, libxkbcommon +{ stdenv, lib, fetchurl, makeWrapper, which, zlib, libGL, glib, xorg, libxkbcommon , xdg_utils # For glewinfo , libXmu, libXi, libXext }: @@ -7,7 +7,7 @@ let packages = [ stdenv.cc.cc zlib glib xorg.libX11 libxkbcommon libXmu libXi libXext libGL ]; - libPath = stdenv.lib.makeLibraryPath packages; + libPath = lib.makeLibraryPath packages; in stdenv.mkDerivation rec { pname = "genymotion"; @@ -66,7 +66,7 @@ stdenv.mkDerivation rec { rm $out/libexec/genymotion/libxkbcommon* ''; - meta = { + meta = with lib; { description = "Fast and easy Android emulation"; longDescription = '' Genymotion is a relatively fast Android emulator which comes with @@ -74,8 +74,8 @@ stdenv.mkDerivation rec { suitable for application testing. ''; homepage = "https://www.genymotion.com/"; - license = stdenv.lib.licenses.unfree; + license = licenses.unfree; platforms = ["x86_64-linux"]; - maintainers = [ stdenv.lib.maintainers.puffnfresh ]; + maintainers = [ maintainers.puffnfresh ]; }; } diff --git a/pkgs/development/mobile/titaniumenv/build-app.nix b/pkgs/development/mobile/titaniumenv/build-app.nix index a7e158bd3bb1..82a264e702de 100644 --- a/pkgs/development/mobile/titaniumenv/build-app.nix +++ b/pkgs/development/mobile/titaniumenv/build-app.nix @@ -1,4 +1,4 @@ -{stdenv, composeAndroidPackages, composeXcodeWrapper, titaniumsdk, titanium, alloy, jdk, python, nodejs, which, file}: +{stdenv, lib, composeAndroidPackages, composeXcodeWrapper, titaniumsdk, titanium, alloy, jdk, python, nodejs, which, file}: { name, src, preBuild ? "", target, tiVersion ? null , release ? false, androidKeyStore ? null, androidKeyAlias ? null, androidKeyStorePassword ? null , iosMobileProvisioningProfile ? null, iosCertificateName ? null, iosCertificate ? null, iosCertificatePassword ? null, iosVersion ? "12.1", iosBuildStore ? false @@ -34,14 +34,14 @@ let extraArgs = removeAttrs args [ "name" "preRebuild" "androidsdkArgs" "xcodewrapperArgs" ]; in stdenv.mkDerivation ({ - name = stdenv.lib.replaceChars [" "] [""] name; + name = lib.replaceChars [" "] [""] name; buildInputs = [ nodejs titanium alloy python which file jdk ]; buildPhase = '' ${preBuild} - ${stdenv.lib.optionalString stdenv.isDarwin '' + ${lib.optionalString stdenv.isDarwin '' # Hack that provides a writable alloy package on macOS. Without it the build fails because of a file permission error. alloy=$(dirname $(type -p alloy))/.. cp -rv $alloy/* alloy @@ -51,7 +51,7 @@ stdenv.mkDerivation ({ export HOME=${if target == "iphone" then "/Users/$(whoami)" else "$TMPDIR"} - ${stdenv.lib.optionalString (tiVersion != null) '' + ${lib.optionalString (tiVersion != null) '' # Replace titanium version by the provided one sed -i -e "s|[0-9a-zA-Z\.]*|${tiVersion}|" tiapp.xml ''} @@ -76,7 +76,7 @@ stdenv.mkDerivation ({ export GRADLE_USER_HOME=$TMPDIR/gradle ${if release then '' - ${stdenv.lib.optionalString stdenv.isDarwin '' + ${lib.optionalString stdenv.isDarwin '' # Signing the app does not work with OpenJDK on macOS, use host SDK instead export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)" ''} @@ -171,7 +171,7 @@ 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 '' appname="$(basename $out/*.ipa .ipa)" bundleId=$(grep '[a-zA-Z0-9.]*' tiapp.xml | sed -e 's|||' -e 's|||' -e 's/ //g') version=$(grep '[a-zA-Z0-9.]*' tiapp.xml | sed -e 's|||' -e 's|||' -e 's/ //g') @@ -184,5 +184,5 @@ stdenv.mkDerivation ({ else throw "Target: ${target} is not supported!"} ''; - failureHook = stdenv.lib.optionalString (release && target == "iphone") deleteKeychain; + failureHook = lib.optionalString (release && target == "iphone") deleteKeychain; } // extraArgs) diff --git a/pkgs/development/mobile/titaniumenv/default.nix b/pkgs/development/mobile/titaniumenv/default.nix index 44ec91d7e596..151502a5d160 100644 --- a/pkgs/development/mobile/titaniumenv/default.nix +++ b/pkgs/development/mobile/titaniumenv/default.nix @@ -8,11 +8,11 @@ rec { else throw "Titanium version not supported: "+tiVersion; in import titaniumSdkFile { - inherit (pkgs) stdenv fetchurl unzip makeWrapper; + inherit (pkgs) stdenv lib fetchurl unzip makeWrapper; }; buildApp = import ./build-app.nix { - inherit (pkgs) stdenv python which file jdk nodejs; + inherit (pkgs) stdenv lib python which file jdk nodejs; inherit (pkgs.nodePackages) alloy titanium; inherit (androidenv) composeAndroidPackages; inherit (xcodeenv) composeXcodeWrapper; diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-8.2.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-8.2.nix index 2af53a63b58d..0742247893c3 100644 --- a/pkgs/development/mobile/titaniumenv/titaniumsdk-8.2.nix +++ b/pkgs/development/mobile/titaniumenv/titaniumsdk-8.2.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, unzip, makeWrapper}: +{stdenv, lib, fetchurl, unzip, makeWrapper}: let # Gradle is a build system that bootstraps itself. This is what it actually @@ -87,7 +87,7 @@ stdenv.mkDerivation { # Patch maven central repository with our own local directory. This prevents the builder from downloading Maven artifacts sed -i -e 's|mavenCentral()|maven { url "${fakeMavenRepo}" }|' android/templates/build/proguard.gradle - ${stdenv.lib.optionalString (stdenv.system == "x86_64-darwin") '' + ${lib.optionalString (stdenv.system == "x86_64-darwin") '' # Patch the strip frameworks script in the iPhone build template to not let # it skip the strip phase. This is caused by an assumption on the file # permissions in which Nix deviates from the standard. diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-8.3.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-8.3.nix index b995a566f529..965a385ac56c 100644 --- a/pkgs/development/mobile/titaniumenv/titaniumsdk-8.3.nix +++ b/pkgs/development/mobile/titaniumenv/titaniumsdk-8.3.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, unzip, makeWrapper}: +{stdenv, lib, fetchurl, unzip, makeWrapper}: let # Gradle is a build system that bootstraps itself. This is what it actually @@ -87,7 +87,7 @@ stdenv.mkDerivation { # Patch maven central repository with our own local directory. This prevents the builder from downloading Maven artifacts sed -i -e 's|mavenCentral()|maven { url "${fakeMavenRepo}" }|' android/templates/build/proguard.gradle - ${stdenv.lib.optionalString (stdenv.system == "x86_64-darwin") '' + ${lib.optionalString (stdenv.system == "x86_64-darwin") '' # Patch the strip frameworks script in the iPhone build template to not let # it skip the strip phase. This is caused by an assumption on the file # permissions in which Nix deviates from the standard. 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" < @@ -112,7 +112,7 @@ stdenv.mkDerivation ({ manual method ${signMethod} - ${stdenv.lib.optionalString (signMethod == "enterprise" || signMethod == "ad-hoc") '' + ${lib.optionalString (signMethod == "enterprise" || signMethod == "ad-hoc") '' compileBitcode ''} @@ -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"