mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-19 02:44:17 +03:00
Merge pull request #51880 from matthewbauer/simavr-mac
simavr: work on macOS
This commit is contained in:
commit
465a5e1d97
@ -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 ];
|
||||
};
|
||||
|
||||
|
@ -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; };
|
||||
|
Loading…
Reference in New Issue
Block a user