diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2019-12-02 13:34:24 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-02 13:34:24 -0500 |
commit | 0505c5125ce56aeeb8569b816dec74d757f3050a (patch) | |
tree | 7b070b31db814a355c758b47c5d12bf14ece1b25 /lib | |
parent | 7263951cc87a9cd0bd377cef83c9241d0dffb665 (diff) | |
parent | 9fe1b95c3d62816418ce4422ec138def38bfcbe6 (diff) | |
download | nixlib-0505c5125ce56aeeb8569b816dec74d757f3050a.tar nixlib-0505c5125ce56aeeb8569b816dec74d757f3050a.tar.gz nixlib-0505c5125ce56aeeb8569b816dec74d757f3050a.tar.bz2 nixlib-0505c5125ce56aeeb8569b816dec74d757f3050a.tar.lz nixlib-0505c5125ce56aeeb8569b816dec74d757f3050a.tar.xz nixlib-0505c5125ce56aeeb8569b816dec74d757f3050a.tar.zst nixlib-0505c5125ce56aeeb8569b816dec74d757f3050a.zip |
Merge branch 'master' into static-fixes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/default.nix | 3 | ||||
-rw-r--r-- | lib/strings.nix | 17 | ||||
-rw-r--r-- | lib/systems/default.nix | 1 | ||||
-rw-r--r-- | lib/systems/doubles.nix | 3 | ||||
-rw-r--r-- | lib/systems/examples.nix | 10 | ||||
-rw-r--r-- | lib/systems/inspect.nix | 1 | ||||
-rw-r--r-- | lib/systems/parse.nix | 5 |
7 files changed, 36 insertions, 4 deletions
diff --git a/lib/default.nix b/lib/default.nix index 74d508ec1d6e..8af531525860 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -84,7 +84,8 @@ let hasInfix hasPrefix hasSuffix stringToCharacters stringAsChars escape escapeShellArg escapeShellArgs replaceChars lowerChars upperChars toLower toUpper addContextFrom splitString - removePrefix removeSuffix versionOlder versionAtLeast getVersion + removePrefix removeSuffix versionOlder versionAtLeast + getName getVersion nameFromURL enableFeature enableFeatureAs withFeature withFeatureAs fixedWidthString fixedWidthNumber isStorePath toInt readPathsFromFile fileContents; diff --git a/lib/strings.nix b/lib/strings.nix index ae0d74c6721d..6dbb3d3a3e8b 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -473,6 +473,23 @@ rec { versionAtLeast = v1: v2: !versionOlder v1 v2; /* This function takes an argument that's either a derivation or a + derivation's "name" attribute and extracts the name part from that + argument. + + Example: + getName "youtube-dl-2016.01.01" + => "youtube-dl" + getName pkgs.youtube-dl + => "youtube-dl" + */ + getName = x: + let + parse = drv: (builtins.parseDrvName drv).name; + in if isString x + then parse x + else x.pname or (parse x.name); + + /* This function takes an argument that's either a derivation or a derivation's "name" attribute and extracts the version part from that argument. diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 0d51be4b23bc..026117cc34fd 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -37,6 +37,7 @@ rec { else if final.isAndroid then "bionic" else if final.isLinux /* default */ then "glibc" else if final.isMsp430 then "newlib" + else if final.isVc4 then "newlib" else if final.isAvr then "avrlibc" else if final.isNetBSD then "nblibc" # TODO(@Ericson2314) think more about other operating systems diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index 58cff18e6488..700c895b3aba 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -26,7 +26,7 @@ let "riscv32-linux" "riscv64-linux" - "aarch64-none" "avr-none" "arm-none" "i686-none" "x86_64-none" "powerpc-none" "msp430-none" "riscv64-none" "riscv32-none" + "aarch64-none" "avr-none" "arm-none" "i686-none" "x86_64-none" "powerpc-none" "msp430-none" "riscv64-none" "riscv32-none" "vc4-none" ]; allParsed = map parse.mkSystemFromString all; @@ -45,6 +45,7 @@ in { x86_64 = filterDoubles predicates.isx86_64; mips = filterDoubles predicates.isMips; riscv = filterDoubles predicates.isRiscV; + vc4 = filterDoubles predicates.isVc4; cygwin = filterDoubles predicates.isCygwin; darwin = filterDoubles predicates.isDarwin; diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index 511ae1979485..cb8bc3de6c48 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -118,6 +118,12 @@ rec { config = "avr"; }; + vc4 = { + config = "vc4-elf"; + libc = "newlib"; + platform = {}; + }; + arm-embedded = { config = "arm-none-eabi"; libc = "newlib"; @@ -207,7 +213,7 @@ rec { # 32 bit mingw-w64 mingw32 = { - config = "i686-pc-mingw32"; + config = "i686-w64-mingw32"; libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain platform = {}; }; @@ -215,7 +221,7 @@ rec { # 64 bit mingw-w64 mingwW64 = { # That's the triplet they use in the mingw-w64 docs. - config = "x86_64-pc-mingw32"; + config = "x86_64-w64-mingw32"; libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain platform = {}; }; diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index 8a983b3d3637..d1980c6dff81 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -21,6 +21,7 @@ rec { isSparc = { cpu = { family = "sparc"; }; }; isWasm = { cpu = { family = "wasm"; }; }; isMsp430 = { cpu = { family = "msp430"; }; }; + isVc4 = { cpu = { family = "vc4"; }; }; isAvr = { cpu = { family = "avr"; }; }; isAlpha = { cpu = { family = "alpha"; }; }; isJavaScript = { cpu = cpuTypes.js; }; diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index e923334a11bd..6a02dbb51528 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -112,6 +112,8 @@ rec { msp430 = { bits = 16; significantByte = littleEndian; family = "msp430"; }; avr = { bits = 8; family = "avr"; }; + vc4 = { bits = 32; significantByte = littleEndian; family = "vc4"; }; + js = { bits = 32; significantByte = littleEndian; family = "js"; }; }; @@ -208,6 +210,9 @@ rec { vendors = setTypes types.openVendor { apple = {}; pc = {}; + # Actually matters, unlocking some MinGW-w64-specific options in GCC. See + # bottom of https://sourceforge.net/p/mingw-w64/wiki2/Unicode%20apps/ + w64 = {}; none = {}; unknown = {}; |