catboost: refactor

- suppress deprecation warning for substituteInPlace
- replace cmake flags with lib.cmakeBool and lib.cmakeFeature
This commit is contained in:
natsukium 2024-03-03 15:05:36 +09:00
parent 4bf3e6cf24
commit c8cfe98c9e
No known key found for this signature in database
GPG Key ID: 9EA45A31DB994C53

View File

@ -37,8 +37,8 @@ stdenv.mkDerivation (finalAttrs: {
postPatch = ''
substituteInPlace cmake/common.cmake \
--replace "\''${RAGEL_BIN}" "${ragel}/bin/ragel" \
--replace "\''${YASM_BIN}" "${yasm}/bin/yasm"
--replace-fail "\''${RAGEL_BIN}" "${ragel}/bin/ragel" \
--replace-fail "\''${YASM_BIN}" "${yasm}/bin/yasm"
shopt -s globstar
for cmakelists in **/CMakeLists.*; do
@ -86,11 +86,10 @@ stdenv.mkDerivation (finalAttrs: {
};
cmakeFlags = [
"-DCMAKE_BINARY_DIR=$out"
"-DCMAKE_POSITION_INDEPENDENT_CODE=on"
"-DCATBOOST_COMPONENTS=app;libs${lib.optionalString pythonSupport ";python-package"}"
] ++ lib.optionals cudaSupport [
"-DHAVE_CUDA=on"
(lib.cmakeFeature "CMAKE_BINARY_DIR" "$out")
(lib.cmakeBool "CMAKE_POSITION_INDEPENDENT_CODE" true)
(lib.cmakeFeature "CATBOOST_COMPONENTS" "app;libs${lib.optionalString pythonSupport ";python-package"}")
(lib.cmakeBool "HAVE_CUDA" cudaSupport)
];
installPhase = ''