2023-03-09 11:59:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, alsa-lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, libGL
|
|
|
|
, libGLU
|
|
|
|
, libX11
|
|
|
|
, libXext
|
|
|
|
, makeBinaryWrapper
|
2023-01-20 21:14:05 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "minimacy";
|
2023-10-03 05:14:51 +00:00
|
|
|
version = "1.1.2";
|
2023-01-20 21:14:05 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ambermind";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-10-03 05:14:51 +00:00
|
|
|
hash = "sha256-WBmpinMnGr7Tmf1jLhdq5DXdR+ohOY0CpOBJ6fewKFU=";
|
2023-01-20 21:14:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeBinaryWrapper ];
|
|
|
|
|
2023-03-09 11:59:59 +00:00
|
|
|
buildInputs = [ libGL libGLU ] ++ lib.optionals stdenv.isLinux [ alsa-lib libX11 libXext ];
|
2023-01-20 21:14:05 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2023-02-19 19:23:32 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-Wno-unused-result";
|
2023-01-20 21:14:05 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
pushd ${if stdenv.isDarwin then "macos/cmdline" else "unix"}
|
|
|
|
'';
|
|
|
|
|
|
|
|
# TODO: build graphic version for darwin
|
|
|
|
buildFlags = (if stdenv.isDarwin then [ "nox" ] else [ "all" ]) ++ [ "CC=${stdenv.cc.targetPrefix}cc" ];
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
bin/${if stdenv.isDarwin then "minimacyMac" else "minimacy"} system/demo/demo.fun.mandelbrot.mcy
|
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/lib/minimacy
|
|
|
|
cp -r {README.md,LICENSE,system,rom,topLevel.mcy} $out/lib/minimacy
|
|
|
|
install bin/minimacy* -Dt $out/bin
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
for prog in $out/bin/minimacy*;
|
|
|
|
do wrapProgram $prog \
|
|
|
|
--set MINIMACY $out/lib/minimacy
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "An open-source minimalist computing technology";
|
|
|
|
longDescription = ''
|
|
|
|
Minimacy is an open-source minimalist computation system based on the principle "Less is more".
|
|
|
|
It is designed and programmed by Sylvain Huet.
|
|
|
|
'';
|
|
|
|
maintainers = with lib.maintainers; [ jboy ];
|
|
|
|
homepage = "https://minimacy.net";
|
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|