Merge pull request #51880 from matthewbauer/simavr-mac

simavr: work on macOS
This commit is contained in:
Matthew Bauer 2018-12-11 20:36:58 -06:00 committed by GitHub
commit 465a5e1d97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 14 deletions

View File

@ -1,6 +1,7 @@
{ stdenv, fetchFromGitHub, libelf, which, git, pkgconfig, freeglut
, avrbinutils, avrgcc, avrlibc
, libGLU_combined }:
, libGLU_combined
, GLUT }:
stdenv.mkDerivation rec {
name = "simavr-${version}";
@ -13,29 +14,29 @@ stdenv.mkDerivation rec {
sha256 = "0b2lh6l2niv80dmbm9xkamvnivkbmqw6v97sy29afalrwfxylxla";
};
# ld: cannot find -lsimavr
enableParallelBuilding = false;
buildFlags = "AVR_ROOT=${avrlibc}/avr SIMAVR_VERSION=${version}";
installFlags = buildFlags + " DESTDIR=$(out)";
makeFlags = [
"DESTDIR=$(out)"
"PREFIX="
"AVR_ROOT=${avrlibc}/avr"
"SIMAVR_VERSION=${version}"
"AVR=avr-"
];
nativeBuildInputs = [ which pkgconfig avrgcc ];
buildInputs = [ libelf freeglut libGLU_combined ]
++ stdenv.lib.optional stdenv.isDarwin GLUT;
# Hack to avoid TMPDIR in RPATHs.
preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
postFixup = ''
target="$out/bin/simavr"
patchelf --set-rpath "$(patchelf --print-rpath "$target"):$out/lib" "$target"
'';
nativeBuildInputs = [ which git pkgconfig avrgcc avrbinutils ];
buildInputs = [ libelf freeglut libGLU_combined ];
doCheck = true;
checkTarget = "-C tests run_tests";
meta = with stdenv.lib; {
description = "A lean and mean Atmel AVR simulator";
homepage = https://github.com/buserror/simavr;
license = licenses.gpl3;
platforms = platforms.linux;
platforms = platforms.unix;
maintainers = with maintainers; [ goodrone ];
};

View File

@ -12395,6 +12395,7 @@ in
avrgcc = pkgsCross.avr.buildPackages.gcc;
avrbinutils = pkgsCross.avr.buildPackages.binutils;
avrlibc = pkgsCross.avr.libcCross;
inherit (darwin.apple_sdk.frameworks) GLUT;
};
simgear = callPackage ../development/libraries/simgear { openscenegraph = openscenegraph_3_4; };