From 891e4ff673454031f11fc4d0037ae65daeaa8522 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sun, 9 Dec 2018 16:18:34 +0100 Subject: [PATCH 1/2] glu: don't use valgrind on darwin (cherry picked from commit e32d1eaef16020ec22e3b0cd3be9261d5cf8bc89) --- pkgs/development/libraries/mesa/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index faf1261da4a..ede4dd889e5 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -146,10 +146,10 @@ let self = stdenv.mkDerivation { glproto dri2proto dri3proto presentproto libX11 libXext libxcb libXt libXfixes libxshmfence libXrandr libffi libvdpau libelf libXvMC - libpthreadstubs openssl/*or another sha1 provider*/ - valgrind-light python2 python2.pkgs.Mako + libpthreadstubs openssl /*or another sha1 provider*/ + python2 python2.pkgs.Mako ] ++ lib.optionals (elem "wayland" eglPlatforms) [ wayland wayland-protocols ] - ++ lib.optionals stdenv.isLinux [ libomxil-bellagio libva-minimal ]; + ++ lib.optionals stdenv.isLinux [ valgrind-light libomxil-bellagio libva-minimal ]; enableParallelBuilding = true; doCheck = false; From 22fe087da80f27db7b97aebfcb9bf430beea3a2f Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 10 Dec 2018 17:25:35 -0600 Subject: [PATCH 2/2] simavr: work on macOS --- pkgs/development/tools/simavr/default.nix | 29 ++++++++++++----------- pkgs/top-level/all-packages.nix | 1 + 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/pkgs/development/tools/simavr/default.nix b/pkgs/development/tools/simavr/default.nix index e28aad40ef4..f2bbbef7189 100644 --- a/pkgs/development/tools/simavr/default.nix +++ b/pkgs/development/tools/simavr/default.nix @@ -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 ]; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ee3e9663756..0172cd82699 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12365,6 +12365,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; };