btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / os / osqp / package.nix
blob55f00d01636a21ca9c4aa977c5debad7a52f445c
1 { lib, stdenv
2 , fetchFromGitHub
3 , cmake
4 }:
6 stdenv.mkDerivation rec {
7   pname = "osqp";
8   version = "0.6.3";
10   src = fetchFromGitHub {
11     owner = "oxfordcontrol";
12     repo = "osqp";
13     rev = "v${version}";
14     hash = "sha256-enkK5EFyAeLaUnHNYS3oq43HsHY5IuSLgsYP0k/GW8c=";
15     fetchSubmodules = true;
16   };
18   # ref https://github.com/osqp/osqp/pull/481
19   # but this patch does not apply directly on v0.6.3
20   postPatch = ''
21     substituteInPlace CMakeLists.txt --replace-fail \
22       "$<INSTALL_PREFIX>/\''${CMAKE_INSTALL_INCLUDEDIR}" \
23       "\''${CMAKE_INSTALL_FULL_INCLUDEDIR}"
24   '';
26   nativeBuildInputs = [ cmake ];
28   meta = with lib; {
29     description = "Quadratic programming solver using operator splitting";
30     homepage = "https://osqp.org";
31     license = licenses.asl20;
32     maintainers = with maintainers; [ taktoa ];
33     platforms = platforms.all;
34   };