diff options
-rw-r--r-- | .SRCINFO | 15 | ||||
-rw-r--r-- | PKGBUILD | 52 | ||||
-rw-r--r-- | gmp.patch | 13 | ||||
-rw-r--r-- | llvm-3.7.patch | 122 |
4 files changed, 26 insertions, 176 deletions
@@ -1,13 +1,9 @@ -# Generated by mksrcinfo v8 -# Updated manually on: -# Sun Mar 12 20:26:45 CET 2017 pkgbase = mozart2-git pkgdesc = The Mozart Programming System version 2 - pkgver = v2.0.0.alpha.0.4182.gd630f26 + pkgver = v2.0.1.8.gdb41d83e pkgrel = 1 url = https://github.com/mozart/mozart2 install = mozart2-git.install - arch = i686 arch = x86_64 license = BSD makedepends = java-runtime-headless @@ -25,16 +21,11 @@ pkgbase = mozart2-git depends = hicolor-icon-theme depends = xdg-utils optdepends = emacs: Interactive programming interface (recommended) - provides = mozart - conflicts = mozart - conflicts = mozart-git + provides = mozart2 conflicts = mozart2 conflicts = mozart2-bin + conflicts = mozart2-compiler source = mozart2-git::git+https://github.com/mozart/mozart2 - source = git+https://github.com/mozart/mozart2-stdlib - source = git+https://github.com/google/googletest - sha256sums = SKIP - sha256sums = SKIP sha256sums = SKIP pkgname = mozart2-git @@ -1,24 +1,20 @@ -# Maintainer: Guillaume Maudoux <layus DOT on @AT@ gmail DOT com> - pkgname=mozart2-git -pkgver=v2.0.0.alpha.0.4182.gd630f26 +pkgver=v2.0.1.8.gdb41d83e pkgrel=1 pkgdesc="The Mozart Programming System version 2" -arch=('i686' 'x86_64') +arch=('x86_64') url="https://github.com/mozart/mozart2" license=('BSD') depends=('boost-libs' 'tk' 'gmp' 'hicolor-icon-theme' 'xdg-utils') optdepends=('emacs: Interactive programming interface (recommended)') makedepends=('java-runtime-headless' 'emacs' 'gcc' 'boost>=1.61' 'cmake' 'gtest' 'clang' 'clang-tools-extra' 'llvm') -provides=('mozart') -conflicts=('mozart' 'mozart-git' 'mozart2' 'mozart2-bin') +provides=('mozart2') +conflicts=('mozart2' 'mozart2-bin' 'mozart2-compiler') install="${pkgname}.install" source=( "$pkgname::git+https://github.com/mozart/mozart2" - 'git+https://github.com/mozart/mozart2-stdlib' - 'git+https://github.com/google/googletest' ) -sha256sums=('SKIP' 'SKIP' 'SKIP') +sha256sums=('SKIP') pkgver() { cd "$pkgname" @@ -27,27 +23,8 @@ pkgver() { prepare() { cd "$srcdir/$pkgname" - - git submodule init - git config submodule.stdlib.url $srcdir/mozart2-stdlib - git config submodule.gtest.url $srcdir/googletest - git submodule update - - # Add required libraries to executable. - # TODO : Explore clang build process, I have no idea why this may be needed. - # Normally ld should be able to identify required LLVM/Clang libs by itself. - libs="LLVM clang clangTooling clangFrontendTool clangFrontend \ - clangDriver clangSerialization clangCodeGen clangParse clangSema \ - clangStaticAnalyzerFrontend clangStaticAnalyzerCheckers \ - clangStaticAnalyzerCore clangAnalysis clangARCMigrate clangEdit \ - clangAST clangLex clangBasic" - sed -i'' \ - -e "s%(generator \"\${CLANG_LIBRARY}\"%\\0 $libs%" \ - vm/generator/main/CMakeLists.txt - - # Remove hard-coded palette settings in QTk (Avoids bug in GUI's on Linux). - sed -i'' '/tk_setPalette/ s/^/%/' \ - stdlib/wp/qtk/QTkBare.oz + git submodule update --init + patch -Np1 -i "../../gmp.patch" } build() { @@ -56,19 +33,10 @@ build() { cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/ \ - -DMOZART_BOOST_USE_STATIC_LIBS=OFF \ + -DCMAKE_CXX_COMPILER_ARCHITECTURE=x64 \ + -Wno-dev \ "$srcdir/$pkgname" - - make #VERBOSE=1 -} - -check() { - cd "$srcdir/build" - - # Ignore VM tests for now, as they sometimes fail. - echo 'set(CTEST_CUSTOM_TESTS_IGNORE "/base/vm.oz")' >> CTestCustom.ctest - - make test + make -j$(nproc) } package() { diff --git a/gmp.patch b/gmp.patch new file mode 100644 index 000000000000..44132985f85f --- /dev/null +++ b/gmp.patch @@ -0,0 +1,13 @@ +diff --git a/cmake_local/FindGMP.cmake b/cmake_local/FindGMP.cmake +index e6589ee3..14695fbf 100644 +--- a/cmake_local/FindGMP.cmake ++++ b/cmake_local/FindGMP.cmake +@@ -9,7 +9,7 @@ + set(GMP_PREFIX "" CACHE PATH "Path to GMP prefix") + + find_path(GMP_INCLUDE_DIR gmp.h PATHS ${GMP_PREFIX}/include /usr/include /usr/local/include) +-find_library(GMP_LIBRARY libgmp.a PATHS ${GMP_PREFIX}/lib /usr/lib /usr/local/lib) ++find_library(GMP_LIBRARY libgmp.so PATHS ${GMP_PREFIX}/lib /usr/lib /usr/local/lib) + + if(GMP_INCLUDE_DIR AND GMP_LIBRARY) + set(GMP_FOUND TRUE) diff --git a/llvm-3.7.patch b/llvm-3.7.patch deleted file mode 100644 index cdea92c66034..000000000000 --- a/llvm-3.7.patch +++ /dev/null @@ -1,122 +0,0 @@ -diff --git a/vm/generator/main/builtins.cc b/vm/generator/main/builtins.cc -index a488fcd..ac29863 100644 ---- a/vm/generator/main/builtins.cc -+++ b/vm/generator/main/builtins.cc -@@ -223,9 +223,10 @@ void handleBuiltinModule(const std::string& outputDir, const ClassDecl* CD, - } - - { -- std::string err; -- llvm::raw_fd_ostream to((outputDir+name+"-builtin.json").c_str(), err); -- assert(err == ""); -+ std::error_code err; -+ llvm::raw_fd_ostream to((outputDir+name+"-builtin.json").c_str(), err, -+ llvm::sys::fs::F_None); -+ assert(!err); - definition.makeOutput(to); - } - -diff --git a/vm/generator/main/generator.cc b/vm/generator/main/generator.cc -index 156ff3a..b9a9a67 100644 ---- a/vm/generator/main/generator.cc -+++ b/vm/generator/main/generator.cc -@@ -77,8 +77,7 @@ void processDeclContext(const std::string outputDir, const DeclContext* ds, - } - - int main(int argc, char* argv[]) { -- llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags; -- FileSystemOptions FileSystemOpts; -+ CompilerInstance CI; - - std::string modeStr = argv[1]; - std::string astFile = argv[2]; -@@ -105,9 +104,13 @@ int main(int argc, char* argv[]) { - } - - // Parse source file -- ASTUnit *unit = ASTUnit::LoadFromASTFile(astFile, -- Diags, FileSystemOpts, -- false, 0, 0, true); -+ CI.createDiagnostics(); -+ IntrusiveRefCntPtr<DiagnosticsEngine> Diags(&CI.getDiagnostics()); -+ std::unique_ptr<ASTUnit> unit = -+ ASTUnit::LoadFromASTFile(astFile, -+ CI.getPCHContainerReader(), -+ Diags, -+ CI.getFileSystemOpts()); - - // Setup printing policy - // We want the bool type to be printed as "bool" -diff --git a/vm/generator/main/generator.hh b/vm/generator/main/generator.hh -index 73b67e4..1f809c2 100644 ---- a/vm/generator/main/generator.hh -+++ b/vm/generator/main/generator.hh -@@ -29,6 +29,7 @@ - - #include <clang/Frontend/ASTUnit.h> - #include <clang/AST/DeclTemplate.h> -+#include <clang/Frontend/CompilerInstance.h> - - typedef clang::ClassTemplateSpecializationDecl SpecDecl; - typedef clang::CXXRecordDecl ClassDecl; -@@ -36,17 +37,18 @@ typedef clang::CXXRecordDecl ClassDecl; - typedef llvm::raw_fd_ostream ostream; - - inline --void checkErrString(const std::string& err) { -- if (!err.empty()) { -- llvm::errs() << err << "\n"; -+void checkErrString(const std::error_code& err) { -+ if (err) { -+ llvm::errs() << err.message() << "\n"; - exit(1); - } - } - - inline - std::unique_ptr<ostream> openFileOutputStream(const std::string& fileName) { -- std::string err; -- auto result = std::unique_ptr<ostream>(new ostream(fileName.c_str(), err)); -+ std::error_code err; -+ auto result = std::unique_ptr<ostream>(new ostream(fileName.c_str(), err, -+ llvm::sys::fs::F_None)); - checkErrString(err); - - return result; -@@ -55,8 +57,8 @@ std::unique_ptr<ostream> openFileOutputStream(const std::string& fileName) { - inline - void withFileOutputStream(const std::string& fileName, - std::function<void (ostream&)> body) { -- std::string err; -- ostream stream(fileName.c_str(), err); -+ std::error_code err; -+ ostream stream(fileName.c_str(), err, llvm::sys::fs::F_None); - checkErrString(err); - - body(stream); -diff --git a/vm/generator/main/implementations.cc b/vm/generator/main/implementations.cc -index 2961625..b08c2af 100644 ---- a/vm/generator/main/implementations.cc -+++ b/vm/generator/main/implementations.cc -@@ -520,7 +520,7 @@ void ImplementationDef::makeOutput(llvm::raw_fd_ostream& to) { - << method->formals << ") {\n"; - - to << " "; -- if (!method->function->getResultType().getTypePtr()->isVoidType()) -+ if (!method->function->getReturnType().getTypePtr()->isVoidType()) - to << "return "; - - to << access << method->name; -diff --git a/vm/generator/main/utils.cc b/vm/generator/main/utils.cc -index 2932686..1cadec5 100644 ---- a/vm/generator/main/utils.cc -+++ b/vm/generator/main/utils.cc -@@ -213,7 +213,7 @@ void parseFunction(const clang::FunctionDecl* function, - bool hasSelfParam) { - - name = function->getNameAsString(); -- resultType = typeToString(function->getResultType()); -+ resultType = typeToString(function->getReturnType()); - - auto param_begin = function->param_begin() + (hasSelfParam ? 1 : 0); - auto param_end = function->param_end(); |