3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/interpreters/s9fes/default.nix

36 lines
1 KiB
Nix
Raw Normal View History

2021-07-24 14:08:44 +01:00
{ stdenv, lib, fetchurl, ncurses, buildPackages }:
let
isCrossCompiling = stdenv.hostPlatform != stdenv.buildPlatform;
in
stdenv.mkDerivation rec {
pname = "s9fes";
version = "20181205";
src = fetchurl {
2021-07-24 18:06:48 +01:00
url = "https://www.t3x.org/s9fes/s9fes-${version}.tgz";
2021-07-24 14:08:44 +01:00
sha256 = "sha256-Lp/akaDy3q4FmIE6x0fj9ae/SOD7tdsmzy2xdcCh13o=";
};
# Fix cross-compilation
postPatch = ''
2021-07-24 18:06:48 +01:00
substituteInPlace Makefile \
--replace 'ar q' '${stdenv.cc.targetPrefix}ar q' \
--replace 'strip' '${stdenv.cc.targetPrefix}strip'
2021-07-24 14:08:44 +01:00
${lib.optionalString isCrossCompiling "substituteInPlace Makefile --replace ./s9 '${buildPackages.s9fes}/bin/s9'"}
'';
buildInputs = [ ncurses ];
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "PREFIX=$(out)" ];
enableParallelBuilding = true;
meta = with lib; {
description = "Scheme 9 From Empty Space, an interpreter for R4RS Scheme";
homepage = "http://www.t3x.org/s9fes/index.html";
license = licenses.publicDomain;
maintainers = with maintainers; [ siraben ];
platforms = platforms.unix;
};
}