Files
nixpkgs/pkgs/by-name/ec/ecos/package.nix
2026-05-07 15:25:18 +07:00

58 lines
1.0 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "ecos";
version = "2.0.10";
src = fetchFromGitHub {
owner = "embotech";
repo = "ecos";
tag = "v${finalAttrs.version}";
hash = "sha256-WMgqDc+XAY3g2wwlefjJ0ATxR5r/jL971FZKtxsunnU=";
};
# tests call no-arg-declared functions with args; pre-C23 allows it
env.NIX_CFLAGS_COMPILE = "-std=gnu17";
buildPhase = ''
runHook preBuild
make all shared
runHook postBuild
'';
doCheck = true;
checkPhase = ''
runHook preCheck
make test
./runecos
runHook postCheck
'';
installPhase = ''
runHook preInstall
mkdir -p $out/lib
cp lib*.a lib*.so $out/lib
cp -r include $out/
runHook postInstall
'';
meta = {
description = "Lightweight conic solver for second-order cone programming";
homepage = "https://www.embotech.com/ECOS";
downloadPage = "https://github.com/embotech/ecos/releases";
license = lib.licenses.gpl3;
platforms = lib.platforms.all;
};
})