microscheme: refactor, fix build on darwin and cross-compilation

This commit is contained in:
Ben Siraphob 2021-02-17 13:05:55 +07:00
parent 028ebdb0b0
commit f40849784a

View file

@ -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 ];
};
}