genode-ehmry/sdk/default.nix

41 lines
1.2 KiB
Nix
Raw Normal View History

2019-06-27 11:34:34 +02:00
{ toolchain, pkgs ? import <nixpkgs> {} }: with pkgs;
2019-06-21 17:29:07 +02:00
let
2019-06-27 11:34:34 +02:00
version = "19.05";
tarball = fetchurl {
url = "https://github.com/genodelabs/genode/archive/19.05.tar.gz";
sha256 = "1mr81885ysjff7plfvav6cr3lx5yhlcyq63q8c8bfvgi1fcarbww";
};
2019-06-21 17:29:07 +02:00
in
stdenv.mkDerivation {
2019-06-27 11:34:34 +02:00
name = "genode-sdk-${version}";
inherit tarball version;
2019-06-21 17:29:07 +02:00
2019-06-27 11:34:34 +02:00
phases = "mainPhase";
2019-06-21 17:29:07 +02:00
2019-06-27 11:34:34 +02:00
toolchain_dir = toolchain.out;
tool_prefix = "genode-x86-";
2019-06-21 17:29:07 +02:00
2019-06-27 11:34:34 +02:00
spec_includes="-I\${includedir}/spec/x86_64 -I\${includedir}/spec/x86 -I\${includedir}/spec/64bit";
2019-06-21 17:29:07 +02:00
mainPhase = ''
2019-06-27 11:34:34 +02:00
export includedir=$out/include
export libdir=$out/lib
pkg_config_dir=$out/pkg-config
mkdir -p $includedir $pkg_config_dir
for i in ${./pkg-config}/*.pc; do
substituteAll "$i" "$out/pkg-config/`basename $i`"
done
tar xfv ${tarball} \
--transform='s|genode-${version}/repos/base/include|genode-base/|' \
--transform='s|genode-${version}/repos/os/include|genode-os/|' \
--transform='s|genode-${version}/repos/gems/include|genode-gems/|' \
-C $includedir \
genode-${version}/repos/base/include \
genode-${version}/repos/os/include \
genode-${version}/repos/gems/include \
2019-06-21 17:29:07 +02:00
'';
}