Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ca0a44d30419
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f87a18bde2d3
Choose a head ref
  • 10 commits
  • 12 files changed
  • 4 contributors

Commits on Apr 30, 2019

  1. androidndk-pkgs: Fix cc-wrapper flags

    (cherry picked from commit 5f4bf24)
    kmicklas authored and Ken Micklas committed Apr 30, 2019
    Copy the full SHA
    7fdf74b View commit details
  2. androidndk: fixup mess

    New android ndk (18) now uses clang. We were going through the wrapper
    that are provided. This lead to surprising errors when building.
    Ideally we could use the llvm linker as well, but this leads to errors
    as many packages don’t support the llvm linker.
    matthewbauer authored and Ken Micklas committed Apr 30, 2019
    Copy the full SHA
    fcbe865 View commit details
  3. readline: add android patch

    matthewbauer authored and Ken Micklas committed Apr 30, 2019
    Copy the full SHA
    54b18ff View commit details
  4. systems: remove android armv5te platform

    this isn’t useful any more because the ndk we use no longer supports it.
    matthewbauer authored and Ken Micklas committed Apr 30, 2019
    Copy the full SHA
    9e1dd3b View commit details
  5. androidndk-pkgs: Remove -mfloat flag

    Ken Micklas committed Apr 30, 2019
    Copy the full SHA
    f07df17 View commit details

Commits on May 1, 2019

  1. llvm: don’t use targetPlatform

    LLVM should be target independent because it will work with all
    machine types. This is different from GCC where it needs to know what
    target to build ahead of time.
    matthewbauer authored and Ken Micklas committed May 1, 2019
    Copy the full SHA
    2529c0c View commit details
  2. signing-party: 2.8 -> 2.9

    (cherry picked from commit f1e72ef)
    primeos committed May 1, 2019

    Verified

    This commit was signed with the committer’s verified signature.
    primeos Michael Weiss
    Copy the full SHA
    7629cc1 View commit details
  3. signing-party: 2.9 -> 2.10 (security, CVE-2019-11627)

    I switched to fetchFromGitLab for more transparency and because 2.10 is
    not yet available on any Debian mirrors.
    A drawback is that any dates in the man pages will now always be
    set to 1970-01-01, because fetchFromGitLab removes the timestamps from
    $src (not manually but by unpacking the archive).
    
    (cherry picked from commit 3b3a636)
    primeos committed May 1, 2019

    Verified

    This commit was signed with the committer’s verified signature.
    primeos Michael Weiss
    Copy the full SHA
    430e814 View commit details
  4. Merge pull request #60647 from primeos/security-backports-for-19.03

    [19.03] Security backport for signing-party
    primeos authored May 1, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a07df8e View commit details
  5. Merge pull request #60645 from obsidiansystems/km-androidndk-fixes-ba…

    …ckport-19.03
    
    Fix Android NDK for 19.03
    matthewbauer authored May 1, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f87a18b View commit details
8 changes: 0 additions & 8 deletions lib/systems/examples.nix
Original file line number Diff line number Diff line change
@@ -44,14 +44,6 @@ rec {
platform = platforms.aarch64-multiplatform;
};

armv5te-android-prebuilt = rec {
config = "armv5tel-unknown-linux-androideabi";
sdkVer = "21";
ndkVer = "18b";
platform = platforms.armv5te-android;
useAndroidPrebuilt = true;
};

