nix: Avoid bad practice of inheriting pkgs
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
parent
3799df77cc
commit
373291bfc0
|
@ -3,42 +3,42 @@
|
||||||
, pkgs ? (import <nixpkgs> { inherit system config overlays; })
|
, pkgs ? (import <nixpkgs> { inherit system config overlays; })
|
||||||
, target-os }:
|
, target-os }:
|
||||||
|
|
||||||
with pkgs;
|
let
|
||||||
let
|
platform = pkgs.callPackage ./nix/platform.nix { inherit target-os; };
|
||||||
platform = callPackage ./nix/platform.nix { inherit target-os; };
|
# TODO: Try to use stdenv for iOS. The problem is with building iOS as the build is trying to pass parameters to Apple's ld that are meant for GNU's ld (e.g. -dynamiclib)
|
||||||
# TODO: Try to use stdenv for iOS. The problem is with building iOS as the build is trying to pass parameters to Apple's ld that are meant for GNU's ld (e.g. -dynamiclib)
|
stdenv' = pkgs.stdenvNoCC;
|
||||||
_stdenv = stdenvNoCC;
|
gradle = pkgs.gradle_4_10;
|
||||||
statusDesktop = callPackage ./nix/desktop { inherit target-os status-go; stdenv = _stdenv; };
|
statusDesktop = pkgs.callPackage ./nix/desktop { inherit target-os status-go; inherit (pkgs) darwin; stdenv = stdenv'; };
|
||||||
statusMobile = callPackage ./nix/mobile { inherit target-os config status-go; stdenv = _stdenv; };
|
statusMobile = pkgs.callPackage ./nix/mobile { inherit target-os config status-go gradle; inherit (pkgs.xcodeenv) composeXcodeWrapper; stdenv = stdenv'; };
|
||||||
status-go = callPackage ./nix/status-go { inherit target-os; inherit (xcodeenv) composeXcodeWrapper; inherit (statusMobile) xcodewrapperArgs; androidPkgs = statusMobile.androidComposition; };
|
status-go = pkgs.callPackage ./nix/status-go { inherit target-os; inherit (pkgs.xcodeenv) composeXcodeWrapper; inherit (statusMobile) xcodewrapperArgs; androidPkgs = statusMobile.androidComposition; };
|
||||||
nodejs' = nodejs-10_x;
|
nodejs' = pkgs.nodejs-10_x;
|
||||||
yarn' = yarn.override { nodejs = nodejs'; };
|
yarn' = pkgs.yarn.override { nodejs = nodejs'; };
|
||||||
nodeInputs = import ./nix/global-node-packages/output {
|
nodeInputs = import ./nix/global-node-packages/output {
|
||||||
# The remaining dependencies come from Nixpkgs
|
# The remaining dependencies come from Nixpkgs
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
nodejs = nodejs';
|
nodejs = nodejs';
|
||||||
};
|
};
|
||||||
nodePkgBuildInputs = [
|
nodePkgBuildInputs = [
|
||||||
nodejs'
|
nodejs'
|
||||||
python27 # for e.g. gyp
|
pkgs.python27 # for e.g. gyp
|
||||||
yarn'
|
yarn'
|
||||||
] ++ (builtins.attrValues nodeInputs);
|
] ++ (builtins.attrValues nodeInputs);
|
||||||
selectedSources =
|
selectedSources =
|
||||||
lib.optional platform.targetDesktop statusDesktop ++
|
stdenv'.lib.optional platform.targetDesktop statusDesktop ++
|
||||||
lib.optional platform.targetMobile statusMobile;
|
stdenv'.lib.optional platform.targetMobile statusMobile;
|
||||||
|
|
||||||
in _stdenv.mkDerivation rec {
|
in with stdenv'; stdenv'.mkDerivation rec {
|
||||||
name = "status-react-build-env";
|
name = "status-react-build-env";
|
||||||
|
|
||||||
buildInputs = with _stdenv; [
|
buildInputs = with pkgs; [
|
||||||
clojure
|
clojure
|
||||||
leiningen
|
leiningen
|
||||||
maven
|
maven
|
||||||
watchman
|
watchman
|
||||||
] ++ nodePkgBuildInputs
|
] ++ nodePkgBuildInputs
|
||||||
++ lib.optional isDarwin cocoapods
|
++ lib.optional isDarwin cocoapods
|
||||||
++ lib.optional (isDarwin && !platform.targetIOS) clang
|
++ lib.optional (isDarwin && !platform.targetIOS) clang
|
||||||
++ lib.optional (!isDarwin) gcc7
|
++ lib.optional (!isDarwin) gcc7
|
||||||
++ lib.catAttrs "buildInputs" selectedSources;
|
++ lib.catAttrs "buildInputs" selectedSources;
|
||||||
shellHook = lib.concatStrings (lib.catAttrs "shellHook" selectedSources);
|
shellHook = lib.concatStrings (lib.catAttrs "shellHook" selectedSources);
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,6 +139,6 @@ SPEC CHECKSUMS:
|
||||||
SSZipArchive: 41455d4b8d2b6ab93990820b50dc697c2554a322
|
SSZipArchive: 41455d4b8d2b6ab93990820b50dc697c2554a322
|
||||||
yoga: 128daf064cacaede0c3bb27424b6b4c71052e6cd
|
yoga: 128daf064cacaede0c3bb27424b6b4c71052e6cd
|
||||||
|
|
||||||
PODFILE CHECKSUM: 6a6c6a3aad3b4979df3974dc03b0bf305426ce72
|
PODFILE CHECKSUM: 1b73a7ab29d939e99e86434864c837afaf55851c
|
||||||
|
|
||||||
COCOAPODS: 1.5.3
|
COCOAPODS: 1.5.3
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
{ stdenv, pkgs, target-os, status-go }:
|
{ stdenv, callPackage, target-os,
|
||||||
|
cmake, extra-cmake-modules, file, status-go,
|
||||||
|
darwin }:
|
||||||
|
|
||||||
with pkgs;
|
|
||||||
with stdenv;
|
with stdenv;
|
||||||
|
|
||||||
let
|
let
|
||||||
platform = callPackage ../platform.nix { inherit target-os; };
|
platform = callPackage ../platform.nix { inherit target-os; };
|
||||||
linuxPlatform = callPackage ./linux { inherit status-go; };
|
linuxPlatform = callPackage ./linux { inherit status-go; };
|
||||||
darwinPlatform = callPackage ./macos { inherit status-go; };
|
darwinPlatform = callPackage ./macos { inherit status-go darwin; };
|
||||||
windowsPlatform = callPackage ./windows { };
|
windowsPlatform = callPackage ./windows { };
|
||||||
snoreNotifySources = callPackage ./cmake/snorenotify { };
|
snoreNotifySources = callPackage ./cmake/snorenotify { };
|
||||||
qtkeychainSources = callPackage ./cmake/qtkeychain { };
|
qtkeychainSources = callPackage ./cmake/qtkeychain { };
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ stdenv, pkgs, status-go }:
|
{ stdenv, callPackage,
|
||||||
|
appimagekit, patchelf, qt5, status-go }:
|
||||||
|
|
||||||
with pkgs;
|
|
||||||
with stdenv;
|
with stdenv;
|
||||||
|
|
||||||
assert isLinux;
|
assert isLinux;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ stdenv, pkgs, status-go }:
|
{ stdenv, callPackage,
|
||||||
|
darwin, qt5, status-go }:
|
||||||
|
|
||||||
with pkgs;
|
|
||||||
with stdenv;
|
with stdenv;
|
||||||
with darwin.apple_sdk.frameworks;
|
with darwin.apple_sdk.frameworks;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ stdenv, pkgs }:
|
{ stdenv, callPackage,
|
||||||
|
conan, nsis, go }:
|
||||||
|
|
||||||
with pkgs;
|
|
||||||
with stdenv;
|
with stdenv;
|
||||||
|
|
||||||
assert isLinux;
|
assert isLinux;
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
{ config, stdenv, pkgs }:
|
{ config, stdenv, callPackage,
|
||||||
|
androidenv, openjdk, gradle }:
|
||||||
|
|
||||||
with pkgs;
|
|
||||||
with stdenv;
|
with stdenv;
|
||||||
|
|
||||||
let
|
let
|
||||||
gradle = gradle_4_10;
|
|
||||||
androidComposition = androidenv.composeAndroidPackages {
|
androidComposition = androidenv.composeAndroidPackages {
|
||||||
toolsVersion = "26.1.1";
|
toolsVersion = "26.1.1";
|
||||||
platformToolsVersion = "28.0.2";
|
platformToolsVersion = "28.0.2";
|
||||||
|
@ -33,7 +32,7 @@ in
|
||||||
buildInputs = [ openjdk gradle ];
|
buildInputs = [ openjdk gradle ];
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
export JAVA_HOME="${openjdk}"
|
export JAVA_HOME="${openjdk}"
|
||||||
export ANDROID_HOME=${licensedAndroidEnv}
|
export ANDROID_HOME="${licensedAndroidEnv}"
|
||||||
export ANDROID_SDK_ROOT="$ANDROID_HOME"
|
export ANDROID_SDK_ROOT="$ANDROID_HOME"
|
||||||
export ANDROID_NDK_ROOT="${androidComposition.androidsdk}/libexec/android-sdk/ndk-bundle"
|
export ANDROID_NDK_ROOT="${androidComposition.androidsdk}/libexec/android-sdk/ndk-bundle"
|
||||||
export ANDROID_NDK_HOME="$ANDROID_NDK_ROOT"
|
export ANDROID_NDK_HOME="$ANDROID_NDK_ROOT"
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
{ config, stdenv, pkgs, target-os, status-go }:
|
{ config, stdenv, callPackage, target-os,
|
||||||
|
gradle, status-go, composeXcodeWrapper }:
|
||||||
|
|
||||||
with pkgs;
|
|
||||||
with stdenv;
|
with stdenv;
|
||||||
|
|
||||||
let
|
let
|
||||||
gradle = gradle_4_10;
|
platform = callPackage ../platform.nix { inherit target-os; };
|
||||||
platform = pkgs.callPackage ../platform.nix { inherit target-os; };
|
|
||||||
xcodewrapperArgs = {
|
xcodewrapperArgs = {
|
||||||
version = "10.1";
|
version = "10.1";
|
||||||
};
|
};
|
||||||
xcodeWrapper = xcodeenv.composeXcodeWrapper xcodewrapperArgs;
|
xcodeWrapper = composeXcodeWrapper xcodewrapperArgs;
|
||||||
androidPlatform = callPackage ./android.nix { inherit config; };
|
androidPlatform = callPackage ./android.nix { inherit config gradle; };
|
||||||
selectedSources =
|
selectedSources =
|
||||||
[ status-go ] ++
|
[ status-go ] ++
|
||||||
lib.optional platform.targetAndroid androidPlatform;
|
lib.optional platform.targetAndroid androidPlatform;
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
{ config, stdenv, pkgs, androidComposition }:
|
{ config, stdenv, androidComposition }:
|
||||||
|
|
||||||
with pkgs;
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "licensed-android-sdk";
|
name = "licensed-android-sdk";
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
{ buildGoPackage, go, xcodeWrapper, pkgs, stdenv, utils }:
|
{ stdenv, utils, callPackage,
|
||||||
|
buildGoPackage, go, xcodeWrapper }:
|
||||||
|
|
||||||
{ owner, repo, rev, version, goPackagePath, src, host,
|
{ owner, repo, rev, version, goPackagePath, src, host,
|
||||||
|
|
||||||
|
@ -11,7 +12,7 @@
|
||||||
with stdenv;
|
with stdenv;
|
||||||
|
|
||||||
let
|
let
|
||||||
buildStatusGo = pkgs.callPackage ./build-status-go.nix { inherit buildGoPackage go xcodeWrapper utils; };
|
buildStatusGo = callPackage ./build-status-go.nix { inherit buildGoPackage go xcodeWrapper utils; };
|
||||||
|
|
||||||
args = removeAttrs args' [ "goBuildFlags" "goBuildLdFlags" "outputFileName" "hostSystem" ]; # Remove desktop-only arguments from args
|
args = removeAttrs args' [ "goBuildFlags" "goBuildLdFlags" "outputFileName" "hostSystem" ]; # Remove desktop-only arguments from args
|
||||||
buildStatusGoDesktopLib = buildStatusGo (args // {
|
buildStatusGoDesktopLib = buildStatusGo (args // {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
{ buildGoPackage, go, gomobile, openjdk, xcodeWrapper, pkgs, stdenv, utils }:
|
{ stdenv, utils, callPackage,
|
||||||
|
buildGoPackage, go, gomobile, openjdk, xcodeWrapper }:
|
||||||
|
|
||||||
{ owner, repo, rev, version, goPackagePath, src, host,
|
{ owner, repo, rev, version, goPackagePath, src, host,
|
||||||
|
|
||||||
|
@ -11,7 +12,7 @@ with stdenv;
|
||||||
|
|
||||||
let
|
let
|
||||||
targetConfig = config;
|
targetConfig = config;
|
||||||
buildStatusGo = pkgs.callPackage ./build-status-go.nix { inherit buildGoPackage go xcodeWrapper utils; };
|
buildStatusGo = callPackage ./build-status-go.nix { inherit buildGoPackage go xcodeWrapper utils; };
|
||||||
|
|
||||||
args = removeAttrs args' [ "config" "goBuildFlags" "goBuildLdFlags" ]; # Remove mobile-only arguments from args
|
args = removeAttrs args' [ "config" "goBuildFlags" "goBuildLdFlags" ]; # Remove mobile-only arguments from args
|
||||||
buildStatusGoMobileLib = buildStatusGo (args // {
|
buildStatusGoMobileLib = buildStatusGo (args // {
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
{ target-os, stdenv, buildGoPackage, go, pkgs, fetchFromGitHub, openjdk, androidPkgs, composeXcodeWrapper, xcodewrapperArgs ? {} }:
|
{ target-os, stdenv, callPackage,
|
||||||
|
buildGoPackage, go, fetchFromGitHub, openjdk,
|
||||||
|
androidPkgs, composeXcodeWrapper, xcodewrapperArgs ? {} }:
|
||||||
|
|
||||||
with stdenv;
|
with stdenv;
|
||||||
|
|
||||||
let
|
let
|
||||||
platform = pkgs.callPackage ../platform.nix { inherit target-os; };
|
platform = callPackage ../platform.nix { inherit target-os; };
|
||||||
utils = pkgs.callPackage ../utils.nix { inherit xcodeWrapper; };
|
utils = callPackage ../utils.nix { inherit xcodeWrapper; };
|
||||||
gomobile = pkgs.callPackage ./gomobile { inherit (androidPkgs) platform-tools; inherit composeXcodeWrapper xcodewrapperArgs utils; };
|
gomobile = callPackage ./gomobile { inherit (androidPkgs) platform-tools; inherit composeXcodeWrapper xcodewrapperArgs utils; };
|
||||||
buildStatusGoDesktopLib = pkgs.callPackage ./build-desktop-status-go.nix { inherit buildGoPackage go pkgs xcodeWrapper utils; };
|
buildStatusGoDesktopLib = callPackage ./build-desktop-status-go.nix { inherit buildGoPackage go xcodeWrapper utils; };
|
||||||
buildStatusGoMobileLib = pkgs.callPackage ./build-mobile-status-go.nix { inherit buildGoPackage go gomobile pkgs xcodeWrapper utils; };
|
buildStatusGoMobileLib = callPackage ./build-mobile-status-go.nix { inherit buildGoPackage go gomobile xcodeWrapper utils; };
|
||||||
extractStatusGoConfig = f: lib.last (lib.splitString "\n" (lib.fileContents f));
|
extractStatusGoConfig = f: lib.last (lib.splitString "\n" (lib.fileContents f));
|
||||||
owner = lib.fileContents ../../STATUS_GO_OWNER;
|
owner = lib.fileContents ../../STATUS_GO_OWNER;
|
||||||
version = extractStatusGoConfig ../../STATUS_GO_VERSION; # TODO: Simplify this path search with lib.locateDominatingFile
|
version = extractStatusGoConfig ../../STATUS_GO_VERSION; # TODO: Simplify this path search with lib.locateDominatingFile
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{ stdenv, pkgs, utils, buildGoPackage, fetchgit,
|
{ stdenv, utils, fetchgit,
|
||||||
glibc, ncurses5, zlib, makeWrapper, patchelf,
|
buildGoPackage, glibc, ncurses5, zlib, makeWrapper, patchelf,
|
||||||
platform-tools, composeXcodeWrapper, xcodewrapperArgs ? {}
|
platform-tools, composeXcodeWrapper, xcodewrapperArgs ? {}
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,6 @@ if [ ! -f .babelrc ] || [ $(readlink .babelrc) != "${PLATFORM_FOLDER}/.babelrc"
|
||||||
ln -sf ${PLATFORM_FOLDER}/metro.config.js metro.config.js
|
ln -sf ${PLATFORM_FOLDER}/metro.config.js metro.config.js
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -rf /home/jenkins/.cache/yarn/v4/.tmp/6ec8ff0e65cf4f48c50d7472fa1f10ca
|
|
||||||
rm -rf /Users/jenkins/Library/Caches/Yarn/v4/.tmp/6ec8ff0e65cf4f48c50d7472fa1f10ca
|
|
||||||
yarn install --frozen-lockfile
|
yarn install --frozen-lockfile
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
|
|
Loading…
Reference in New Issue