From f40849784af0d16fe0ae31b3438118de3e98353b Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Wed, 17 Feb 2021 13:05:55 +0700 Subject: [PATCH] microscheme: refactor, fix build on darwin and cross-compilation --- .../compilers/microscheme/default.nix | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/pkgs/development/compilers/microscheme/default.nix b/pkgs/development/compilers/microscheme/default.nix index ee2de8518f36..1f3a98de821e 100644 --- a/pkgs/development/compilers/microscheme/default.nix +++ b/pkgs/development/compilers/microscheme/default.nix @@ -1,21 +1,24 @@ -{ lib, stdenv, fetchzip, vim, makeWrapper }: +{ lib, stdenv, fetchFromGitHub, makeWrapper, unixtools }: stdenv.mkDerivation rec { pname = "microscheme"; version = "0.9.3"; - src = fetchzip { - name = "${pname}-${version}-src"; - url = "https://github.com/ryansuchocki/microscheme/archive/v${version}.tar.gz"; - sha256 = "1r3ng4pw1s9yy1h5rafra1rq19d3vmb5pzbpcz1913wz22qdd976"; + src = fetchFromGitHub { + owner = "ryansuchocki"; + repo = "microscheme"; + rev = "v${version}"; + sha256 = "5qTWsBCfj5DCZ3f9W1bdo6WAc1DZqVxg8D7pwC95duQ="; }; - buildInputs = [ makeWrapper vim ]; - - installPhase = '' - make install PREFIX=$out + postPatch = '' + substituteInPlace makefile --replace gcc ${stdenv.cc.targetPrefix}cc ''; + nativeBuildInputs = [ makeWrapper unixtools.xxd ]; + + makeFlags = [ "PREFIX=${placeholder "out"}" ]; + meta = with lib; { homepage = "http://microscheme.org"; description = "A Scheme subset for Atmel microcontrollers"; @@ -24,7 +27,7 @@ stdenv.mkDerivation rec { microcontrollers, especially as found on Arduino boards. ''; license = licenses.mit; - platforms = platforms.linux; + platforms = platforms.all; maintainers = with maintainers; [ ardumont ]; }; }