From 3f540144cb3980664bffa2e00bdc8cfc41ee7def Mon Sep 17 00:00:00 2001 From: Ella-0 <23418164+Ella-0@users.noreply.github.com> Date: Mon, 28 Dec 2020 13:54:13 +0000 Subject: [PATCH] added libcxx --- lazypkg.sh | 6 +++- pkgs/libcxx/build.sh | 65 +++++++++++++++++++++++++++++++++++++ pkgs/netbsd-curses/build.sh | 8 ++--- 3 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 pkgs/libcxx/build.sh diff --git a/lazypkg.sh b/lazypkg.sh index 78dd02d..b73068c 100755 --- a/lazypkg.sh +++ b/lazypkg.sh @@ -1,4 +1,7 @@ #!/bin/dash +export MAKEFLAGS="-j6" +export CC=clang +export CXX=clang++ . ./build.sh dir=$(pwd) @@ -47,7 +50,8 @@ echo $ext | tr ':' '\n' | while read e; do cd $srcdir mkdir -p $dir/out/$pkgname-\$e pkgdir=$dir/out/$pkgname-\$e - package_\$e + + package_\$(echo \$e | tr '-' '_') mkdir -p $dir/out/$pkgname-\$e/lib/lazypkg diff --git a/pkgs/libcxx/build.sh b/pkgs/libcxx/build.sh new file mode 100644 index 0000000..122bbe4 --- /dev/null +++ b/pkgs/libcxx/build.sh @@ -0,0 +1,65 @@ +pkgver=11.0.0 +pkgname=libcxx +bad="" +ext="dev" + +fetch() { + curl -L "https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/llvm-project-11.0.0.tar.xz" -o $pkgname-$pkgver.tar.gz + tar -xf $pkgname-$pkgver.tar.gz + mv llvm-project-$pkgver $pkgname-$pkgver +} + +build() { + cd $pkgname-$pkgver + mkdir -p build + cd build + cmake -G Ninja \ + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ + -DCMAKE_INSTALL_PREFIX=/ \ + -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_ENABLE_LLD=ON \ + -DLLVM_ENABLE_PROJECTS="libunwind;libcxx;libcxxabi" \ + -DLLVM_TARGETS_TO_BUILD=X86 \ + -DLIBCXX_ENABLE_FILESYSTEM=ON \ + -DLIBCXX_USE_COMPILER_RT=ON \ + -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \ + -DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=ON \ + -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \ + -DLIBCXXABI_ENABLE_ASSERTIONS=ON \ + -DLIBCXXABI_USE_COMPILER_RT=ON \ + -DLIBCXXABI_USE_LLVM_UNWINDER=ON \ + -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON \ + -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY=YES \ + -DLIBCXXABI_ENABLE_SHARED=ON \ + -DLIBCXXABI_ENABLE_STATIC=ON \ + -DLIBUNWIND_ENABLE_SHARED=ON \ + -DLIBUNWIND_ENABLE_STATIC=ON \ + -DLIBUNWIND_USE_COMPILER_RT=ON \ + ../llvm +# -DLIBCXX_HAS_MUSL_LIBC=ON \ + samu cxx unwind +} + +package() { + cd $pkgname-$pkgver + cd build + DESTDIR=$pkgdir samu install-cxx install-unwind + rm $pkgdir/lib/*.a + rm -r $pkgdir/include +} + +package_dev() { + cd $pkgname-$pkgver + cd build + DESTDIR=$pkgdir samu install-cxx install-cxx-headers install-unwind + rm $pkgdir/lib/*.so.* + rm $pkgdir/lib/*.so +} + +license() { + cd $pkgname-$pkgver + cat libcxx/LICENSE.TXT + cat libcxxabi/LICENSE.TXT + cat libunwind/LICENSE.TXT +} diff --git a/pkgs/netbsd-curses/build.sh b/pkgs/netbsd-curses/build.sh index 0841c93..7a636e5 100644 --- a/pkgs/netbsd-curses/build.sh +++ b/pkgs/netbsd-curses/build.sh @@ -10,12 +10,12 @@ fetch() { build() { cd $pkgname-$pkgver - make + ckati } package() { cd $pkgname-$pkgver - make install DESTDIR=$pkgdir PREFIX=/ + ckati install DESTDIR=$pkgdir PREFIX=/ rm -r $pkgdir/share rm $pkgdir/lib/*.a rm -r $pkgdir/include @@ -24,7 +24,7 @@ package() { package_doc() { cd $pkgname-$pkgver - make install DESTDIR=$pkgdir PREFIX=/ + ckati install DESTDIR=$pkgdir PREFIX=/ rm -r $pkgdir/bin rm -r $pkgdir/lib rm -r $pkgdir/include @@ -32,7 +32,7 @@ package_doc() { package_dev() { cd $pkgname-$pkgver - make install DESTDIR=$pkgdir PREFIX=/ + ckati install DESTDIR=$pkgdir PREFIX=/ rm $pkgdir/lib/*.so rm -r $pkgdir/include rm -r $pkgdir/share