Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions deps/botan/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@
}:
let
cpuFlag = if pkgs.stdenv.system == "i686-linux" then "x86_32" else "x86_64";

self = pkgs.botan2;

dev = pkgs.libs.getDev self;
lib = pkgs.libs.getLib self;
in
pkgs.botan2.overrideAttrs (oldAttrs: {
self.overrideAttrs (oldAttrs: {

postInstall = (oldAttrs.postInstall or "") + ''
ln -sr "$out/include/botan-2/botan" "$out/include"
'';
postInstall = (oldAttrs.postInstall or "") + ''
ln -sr "$out/include/botan-2/botan" "$out/include"
'';

buildPhase = ''
runHook preBuild
buildPhase = ''
runHook preBuild

make -j $NIX_BUILD_CORES
make -j $NIX_BUILD_CORES

runHook postBuild
'';
})
runHook postBuild
'';
})
8 changes: 7 additions & 1 deletion deps/http-parser/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ let
sha256 = "15bdlccjg14qa7lwkcc7pikvi386ig108ca62hbxfas5wyw1fr62";
};
pkgsHttpfix = import nixpkgsHttpfix { crossSystem = { config = stdenv.targetPlatform.config; }; };
pkgs = pkgsHttpfix.pkgsStatic;

self = pkgs.http-parser;

