Skip to content

Commit

Permalink
qemu-arm: Add support for TravisCI
Browse files Browse the repository at this point in the history
  • Loading branch information
midchildan committed Feb 28, 2019
1 parent b46ddaf commit ca8b13a
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 12 deletions.
15 changes: 8 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,14 @@ jobs:
RUMP: "linux"
<<: *do_steps

qemu-arm-linux:
docker:
- image: lkldocker/circleci-x86_64:0.5
environment:
OS: "qemu-arm"
RUMP: "linux"
<<: *do_steps
# XXX: Forked version of QEMU is needed
# qemu-arm-linux:
# docker:
# - image: lkldocker/circleci-x86_64:0.5
# environment:
# OS: "qemu-arm"
# RUMP: "linux"
# <<: *do_steps

linux-netbsd:
docker:
Expand Down
35 changes: 30 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
language: c
language: nix

compiler:
- gcc
- clang
matrix:
include:
- name: "GCC"
env: BUILD_TARGET=frankenlibc-gcc
- name: "Clang"
env: BUILD_TARGET=frankenlibc-clang
- name: "QEMU ARM"
env: BUILD_TARGET=frankenlibc-arm

cache:
directories:
- $HOME/nix.store

before_cache:
- rm -rf $HOME/nix.store
- mkdir -p $HOME/nix.store
- nix copy --to file://$HOME/nix.store -f default.nix buildInputs

before_install:
- mkdir -p $HOME/.config/nix
- |
cat <<EOF > $HOME/.config/nix/nix.conf
substituters = https://cache.nixos.org/ file://$HOME/nix.store
require-sigs = false
EOF
- |
git clone https://github.com/libos-nuse/nixpkgs-lkl.git \
~/.config/nixpkgs/overlays/nixpkgs-lkl
script:
- ./build.sh
- nix-build -A "$BUILD_TARGET"
9 changes: 9 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ pkgs ? import <nixpkgs> {} }:

with pkgs;

{
frankenlibc-gcc = callPackage ./frankenlibc.nix { };
frankenlibc-clang = callPackage ./frankenlibc.nix { stdenv = clangStdenv; };
frankenlibc-arm = callPackage ./frankenlibc.nix { armSupport = true; };
}
29 changes: 29 additions & 0 deletions frankenlibc.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{ stdenv, gcc-arm-embedded, binutils-arm-embedded, qemu-circle
, armSupport ? false
}:

stdenv.mkDerivation {
name = "frankenlibc";

src = ../.;

nativebuildInputs =
stdenv.lib.optionals armSupport [
gcc-arm-embedded
binutils-arm-embedded
];

buildInputs = stdenv.lib.optionals armSupport [ qemu-circle ];

buildFlags = if armSupport then [ "-k linux" "qemu-arm" ] else [];

buildPhase = ''
./build.sh ${buildFlags}
'';

installPhase = ''
cp -r . $out
'';

stdenv = if armSupport then overrideCC stdenv gcc-arm-embedded else stdenv;
}

0 comments on commit ca8b13a

Please sign in to comment.