Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 90 lines 2.1 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 fetchpatch, 6 cmake, 7 perl, 8 enableGui ? false, 9 qtbase, 10 wrapQtAppsHook, 11 qtwebengine, 12 enableJupyter ? true, 13 boost, 14 jsoncpp, 15 openssl, 16 zmqpp, 17 enableJava ? false, 18 openjdk, 19 gtest, 20}: 21 22stdenv.mkDerivation rec { 23 pname = "yacas"; 24 version = "1.9.1"; 25 26 src = fetchFromGitHub { 27 owner = "grzegorzmazur"; 28 repo = "yacas"; 29 rev = "v${version}"; 30 sha256 = "0dqgqvsb6ggr8jb3ngf0jwfkn6xwj2knhmvqyzx3amc74yd3ckqx"; 31 }; 32 33 hardeningDisable = [ "format" ]; 34 35 cmakeFlags = [ 36 "-DENABLE_CYACAS_GUI=${if enableGui then "ON" else "OFF"}" 37 "-DENABLE_CYACAS_KERNEL=${if enableJupyter then "ON" else "OFF"}" 38 "-DENABLE_JYACAS=${if enableJava then "ON" else "OFF"}" 39 "-DENABLE_CYACAS_UNIT_TESTS=ON" 40 ]; 41 patches = [ 42 # upstream issue: https://github.com/grzegorzmazur/yacas/issues/340 43 # Upstream patch which doesn't apply on 1.9.1 is: 44 # https://github.com/grzegorzmazur/yacas/pull/342 45 ./jsoncpp-fix-include.patch 46 # Fixes testing - https://github.com/grzegorzmazur/yacas/issues/339 47 # PR: https://github.com/grzegorzmazur/yacas/pull/343 48 (fetchpatch { 49 url = "https://github.com/grzegorzmazur/yacas/commit/8bc22d517ecfdde3ac94800dc8506f5405564d48.patch"; 50 sha256 = "sha256-aPO5T8iYNkGtF8j12YxNJyUPJJPKrXje1DmfCPt317A="; 51 }) 52 ]; 53 preCheck = '' 54 patchShebangs ../tests/test-yacas 55 ''; 56 nativeCheckInputs = [ 57 gtest 58 ]; 59 doCheck = true; 60 61 nativeBuildInputs = [ 62 cmake 63 # Perl is only for the documentation 64 perl 65 ] 66 ++ lib.optionals enableJava [ 67 openjdk 68 ]; 69 buildInputs = [ 70 ] 71 ++ lib.optionals enableGui [ 72 qtbase 73 wrapQtAppsHook 74 qtwebengine 75 ] 76 ++ lib.optionals enableJupyter [ 77 boost 78 jsoncpp 79 openssl 80 zmqpp 81 ]; 82 83 meta = { 84 description = "Easy to use, general purpose Computer Algebra System${lib.optionalString enableGui ", built with GUI."}"; 85 homepage = "http://www.yacas.org/"; 86 license = lib.licenses.gpl2Plus; 87 maintainers = [ ]; 88 platforms = with lib.platforms; linux; 89 }; 90}