Skip to content
20 changes: 0 additions & 20 deletions deps/botan/default.nix

This file was deleted.

File renamed without changes.
32 changes: 32 additions & 0 deletions deps/botan2/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
pkgs
}:
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
self.overrideAttrs (oldAttrs: {

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

buildPhase = ''
runHook preBuild

make -j $NIX_BUILD_CORES

runHook postBuild
'';
})

passthru = (oldAttrs.passthru or {}) // {
include_root = "${dev}/include";
include = "${dev}/include/botan-2"; # include/botan2/botan/*.h
lib = "${lib}/lib";
};
})
15 changes: 13 additions & 2 deletions deps/http-parser/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,28 @@ let
# TODO: Upstream doesn't use that subdir though, so better fix IncludeOS
# sources.
#
# Uses a more recent version of nixpkgs to get support for static builds
# Uses a more recent version of nixpkgs to get support for static builds # TODO: verify if still obsolete
nixpkgsHttpfix = builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/33f464b661f939689aa56af6b6e27b504c5afb93.tar.gz";
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"
ln -sr "$out/include/http_parser.h" "$out/include/http-parser"
'';
passthru = (oldAttrs.passthru or {}) // {
include_root = "${dev}/include";
include = "${dev}/include"; # TODO: consider subdir?
lib = "${self}/lib";
};
})
49 changes: 30 additions & 19 deletions deps/lest/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,38 @@
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 (prev: {
passthru = (prev.passthru or {}) // {
include_root = "${dev}/include";
include = "${dev}/include/lest";
# lib = "${self}"; # TODO: consider precompiling
};
})
29 changes: 0 additions & 29 deletions deps/libfdt/CMakeLists.txt

This file was deleted.

16 changes: 16 additions & 0 deletions deps/libfdt/clang-no-suggest-attr-format.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/Makefile b/Makefile
index f1f0ab3..edbcb4a 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,10 @@ ASSUME_MASK ?= 0
CPPFLAGS = -I libfdt -I . -DFDT_ASSUME_MASK=$(ASSUME_MASK)
WARNINGS = -Wall -Wpointer-arith -Wcast-qual -Wnested-externs -Wsign-compare \
-Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wshadow \
- -Wsuggest-attribute=format -Wwrite-strings
+ -Wwrite-strings
+ifeq ($(findstring gcc,$(notdir $(CC))),gcc)
+WARNINGS += -Wsuggest-attribute=format
+endif
CFLAGS = -g -Os $(SHAREDLIB_CFLAGS) -Werror $(WARNINGS) $(EXTRA_CFLAGS)

BISON = bison
48 changes: 48 additions & 0 deletions deps/libfdt/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
pkgs,
stdenv
}:

let
self = stdenv.mkDerivation rec {
pname = "libfdt";
version = "1.7.2";
src = pkgs.fetchzip {
url = "https://mirrors.edge.kernel.org/pub/software/utils/dtc/dtc-${version}.tar.xz";
hash = "sha256-KZCzrvdWd6zfQHppjyp4XzqNCfH2UnuRneu+BNIRVAY=";
};
meta.license = pkgs.lib.licenses.bsd2;

nativeBuildInputs = with pkgs.buildPackages; [
pkg-config flex bison
];
outputs = [ "out" "dev" ];

patches = [
./clang-no-suggest-attr-format.patch # TODO: upstream
];

buildPhase = ''
runHook preBuild
make -j"$NIX_BUILD_CORES" libfdt/libfdt.a
runHook postBuild
'';

installPhase = ''
runHook preInstall
install -D -m644 -t "$out/lib/" libfdt/libfdt.a
install -D -m644 -t "$dev/include/fdt" libfdt/*.h
runHook postInstall
'';
};

dev = pkgs.lib.getDev self;
in
self.overrideAttrs (prev: {
passthru = {
include_root = "${dev}/include";
include = "${dev}/include/fdt";
lib = "${self}/lib";
};
})

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: {
})
Loading