dev = pkgs.lib.getDev self;
lib = pkgs.lib.getLib self;
in
pkgsHttpfix.pkgsStatic.http-parser.overrideAttrs (oldAttrs: {
self.overrideAttrs (oldAttrs: {
inherit stdenv;
postInstall = (oldAttrs.postInstall or "") + ''
mkdir "$out/include/http-parser"
Expand Down
45 changes: 26 additions & 19 deletions deps/lest/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,34 @@
pkgs,
stdenv
}:
stdenv.mkDerivation rec {
pname = "lest";
version = "1.36.0";
let
self = stdenv.mkDerivation rec {
pname = "lest";
version = "1.36.0";

meta = {
description = "A tiny C++11 test framework – lest errors escape testing.";
homepage = "https://github.com/martinmoene/lest";
license = pkgs.lib.licenses.boost;
};
meta = {
description = "A tiny C++11 test framework – lest errors escape testing.";
homepage = "https://github.com/martinmoene/lest";
license = pkgs.lib.licenses.boost;
};

src = fetchGit {
url = "https://github.com/martinmoene/lest.git";
ref = "refs/tags/v${version}";
rev = "57197f32f2c7d3f3d3664a9010d3ff181a40f6ca";
};
src = fetchGit {
url = "https://github.com/martinmoene/lest.git";
ref = "refs/tags/v${version}";
rev = "57197f32f2c7d3f3d3664a9010d3ff181a40f6ca";
};

cmakeBuildType = "Debug";
cmakeBuildType = "Debug";

postBuild = ''
mkdir -p "$out/include"
cp -r include "$out/"
'';
};

postBuild = ''
mkdir -p "$out/include"
cp -r include "$out/"
'';
dev = pkgs.lib.getDev self;
lib = pkgs.lib.getLib self;
in
self.overrideAttrs (oldAttrs: {
})

}
11 changes: 7 additions & 4 deletions deps/libfmt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
cmake ? pkgs.cmake
}:
let
libfmt = stdenv.mkDerivation rec {
self = stdenv.mkDerivation rec {
pname = "fmt";
version = "12.0.0";

Expand All @@ -28,8 +28,11 @@ let
"-DFMT_INSTALL=ON"
];
};

dev = pkgs.lib.getDev self;
lib = pkgs.lib.getLib self;
in
libfmt // {
include = "${libfmt}/include";
lib = "${libfmt}/lib";
self // {
include = "${self}/include";
lib = "${self}/lib";
}
55 changes: 31 additions & 24 deletions deps/musl-unpatched/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,42 @@ stdenv
, pkgs
, linuxHeaders ? null
}:
stdenv.mkDerivation rec {
pname = "musl-unpatched";
version = "1.2.5";
let
self = stdenv.mkDerivation rec {
pname = "musl-unpatched";
version = "1.2.5";

src = fetchGit {
url = "git://git.musl-libc.org/musl";
rev = "0784374d561435f7c787a555aeab8ede699ed298";
};
src = fetchGit {
url = "git://git.musl-libc.org/musl";
rev = "0784374d561435f7c787a555aeab8ede699ed298";
};

enableParallelBuilding = true;
enableParallelBuilding = true;

configurePhase = ''
echo "Configuring with musl's configure script"
echo "Target platform is ${stdenv.targetPlatform.config}"
./configure --prefix=$out --with-malloc=oldmalloc --disable-shared --enable-debug CROSS_COMPILE=${stdenv.targetPlatform.config}-
'';
configurePhase = ''
echo "Configuring with musl's configure script"
echo "Target platform is ${stdenv.targetPlatform.config}"
./configure --prefix=$out --with-malloc=oldmalloc --disable-shared --enable-debug CROSS_COMPILE=${stdenv.targetPlatform.config}-
'';

# Copy linux headers - taken from upstream nixpkgs musl, needed for libcxx to build
postInstall = ''
(cd $out/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .)
'';
# Copy linux headers - taken from upstream nixpkgs musl, needed for libcxx to build
postInstall = ''
(cd $out/include && ln -s $(ls -d ${linuxHeaders}/include/* | grep -v "scsi$") .)
'';

CFLAGS = "-Wno-error=int-conversion -nostdinc";
CFLAGS = "-Wno-error=int-conversion -nostdinc";

passthru.linuxHeaders = linuxHeaders;
passthru.linuxHeaders = linuxHeaders;

meta = {
description = "musl - Linux based libc (unpatched)";
homepage = "https://www.musl-libc.org/";
license = pkgs.lib.licenses.mit;
meta = {
description = "musl - Linux based libc (unpatched)";
homepage = "https://www.musl-libc.org/";
license = pkgs.lib.licenses.mit;
};
};
}

dev = pkgs.lib.getDev self;
lib = pkgs.lib.getLib self;
in
self.overrideAttrs (oldAttrs: {
})
69 changes: 38 additions & 31 deletions deps/musl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,52 @@ stdenv
, pkgs
, linuxHeaders ? null
}:
stdenv.mkDerivation rec {
pname = "musl-includeos";
version = "1.2.5";
let
self = stdenv.mkDerivation rec {
pname = "musl-includeos";
version = "1.2.5";

src = fetchGit {
url = "git://git.musl-libc.org/musl";
rev = "0784374d561435f7c787a555aeab8ede699ed298";
};
src = fetchGit {
url = "git://git.musl-libc.org/musl";
rev = "0784374d561435f7c787a555aeab8ede699ed298";
};

enableParallelBuilding = true;
enableParallelBuilding = true;

patches = [
./patches/musl.patch
./patches/endian.patch
];
patches = [
./patches/musl.patch
./patches/endian.patch
];

passthru.linuxHeaders = linuxHeaders;
passthru.linuxHeaders = linuxHeaders;

postUnpack = ''
echo "Replacing musl's syscall headers with IncludeOS syscalls"
postUnpack = ''
echo "Replacing musl's syscall headers with IncludeOS syscalls"

cp ${./patches/includeos_syscalls.h} $sourceRoot/src/internal/includeos_syscalls.h
cp ${./patches/syscall.h} $sourceRoot/src/internal/syscall.h
cp ${./patches/includeos_syscalls.h} $sourceRoot/src/internal/includeos_syscalls.h
cp ${./patches/syscall.h} $sourceRoot/src/internal/syscall.h

rm $sourceRoot/arch/x86_64/syscall_arch.h
rm $sourceRoot/arch/i386/syscall_arch.h
'';
rm $sourceRoot/arch/x86_64/syscall_arch.h
rm $sourceRoot/arch/i386/syscall_arch.h
'';

configurePhase = ''
echo "Configuring with musl's configure script"
echo "Target platform is ${stdenv.targetPlatform.config}"
./configure --prefix=$out --disable-shared --enable-debug --with-malloc=oldmalloc CROSS_COMPILE=${stdenv.targetPlatform.config}-
'';
configurePhase = ''
echo "Configuring with musl's configure script"
echo "Target platform is ${stdenv.targetPlatform.config}"
./configure --prefix=$out --disable-shared --enable-debug --with-malloc=oldmalloc CROSS_COMPILE=${stdenv.targetPlatform.config}-
'';

CFLAGS = "-Wno-error=int-conversion -nostdinc";
CFLAGS = "-Wno-error=int-conversion -nostdinc";

meta = {
description = "musl - Linux based libc, built with IncludeOS linux-like syscalls";
homepage = "https://www.musl-libc.org/";
license = pkgs.lib.licenses.mit;
meta = {
description = "musl - Linux based libc, built with IncludeOS linux-like syscalls";
homepage = "https://www.musl-libc.org/";
license = pkgs.lib.licenses.mit;
};
};
}

dev = pkgs.lib.getDev self;
lib = pkgs.lib.getLib self;
in
self.overrideAttrs (oldAttrs: {
})
89 changes: 48 additions & 41 deletions deps/s2n/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,62 @@
pkgs,
stdenv
}:
stdenv.mkDerivation rec {
pname = "s2n-tls";
# ./conanfile.py lists 0.8, but there are not tags in the repo with version < 0.9.0
version = "0.9.0";

src = pkgs.fetchzip {
url = "https://github.com/aws/s2n-tls/archive/v${version}.tar.gz";
sha256 = "18qjqc2jrpiwdpzqxl6hl1cq0nfmqk8qas0ijpwr0g606av0aqm9";
};
let
self = stdenv.mkDerivation rec {
pname = "s2n-tls";
# ./conanfile.py lists 0.8, but there are not tags in the repo with version < 0.9.0
version = "0.9.0";

src = pkgs.fetchzip {
url = "https://github.com/aws/s2n-tls/archive/v${version}.tar.gz";
sha256 = "18qjqc2jrpiwdpzqxl6hl1cq0nfmqk8qas0ijpwr0g606av0aqm9";
};

buildInputs = [
pkgs.pkgsStatic.openssl
];
buildInputs = [
pkgs.pkgsStatic.openssl
];

# the default 'all' target depends on tests which are broken (see below)
buildPhase = ''
runHook preBuild
# the default 'all' target depends on tests which are broken (see below)
buildPhase = ''
runHook preBuild

make bin
make bin

runHook postBuild
'';
runHook postBuild
'';

# TODO: tests fail:
# make -C unit
# make[2]: Entering directory '/build/source/tests/unit'
# Running s2n_3des_test.c ... FAILED test 1
# !((conn = s2n_connection_new(S2N_SERVER)) == (((void *)0))) is not true (s2n_3des_test.c line 44)
# Error Message: 'error calling mlock (Did you run prlimit?)'
# Debug String: 'Error encountered in s2n_mem.c line 103'
# make[2]: *** [Makefile:44: s2n_3des_test] Error 1
doCheck = false;
# TODO: tests fail:
# make -C unit
# make[2]: Entering directory '/build/source/tests/unit'
# Running s2n_3des_test.c ... FAILED test 1
# !((conn = s2n_connection_new(S2N_SERVER)) == (((void *)0))) is not true (s2n_3des_test.c line 44)
# Error Message: 'error calling mlock (Did you run prlimit?)'
# Debug String: 'Error encountered in s2n_mem.c line 103'
# make[2]: *** [Makefile:44: s2n_3des_test] Error 1
doCheck = false;

# Upstream Makefile has no install target
installPhase = ''
runHook preInstall
# Upstream Makefile has no install target
installPhase = ''
runHook preInstall

mkdir -p "$out/include"
cp api/s2n.h "$out/include"
mkdir -p "$out/include"
cp api/s2n.h "$out/include"

mkdir -p "$out/lib"
cp lib/libs2n.a lib/libs2n.so "$out/lib"
mkdir -p "$out/lib"
cp lib/libs2n.a lib/libs2n.so "$out/lib"

runHook postInstall
'';
runHook postInstall
'';

meta = {
description = "An implementation of the TLS/SSL protocols";
homepage = "https://github.com/aws/s2n-tls";
license = pkgs.lib.licenses.asl20;
meta = {
description = "An implementation of the TLS/SSL protocols";
homepage = "https://github.com/aws/s2n-tls";
license = pkgs.lib.licenses.asl20;
};
};
}

dev = pkgs.lib.getDev self;
lib = pkgs.lib.getLib self;
in
self.overrideAttrs (oldAttrs: {
})
Loading