armv7a-android-prebuilt = rec {
config = "armv7a-unknown-linux-androideabi";
sdkVer = "24";
11 changes: 0 additions & 11 deletions lib/systems/platforms.nix
Original file line number Diff line number Diff line change
@@ -253,22 +253,11 @@ rec {
kernelTarget = "zImage";
};

# https://developer.android.com/ndk/guides/abis#armeabi
armv5te-android = {
name = "armeabi";
gcc = {
arch = "armv5te";
float = "soft";
float-abi = "soft";
};
};

# https://developer.android.com/ndk/guides/abis#v7a
armv7a-android = {
name = "armeabi-v7a";
gcc = {
arch = "armv7-a";
float = "hard";
float-abi = "softfp";
fpu = "vfpv3-d16";
};
105 changes: 50 additions & 55 deletions pkgs/development/androidndk-pkgs/androidndk-pkgs.nix
Original file line number Diff line number Diff line change
@@ -18,69 +18,78 @@ let
"x86_64-unknown-linux-gnu" = {
double = "linux-x86_64";
};
"armv5tel-unknown-linux-androideabi" = {
arch = "arm";
triple = "arm-linux-androideabi";
gccVer = "4.8";
"i686-unknown-linux-android" = {
triple = "i686-linux-android";
arch = "x86";
toolchain = "x86";
gccVer = "4.9";
};
"x86_64-unknown-linux-android" = {
triple = "x86_64-linux-android";
arch = "x86_64";
toolchain = "x86_64";
gccVer = "4.9";
};
"armv7a-unknown-linux-androideabi" = {
arch = "arm";
triple = "arm-linux-androideabi";
toolchain = "arm-linux-androideabi";
gccVer = "4.9";
};
"aarch64-unknown-linux-android" = {
arch = "arm64";
triple = "aarch64-linux-android";
toolchain = "aarch64-linux-android";
gccVer = "4.9";
};
}.${config} or
(throw "Android NDK doesn't support ${config}, as far as we know");

hostInfo = ndkInfoFun stdenv.hostPlatform;
targetInfo = ndkInfoFun stdenv.targetPlatform;

prefix = stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) (stdenv.targetPlatform.config + "-");
in

rec {
# Misc tools
binaries = let
ndkBinDir =
"${androidndk}/libexec/android-sdk/ndk-bundle/toolchains/${targetInfo.triple}-${targetInfo.gccVer}/prebuilt/${hostInfo.double}/bin";
ndkGCCLibDir =
"${androidndk}/libexec/android-sdk/ndk-bundle/toolchains/${targetInfo.triple}-${targetInfo.gccVer}/prebuilt/${hostInfo.double}/lib/gcc/${targetInfo.triple}/4.9.x";
binaries = runCommand "ndk-gcc-binutils" {
isClang = true; # clang based cc, but bintools ld
nativeBuildInputs = [ makeWrapper ];
propgatedBuildInputs = [ androidndk ];
} ''
mkdir -p $out/bin
in runCommand "ndk-gcc-binutils" {
isGNU = true; # for cc-wrapper
nativeBuildInputs = [ makeWrapper ];
propgatedBuildInputs = [ androidndk ];
} ''
mkdir -p $out/bin
for prog in ${ndkBinDir}/${targetInfo.triple}-*; do
prog_suffix=$(basename $prog | sed 's/${targetInfo.triple}-//')
cat > $out/bin/${stdenv.targetPlatform.config}-$prog_suffix <<EOF
#! ${stdenv.shell} -e
$prog "\$@"
EOF
chmod +x $out/bin/${stdenv.targetPlatform.config}-$prog_suffix
done
# llvm toolchain
for prog in ${androidndk}/libexec/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/${hostInfo.double}/bin/*; do
ln -s $prog $out/bin/$(basename $prog)
ln -s $prog $out/bin/${prefix}$(basename $prog)
done
ln -s $out/bin/${stdenv.targetPlatform.config}-ld $out/bin/ld
ln -s ${ndkGCCLibDir} $out/lib
'';
# bintools toolchain
for prog in ${androidndk}/libexec/android-sdk/ndk-bundle/toolchains/${targetInfo.toolchain}-${targetInfo.gccVer}/prebuilt/${hostInfo.double}/bin/*; do
prog_suffix=$(basename $prog | sed 's/${targetInfo.triple}-//')
ln -s $prog $out/bin/${stdenv.targetPlatform.config}-$prog_suffix
done
# shitty googly wrappers
rm -f $out/bin/${stdenv.targetPlatform.config}-gcc $out/bin/${stdenv.targetPlatform.config}-g++
'';

binutils = wrapBintoolsWith {
bintools = binaries;
libc = targetAndroidndkPkgs.libraries;
extraBuildCommands = ''
echo "--build-id" >> $out/nix-support/libc-ldflags
'';
};

gcc = wrapCCWith {
clang = wrapCCWith {
cc = binaries;
bintools = binutils;
libc = targetAndroidndkPkgs.libraries;
extraBuildCommands = ''
echo "-D__ANDROID_API__=${stdenv.targetPlatform.sdkVer}" >> $out/nix-support/cc-cflags
echo "-target ${stdenv.targetPlatform.config}" >> $out/nix-support/cc-cflags
echo "-resource-dir=$(echo ${androidndk}/libexec/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/${hostInfo.double}/lib*/clang/*)" >> $out/nix-support/cc-cflags
echo "--gcc-toolchain=${androidndk}/libexec/android-sdk/ndk-bundle/toolchains/${targetInfo.toolchain}-${targetInfo.gccVer}/prebuilt/${hostInfo.double}" >> $out/nix-support/cc-cflags
''
+ lib.optionalString stdenv.targetPlatform.isAarch32 (let
p = stdenv.targetPlatform.platform.gcc or {}
@@ -90,43 +99,29 @@ rec {
(lib.optional (p ? cpu) "-mcpu=${p.cpu}")
(lib.optional (p ? abi) "-mabi=${p.abi}")
(lib.optional (p ? fpu) "-mfpu=${p.fpu}")
(lib.optional (p ? float) "-mfloat=${p.float}")
(lib.optional (p ? float-abi) "-mfloat-abi=${p.float-abi}")
(lib.optional (p ? mode) "-mmode=${p.mode}")
];
in ''
sed -E -i \
$out/bin/${stdenv.targetPlatform.config}-cc \
$out/bin/${stdenv.targetPlatform.config}-c++ \
$out/bin/${stdenv.targetPlatform.config}-gcc \
$out/bin/${stdenv.targetPlatform.config}-g++ \
-e '130i extraBefore+=(-Wl,--fix-cortex-a8)' \
-e 's|^(extraBefore=)\(\)$|\1(${builtins.toString flags})|'
'')
# GCC 4.9 is the first relase with "-fstack-protector"
+ lib.optionalString (lib.versionOlder targetInfo.gccVer "4.9") ''
sed -E \
-i $out/nix-support/add-hardening.sh \
-e 's|(-fstack-protector)-strong|\1|g'
'';
$out/bin/${stdenv.targetPlatform.config}-clang \
$out/bin/${stdenv.targetPlatform.config}-clang++ \
-e 's|^(extraBefore=)\((.*)\)$|\1(\2 -Wl,--fix-cortex-a8 ${builtins.toString flags})|'
'');
};

# Bionic lib C and other libraries.
#
# We use androidndk from the previous stage, else we waste time or get cycles
# cross-compiling packages to wrap incorrectly wrap binaries we don't include
# anyways.
libraries =
let
includePath = "${buildAndroidndk}/libexec/android-sdk/ndk-bundle/sysroot/usr/include";
asmIncludePath = "${buildAndroidndk}/libexec/android-sdk/ndk-bundle/sysroot/usr/include/${targetInfo.triple}";
libPath = "${buildAndroidndk}/libexec/android-sdk/ndk-bundle/platforms/android-${stdenv.hostPlatform.sdkVer}/arch-${hostInfo.arch}/usr/lib/";
in
runCommand "bionic-prebuilt" {} ''
mkdir -p $out
cp -r ${includePath} $out/include
chmod +w $out/include
cp -r ${asmIncludePath}/* $out/include
ln -s ${libPath} $out/lib
'';
libraries = runCommand "bionic-prebuilt" {} ''
mkdir -p $out
cp -r ${buildAndroidndk}/libexec/android-sdk/ndk-bundle/sysroot/usr/include $out/include
chmod +w $out/include
cp -r ${buildAndroidndk}/libexec/android-sdk/ndk-bundle/sysroot/usr/include/${targetInfo.triple}/* $out/include
ln -s ${buildAndroidndk}/libexec/android-sdk/ndk-bundle/platforms/android-${stdenv.hostPlatform.sdkVer}/arch-${hostInfo.arch}/usr/lib $out/lib
'';
}
4 changes: 2 additions & 2 deletions pkgs/development/compilers/llvm/3.8/llvm.nix
Original file line number Diff line number Diff line change
@@ -79,8 +79,8 @@ in stdenv.mkDerivation rec {
"-DLLVM_ENABLE_RTTI=ON"

"-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.targetPlatform.config}"
"-DTARGET_TRIPLE=${stdenv.targetPlatform.config}"
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}"
"-DTARGET_TRIPLE=${stdenv.hostPlatform.config}"
] ++ stdenv.lib.optional enableSharedLibraries [
"-DLLVM_LINK_LLVM_DYLIB=ON"
] ++ stdenv.lib.optional (!isDarwin)
4 changes: 2 additions & 2 deletions pkgs/development/compilers/llvm/3.9/llvm.nix
Original file line number Diff line number Diff line change
@@ -120,8 +120,8 @@ in stdenv.mkDerivation rec {
"-DCOMPILER_RT_INCLUDE_TESTS=OFF" # FIXME: requires clang source code

"-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.targetPlatform.config}"
"-DTARGET_TRIPLE=${stdenv.targetPlatform.config}"
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}"
"-DTARGET_TRIPLE=${stdenv.hostPlatform.config}"
] ++ stdenv.lib.optional enableSharedLibraries [
"-DLLVM_LINK_LLVM_DYLIB=ON"
] ++ stdenv.lib.optional (!isDarwin)
4 changes: 2 additions & 2 deletions pkgs/development/compilers/llvm/4/llvm.nix
Original file line number Diff line number Diff line change
@@ -100,8 +100,8 @@ in stdenv.mkDerivation (rec {
"-DCOMPILER_RT_INCLUDE_TESTS=OFF" # FIXME: requires clang source code

"-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.targetPlatform.config}"
"-DTARGET_TRIPLE=${stdenv.targetPlatform.config}"
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}"
"-DTARGET_TRIPLE=${stdenv.hostPlatform.config}"
]
++ stdenv.lib.optional enableSharedLibraries
"-DLLVM_LINK_LLVM_DYLIB=ON"
2 changes: 1 addition & 1 deletion pkgs/development/compilers/llvm/6/llvm.nix
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@ in stdenv.mkDerivation (rec {
"-DLLVM_ENABLE_FFI=ON"
"-DLLVM_ENABLE_RTTI=ON"
"-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.targetPlatform.config}"
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}"
"-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly"
"-DLLVM_ENABLE_DUMP=ON"
] ++ optionals enableSharedLibraries [
2 changes: 1 addition & 1 deletion pkgs/development/compilers/llvm/7/llvm.nix
Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ in stdenv.mkDerivation (rec {
"-DLLVM_ENABLE_FFI=ON"
"-DLLVM_ENABLE_RTTI=ON"
"-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.targetPlatform.config}"
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}"
"-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly"
"-DLLVM_ENABLE_DUMP=ON"
] ++ optionals enableSharedLibraries [
2 changes: 1 addition & 1 deletion pkgs/development/libraries/readline/6.3.nix
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
patches =
[ ./link-against-ncurses.patch
./no-arch_only-6.3.patch
]
] ++ stdenv.lib.optional stdenv.hostPlatform.useAndroidPrebuilt ./android.patch
++
(let
patch = nr: sha256:
16 changes: 16 additions & 0 deletions pkgs/development/libraries/readline/android.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git histlib.h histlib.h
index c938a10..925ab72 100644
--- histlib.h
+++ histlib.h
@@ -51,9 +51,9 @@
#endif

#ifndef member
-# ifndef strchr
+# if !defined (strchr) && !defined (__STDC__)
extern char *strchr ();
-# endif
+# endif /* !strchr && !__STDC__ */
#define member(c, s) ((c) ? ((char *)strchr ((s), (c)) != (char *)NULL) : 0)
#endif

2 changes: 1 addition & 1 deletion pkgs/stdenv/cross/default.nix
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ in lib.init bootStages ++ [
cc = if crossSystem.useiOSPrebuilt or false
then buildPackages.darwin.iosSdkPkgs.clang
else if crossSystem.useAndroidPrebuilt or false
then buildPackages."androidndkPkgs_${crossSystem.ndkVer}".gcc
then buildPackages."androidndkPkgs_${crossSystem.ndkVer}".clang
else buildPackages.gcc;

extraNativeBuildInputs = old.extraNativeBuildInputs
13 changes: 8 additions & 5 deletions pkgs/tools/security/signing-party/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, autoconf, automake, makeWrapper
{ stdenv, fetchFromGitLab, autoconf, automake, makeWrapper
, python3, perl, perlPackages
, libmd, gnupg1, which, getopt, libpaper, nettools, qprint
, sendmailPath ? "/run/wrappers/bin/sendmail" }:
@@ -13,12 +13,15 @@ let
];
in stdenv.mkDerivation rec {
pname = "signing-party";
version = "2.8";
version = "2.10";
name = "${pname}-${version}";

src = fetchurl {
url = "mirror://debian/pool/main/s/${pname}/${pname}_${version}.orig.tar.gz";
sha256 = "1dfry04gsa8kv7a2kr4p7a4b616sql41hsyff4pmfvrhiv2fz39z";
src = fetchFromGitLab {
domain = "salsa.debian.org";
owner = "signing-party-team";
repo = "signing-party";
rev = "v${version}";
sha256 = "0lq8nmwjmysry0n4jg6vb7bh0lagbyb9pa11ii3s41p1mhzchf2r";
};

# TODO: Get this patch upstream...