libc++ add to repo

This commit is contained in:
idriskalp
2020-01-23 19:28:38 +03:00
parent ec07754666
commit 27cfc75740
2 changed files with 183 additions and 0 deletions
+119
View File
@@ -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())
+64
View File
@@ -0,0 +1,64 @@
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
<Source>
<Name>libc++</Name>
<Homepage>http://www.kde.org</Homepage>
<Packager>
<Name>Idris Kalp</Name>
<Email>idriskalp@gmail.com</Email>
</Packager>
<License>MIT</License>
<IsA>library</IsA>
<Summary>LLVM C++ standard library.</Summary>
<Description>libc++ provides standard c++ library by LLVM</Description>
<Archive sha1sum="d6da82e9445fe824f021baf35f81a7efb6096ae3" type="tarxz">https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/libcxx-9.0.1.src.tar.xz</Archive>
<Archive sha1sum="457cec7f1dff38648518416a292853c8d643fe4e" type="tarxz">https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/libcxxabi-9.0.1.src.tar.xz</Archive>
<BuildDependencies>
<Dependency>llvm</Dependency>
<Dependency>llvm-libs</Dependency>
<Dependency>llvm-clang</Dependency>
<Dependency>lld</Dependency>
</BuildDependencies>
</Source>
<Package>
<Name>libc++</Name>
<RuntimeDependencies>
<Dependency>libgcc</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="library">/usr/lib</Path>
</Files>
</Package>
<Package>
<Name>libc++-32bit</Name>
<Summary>libc++ 32bit shared libraries.</Summary>
<PartOf>emul32</PartOf>
<Files>
<Path fileType="library">/usr/lib32</Path>
</Files>
</Package>
<Package>
<Name>libc++-devel</Name>
<Summary>Development files for libc++</Summary>
<RuntimeDependencies>
<Dependency release="current">libc++</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="header">/usr/include</Path>
</Files>
</Package>
<History>
<Update release="1">
<Date>20120-01-23</Date>
<Version>9.0.1</Version>
<Comment>First release</Comment>
<Name>Idris Kalp</Name>
<Email>idriskalp@gmail.com</Email>
</Update>
</History>
</PISI>