From 27cfc75740094e09371dc947a9df9f915c730a66 Mon Sep 17 00:00:00 2001 From: idriskalp Date: Thu, 23 Jan 2020 19:28:38 +0300 Subject: [PATCH] libc++ add to repo --- programming/misc/libc++/actions.py | 119 +++++++++++++++++++++++++++++ programming/misc/libc++/pspec.xml | 64 ++++++++++++++++ 2 files changed, 183 insertions(+) create mode 100755 programming/misc/libc++/actions.py create mode 100755 programming/misc/libc++/pspec.xml diff --git a/programming/misc/libc++/actions.py b/programming/misc/libc++/actions.py new file mode 100755 index 0000000000..7c09b26f61 --- /dev/null +++ b/programming/misc/libc++/actions.py @@ -0,0 +1,119 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU General Public License, version 3. +# See the file http://www.gnu.org/licenses/gpl.txt + +from pisi.actionsapi import pisitools +from pisi.actionsapi import shelltools +from pisi.actionsapi import autotools +from pisi.actionsapi import get + +WorkDir = "." + +NoStrip = ["/usr"] + +def setup(): + + shelltools.move("libcxx-%s.src" %get.srcVERSION(), "libcxx") + shelltools.move("libcxxabi-%s.src" %get.srcVERSION(), "libcxxabi") + +def build(): + + + + for arch in ["x86_64", "i686"]: + if arch == "x86_64": + shelltools.export("CC", "clang -m64 -target %s-pc-linux-gnu -rtlib=compiler-rt" %arch) + shelltools.export("CXX", "clang++ -m64 -target %s-pc-linux-gnu -rtlib=compiler-rt" %arch) + shelltools.export("LDFLAGS", " -fuse-ld=lld -rtlib=compiler-rt -L/usr/lib -ldl -lpthread") + libsuffix = " " + if arch == "i686": + shelltools.export("CC", "clang -m32 -target %s-pc-linux-gnu -rtlib=compiler-rt" %arch) + shelltools.export("CXX", "clang++ -m32 -target %s-pc-linux-gnu -rtlib=compiler-rt" %arch) + shelltools.export("LDFLAGS", "-fuse-ld=lld -L/usr/lib32 -ldl -lpthread") + libsuffix = "32" + + shelltools.cd("%s/libcxxabi" %get.workDIR()) + shelltools.system("mkdir build-%s" %arch) + shelltools.cd("build-%s" %arch) + + shelltools.system("cmake .. -G 'Unix Makefiles' \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_AR=/usr/bin/llvm-ar \ + -DCMAKE_RANLIB=/usr/bin/llvm-ranlib \ + -DCMAKE_STRIP=' ' \ + -DLIBCXXABI_ENABLE_EXCEPTIONS=ON \ + -DLIBCXXABI_ENABLE_THREADS=ON \ + -DLIBCXXABI_ENABLE_SHARED=OFF \ + -DLIBCXXABI_LIBCXX_INCLUDES=../../libcxx/include \ + -DLLVM_NO_OLD_LIBSTDCXX=TRUE \ + -DCXX_SUPPORTS_CXX11=TRUE \ + -DLIBCXXABI_HAS_PTHREAD_API=ON \ + -DLIBCXXABI_INSTALL_LIBRARY=OFF \ + -DLIBCXXABI_INSTALL_STATIC_LIBRARY=OFF \ + -DLIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS=OFF \ + -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON \ + ") + + autotools.make() + + shelltools.cd("%s/libcxx" %get.workDIR()) + shelltools.system("mkdir build-%s" %arch) + shelltools.cd("build-%s" %arch) + + shelltools.system("cmake .. -G 'Unix Makefiles' \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_AR=/usr/bin/llvm-ar \ + -DCMAKE_RANLIB=/usr/bin/llvm-ranlib \ + -DCMAKE_STRIP=' ' \ + -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON \ + -DLIBCXX_INSTALL_HEADERS=ON \ + -DLIBCXX_ENABLE_EXCEPTIONS=ON \ + -DLIBCXX_ENABLE_THREADS=ON \ + -DLIBCXX_ENABLE_MONOTONIC_CLOCK=ON \ + -DLIBCXX_ENABLE_SHARED=ON \ + -DLIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG=TRUE \ + -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=ON \ + -DLIBCXX_ENABLE_FILESYSTEM=ON \ + -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=TRUE \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DLIBCXX_CXX_ABI_INCLUDE_PATHS=../../libcxxabi/include \ + -DLIBCXX_CXX_ABI_LIBRARY_PATH=../../libcxxabi/build-%s/lib \ + -DLIBCXX_HAS_PTHREAD_API=ON \ + -DLIBCXX_LIBDIR_SUFFIX=%s \ + " % (arch, libsuffix) ) + + autotools.make() + + + + +def install(): + + for arch in ["x86_64", "i686"]: + shelltools.cd("%s/libcxx/build-%s" % (get.workDIR(), arch) ) + autotools.rawInstall("DESTDIR=%s" %get.installDIR()) + if arch == "x86_64": + libsuffix = "" + if arch == "i686": + libsuffix = "32" + pisitools.remove("/usr/lib%s/libc++.so" %libsuffix) + pisitools.remove("/usr/lib%s/libc++.so.1" %libsuffix) + pisitools.remove("/usr/lib%s/libc++.so.1.0" %libsuffix) + shelltools.copy("%s/libcxx/build-%s/lib%s/libc++.so" % (get.workDIR(), arch, libsuffix), "%s/usr/lib%s" %(get.installDIR(), libsuffix)) + shelltools.copy("%s/libcxx/build-%s/lib%s/libc++.so.1" % (get.workDIR(), arch, libsuffix), "%s/usr/lib%s" %(get.installDIR(), libsuffix)) + shelltools.copy("%s/libcxx/build-%s/lib%s/libc++.so.1.0" % (get.workDIR(), arch, libsuffix), "%s/usr/lib%s" %(get.installDIR(), libsuffix)) + shelltools.copy("%s/libcxx/build-%s/lib%s/libc++experimental.a" % (get.workDIR(), arch, libsuffix), "%s/usr/lib%s" %(get.installDIR(), libsuffix)) + + + + + #shelltools.system("cd %s/libcxx" % get.workDIR()) + #shelltools.system("mkdir -p %s/usr/share/doc/libc++" %get.installDIR()) + #shelltools.copy("%s/libcxx/CREDITS.TXT" %get.workDIR(), "%s/usr/share/doc/libc++" %get.installDIR()) + #shelltools.copy("%s/libcxx/LICENCE.TXT" %get.workDIR(), "%s/usr/share/doc/libc++" %get.installDIR()) + #shelltools.copy("%s/libcxx/NOTES.TXT" %get.workDIR(), "%s/usr/share/doc/libc++" %get.installDIR()) + #shelltools.copy("%s/libcxx/TODO.TXT" %get.workDIR(), "%s/usr/share/doc/libc++" %get.installDIR()) diff --git a/programming/misc/libc++/pspec.xml b/programming/misc/libc++/pspec.xml new file mode 100755 index 0000000000..7c0ee4c952 --- /dev/null +++ b/programming/misc/libc++/pspec.xml @@ -0,0 +1,64 @@ + + + + + libc++ + http://www.kde.org + + Idris Kalp + idriskalp@gmail.com + + MIT + library + LLVM C++ standard library. + libc++ provides standard c++ library by LLVM + https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/libcxx-9.0.1.src.tar.xz + https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/libcxxabi-9.0.1.src.tar.xz + + llvm + llvm-libs + llvm-clang + lld + + + + + libc++ + + libgcc + + + /usr/lib + + + + + libc++-32bit + libc++ 32bit shared libraries. + emul32 + + /usr/lib32 + + + + + libc++-devel + Development files for libc++ + + libc++ + + + /usr/include + + + + + + 20120-01-23 + 9.0.1 + First release + Idris Kalp + idriskalp@gmail.com + + +