Fixed the build of iWork on linux

This commit is contained in:
Green
2024-11-18 16:48:53 +03:00
parent 024c288e12
commit fea872d779
2 changed files with 10 additions and 4 deletions

View File

@ -80,6 +80,8 @@ int CIWorkFile::Convert2Odf(const std::wstring& sFile, const std::wstring& sOutp
if (libetonyek::EtonyekDocument::CONFIDENCE_NONE == confidence)
return -1;
const std::string sOutputFileA = U_TO_UTF8(sOutputFile);
switch (type)
{
case libetonyek::EtonyekDocument::TYPE_PAGES:
@ -92,7 +94,7 @@ int CIWorkFile::Convert2Odf(const std::wstring& sFile, const std::wstring& sOutp
if (!bRes)
return 1;
std::wofstream output(sOutputFile);
std::wofstream output(sOutputFileA.c_str());
output << content.cstr();
return 0;
}
@ -106,7 +108,7 @@ int CIWorkFile::Convert2Odf(const std::wstring& sFile, const std::wstring& sOutp
if (!bRes)
return 1;
std::wofstream output(sOutputFile.c_str());
std::wofstream output(sOutputFileA.c_str());
output << content.cstr();
return 0;
}
@ -120,7 +122,7 @@ int CIWorkFile::Convert2Odf(const std::wstring& sFile, const std::wstring& sOutp
if (!bRes)
return 1;
std::wofstream output(sOutputFile.c_str());
std::wofstream output(sOutputFileA.c_str());
output << content.cstr();
return 0;
}

View File

@ -11,10 +11,14 @@ if not base.is_dir("mdds"):
base.cmd("git", ["clone", "https://github.com/kohei-us/mdds.git"])
base.cmd_in_dir("mdds", "git", ["checkout", "0783158939c6ce4b0b1b89e345ab983ccb0f0ad0"])
#the linux code uses an implementation for c++ 17, so we just put this implementation
if ("linux" == base.host_platform()):
base.replaceInFile("./mdds/include/mdds/global.hpp", "namespace mdds {", "namespace std { template<bool __v> using bool_constant = integral_constant<bool, __v>; }\n\nnamespace mdds {")
if not base.is_dir("librevenge"):
base.cmd("git", ["clone", "https://github.com/Distrotech/librevenge.git"])
base.cmd_in_dir("librevenge", "git", ["checkout", "becd044b519ab83893ad6398e3cbb499a7f0aaf4"])
stat_windows = ""
stat_windows += "#if !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG)\n"
stat_windows += "#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)\n"