mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-27 14:34:33 +00: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
|
{ stdenv, fetchFromGitHub, libelf, which, git, pkgconfig, freeglut
|
||||||
, avrbinutils, avrgcc, avrlibc
|
, avrbinutils, avrgcc, avrlibc
|
||||||
, libGLU_combined }:
|
, libGLU_combined
|
||||||
|
, GLUT }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "simavr-${version}";
|
name = "simavr-${version}";
|
||||||
@ -13,29 +14,29 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "0b2lh6l2niv80dmbm9xkamvnivkbmqw6v97sy29afalrwfxylxla";
|
sha256 = "0b2lh6l2niv80dmbm9xkamvnivkbmqw6v97sy29afalrwfxylxla";
|
||||||
};
|
};
|
||||||
|
|
||||||
# ld: cannot find -lsimavr
|
makeFlags = [
|
||||||
enableParallelBuilding = false;
|
"DESTDIR=$(out)"
|
||||||
|
"PREFIX="
|
||||||
buildFlags = "AVR_ROOT=${avrlibc}/avr SIMAVR_VERSION=${version}";
|
"AVR_ROOT=${avrlibc}/avr"
|
||||||
installFlags = buildFlags + " DESTDIR=$(out)";
|
"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.
|
# Hack to avoid TMPDIR in RPATHs.
|
||||||
preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
|
preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
|
||||||
|
|
||||||
postFixup = ''
|
doCheck = true;
|
||||||
target="$out/bin/simavr"
|
checkTarget = "-C tests run_tests";
|
||||||
patchelf --set-rpath "$(patchelf --print-rpath "$target"):$out/lib" "$target"
|
|
||||||
'';
|
|
||||||
|
|
||||||
nativeBuildInputs = [ which git pkgconfig avrgcc avrbinutils ];
|
|
||||||
buildInputs = [ libelf freeglut libGLU_combined ];
|
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "A lean and mean Atmel AVR simulator";
|
description = "A lean and mean Atmel AVR simulator";
|
||||||
homepage = https://github.com/buserror/simavr;
|
homepage = https://github.com/buserror/simavr;
|
||||||
license = licenses.gpl3;
|
license = licenses.gpl3;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.unix;
|
||||||
maintainers = with maintainers; [ goodrone ];
|
maintainers = with maintainers; [ goodrone ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12395,6 +12395,7 @@ in
|
|||||||
avrgcc = pkgsCross.avr.buildPackages.gcc;
|
avrgcc = pkgsCross.avr.buildPackages.gcc;
|
||||||
avrbinutils = pkgsCross.avr.buildPackages.binutils;
|
avrbinutils = pkgsCross.avr.buildPackages.binutils;
|
||||||
avrlibc = pkgsCross.avr.libcCross;
|
avrlibc = pkgsCross.avr.libcCross;
|
||||||
|
inherit (darwin.apple_sdk.frameworks) GLUT;
|
||||||
};
|
};
|
||||||
|
|
||||||
simgear = callPackage ../development/libraries/simgear { openscenegraph = openscenegraph_3_4; };
|
simgear = callPackage ../development/libraries/simgear { openscenegraph = openscenegraph_3_4; };
|
||||||
|
Loading…
Reference in New Issue
Block a user