From 7c4e1c14af89699fe34926ca57899188a39c130b Mon Sep 17 00:00:00 2001 From: Erica Z Date: Tue, 23 Apr 2024 13:44:03 +0200 Subject: [PATCH 1/5] contrib/mingw-w64-headers: new package (12.0.0) --- contrib/mingw-w64-headers-aarch64 | 1 + contrib/mingw-w64-headers-armv7 | 1 + contrib/mingw-w64-headers-i686 | 1 + contrib/mingw-w64-headers-x86_64 | 1 + contrib/mingw-w64-headers/template.py | 71 +++++++++++++++++++++++++++ contrib/mingw-w64-headers/update.py | 1 + 6 files changed, 76 insertions(+) create mode 120000 contrib/mingw-w64-headers-aarch64 create mode 120000 contrib/mingw-w64-headers-armv7 create mode 120000 contrib/mingw-w64-headers-i686 create mode 120000 contrib/mingw-w64-headers-x86_64 create mode 100644 contrib/mingw-w64-headers/template.py create mode 100644 contrib/mingw-w64-headers/update.py diff --git a/contrib/mingw-w64-headers-aarch64 b/contrib/mingw-w64-headers-aarch64 new file mode 120000 index 0000000000..af80266f0e --- /dev/null +++ b/contrib/mingw-w64-headers-aarch64 @@ -0,0 +1 @@ +mingw-w64-headers \ No newline at end of file diff --git a/contrib/mingw-w64-headers-armv7 b/contrib/mingw-w64-headers-armv7 new file mode 120000 index 0000000000..af80266f0e --- /dev/null +++ b/contrib/mingw-w64-headers-armv7 @@ -0,0 +1 @@ +mingw-w64-headers \ No newline at end of file diff --git a/contrib/mingw-w64-headers-i686 b/contrib/mingw-w64-headers-i686 new file mode 120000 index 0000000000..af80266f0e --- /dev/null +++ b/contrib/mingw-w64-headers-i686 @@ -0,0 +1 @@ +mingw-w64-headers \ No newline at end of file diff --git a/contrib/mingw-w64-headers-x86_64 b/contrib/mingw-w64-headers-x86_64 new file mode 120000 index 0000000000..af80266f0e --- /dev/null +++ b/contrib/mingw-w64-headers-x86_64 @@ -0,0 +1 @@ +mingw-w64-headers \ No newline at end of file diff --git a/contrib/mingw-w64-headers/template.py b/contrib/mingw-w64-headers/template.py new file mode 100644 index 0000000000..26667d5be8 --- /dev/null +++ b/contrib/mingw-w64-headers/template.py @@ -0,0 +1,71 @@ +pkgname = "mingw-w64-headers" +pkgver = "12.0.0" +pkgrel = 0 +build_wrksrc = "mingw-w64-headers" +build_style = "gnu_configure" +hostmakedepends = ["autoconf", "automake", "libtool"] +depends = [] +pkgdesc = "Header files for Windows development" +maintainer = "Erica Z " +license = "ZPL-2.1" +url = "https://www.mingw-w64.org" +source = f"$(SOURCEFORGE_SITE)/mingw-w64/mingw-w64-v{pkgver}.tar.bz2" +sha256 = "cc41898aac4b6e8dd5cffd7331b9d9515b912df4420a3a612b5ea2955bbeed2f" +options = ["empty"] + +_targets = ["x86_64", "i686", "aarch64", "armv7"] + +for _an in _targets: + depends += [self.with_pkgver(f"mingw-w64-headers-{_an}")] + + +def do_configure(self): + from cbuild.util import gnu_configure + + for an in _targets: + at = an + "-w64-mingw32" + with self.stamp(f"{an}_configure") as s: + s.check() + gnu_configure.configure( + self, + configure_args=[ + f"--host={at}", + f"--prefix=/usr/{at}", + ], + build_dir=f"build-{an}", + ) + + +def do_build(self): + for an in _targets: + with self.stamp(f"{an}_build") as s: + s.check() + self.make.build(wrksrc=f"build-{an}") + + +def do_check(self): + for an in _targets: + with self.stamp(f"{an}_check") as s: + s.check() + self.make.check(wrksrc=f"build-{an}") + + +def do_install(self): + for an in _targets: + with self.stamp(f"{an}_install") as s: + s.check() + self.make.install( + wrksrc=f"build-{an}", + ) + + +def _gen(an, at): + @subpackage(f"mingw-w64-headers-{an}") + def _subp(self): + self.subdesc = f"{an} support" + return [f"usr/{at}"] + + +for _an in _targets: + _at = _an + "-w64-mingw32" + _gen(_an, _at) diff --git a/contrib/mingw-w64-headers/update.py b/contrib/mingw-w64-headers/update.py new file mode 100644 index 0000000000..5a12ad88c2 --- /dev/null +++ b/contrib/mingw-w64-headers/update.py @@ -0,0 +1 @@ +pattern = r"mingw-w64-v([0-9.]+).tar.bz2" From 63834fc8a6839ac485cd2e679c4472359f320287 Mon Sep 17 00:00:00 2001 From: Erica Z Date: Tue, 23 Apr 2024 13:44:15 +0200 Subject: [PATCH 2/5] contrib/mingw-w64-crt: new package (12.0.0) --- contrib/mingw-w64-crt-aarch64 | 1 + contrib/mingw-w64-crt-armv7 | 1 + contrib/mingw-w64-crt-i686 | 1 + contrib/mingw-w64-crt-x86_64 | 1 + contrib/mingw-w64-crt/template.py | 91 +++++++++++++++++++++++++++++++ contrib/mingw-w64-crt/update.py | 1 + 6 files changed, 96 insertions(+) create mode 120000 contrib/mingw-w64-crt-aarch64 create mode 120000 contrib/mingw-w64-crt-armv7 create mode 120000 contrib/mingw-w64-crt-i686 create mode 120000 contrib/mingw-w64-crt-x86_64 create mode 100644 contrib/mingw-w64-crt/template.py create mode 100644 contrib/mingw-w64-crt/update.py diff --git a/contrib/mingw-w64-crt-aarch64 b/contrib/mingw-w64-crt-aarch64 new file mode 120000 index 0000000000..a76309d058 --- /dev/null +++ b/contrib/mingw-w64-crt-aarch64 @@ -0,0 +1 @@ +mingw-w64-crt \ No newline at end of file diff --git a/contrib/mingw-w64-crt-armv7 b/contrib/mingw-w64-crt-armv7 new file mode 120000 index 0000000000..a76309d058 --- /dev/null +++ b/contrib/mingw-w64-crt-armv7 @@ -0,0 +1 @@ +mingw-w64-crt \ No newline at end of file diff --git a/contrib/mingw-w64-crt-i686 b/contrib/mingw-w64-crt-i686 new file mode 120000 index 0000000000..a76309d058 --- /dev/null +++ b/contrib/mingw-w64-crt-i686 @@ -0,0 +1 @@ +mingw-w64-crt \ No newline at end of file diff --git a/contrib/mingw-w64-crt-x86_64 b/contrib/mingw-w64-crt-x86_64 new file mode 120000 index 0000000000..a76309d058 --- /dev/null +++ b/contrib/mingw-w64-crt-x86_64 @@ -0,0 +1 @@ +mingw-w64-crt \ No newline at end of file diff --git a/contrib/mingw-w64-crt/template.py b/contrib/mingw-w64-crt/template.py new file mode 100644 index 0000000000..a0a0c165ed --- /dev/null +++ b/contrib/mingw-w64-crt/template.py @@ -0,0 +1,91 @@ +pkgname = "mingw-w64-crt" +pkgver = "12.0.0" +pkgrel = 0 +build_wrksrc = "mingw-w64-crt" +build_style = "gnu_configure" +configure_args = ["--disable-dependency-tracking"] +make_cmd = "gmake" +hostmakedepends = ["autoconf", "automake", "libtool", "gmake"] +depends = [] +pkgdesc = "C runtime for Windows development" +maintainer = "Erica Z " +license = "ZPL-2.1" +url = "https://www.mingw-w64.org" +source = f"$(SOURCEFORGE_SITE)/mingw-w64/mingw-w64-v{pkgver}.tar.bz2" +sha256 = "cc41898aac4b6e8dd5cffd7331b9d9515b912df4420a3a612b5ea2955bbeed2f" +# checks fail +options = ["empty", "!check"] + +_targets = ["x86_64", "i686", "aarch64", "armv7"] + +for _an in _targets: + hostmakedepends += [f"mingw-w64-headers-{_an}"] + + +def do_configure(self): + for an in _targets: + at = an + "-w64-mingw32" + eargs = [ + f"--host={at}", + f"--prefix=/usr/{at}", + ] + match an: + case "x86_64": + eargs += ["--disable-lib32"] + case "i686": + eargs += ["--disable-lib64"] + case "aarch64" | "armv7": + eargs += ["--disable-lib32", "--disable-lib64"] + self.mkdir(f"build-{an}") + with self.stamp(f"{an}_configure") as s: + s.check() + self.do( + self.chroot_cwd / "configure", + *configure_args, + *eargs, + wrksrc=f"build-{an}", + env={ + "CC": f"clang -target {at}", + "CFLAGS": "", + "LDFLAGS": "", + }, + ) + + +def do_build(self): + for an in _targets: + with self.stamp(f"{an}_build") as s: + s.check() + self.make.build(wrksrc=f"build-{an}") + + +def do_check(self): + for an in _targets: + with self.stamp(f"{an}_check") as s: + s.check() + self.make.check(wrksrc=f"build-{an}") + + +def do_install(self): + for an in _targets: + with self.stamp(f"{an}_install") as s: + s.check() + self.make.install( + wrksrc=f"build-{an}", + ) + + +def _gen(an, at): + @subpackage(f"mingw-w64-crt-{an}") + def _subp(self): + self.subdesc = an + self.depends = [f"mingw-w64-headers-{an}"] + + return [f"usr/{at}"] + + depends.append(self.with_pkgver(f"mingw-w64-crt-{_an}")) + + +for _an in _targets: + _at = _an + "-w64-mingw32" + _gen(_an, _at) diff --git a/contrib/mingw-w64-crt/update.py b/contrib/mingw-w64-crt/update.py new file mode 100644 index 0000000000..5a12ad88c2 --- /dev/null +++ b/contrib/mingw-w64-crt/update.py @@ -0,0 +1 @@ +pattern = r"mingw-w64-v([0-9.]+).tar.bz2" From 58ea21299cd1f9d59baec565e59447dea98b03a4 Mon Sep 17 00:00:00 2001 From: Erica Z Date: Tue, 23 Jul 2024 19:52:45 +0200 Subject: [PATCH 3/5] contrib/mingw-w64-winpthreads: new package (12.0.0) --- contrib/mingw-w64-winpthreads-aarch64 | 1 + contrib/mingw-w64-winpthreads-armv7 | 1 + contrib/mingw-w64-winpthreads-i686 | 1 + contrib/mingw-w64-winpthreads-x86_64 | 1 + contrib/mingw-w64-winpthreads/template.py | 91 +++++++++++++++++++++++ contrib/mingw-w64-winpthreads/update.py | 1 + 6 files changed, 96 insertions(+) create mode 120000 contrib/mingw-w64-winpthreads-aarch64 create mode 120000 contrib/mingw-w64-winpthreads-armv7 create mode 120000 contrib/mingw-w64-winpthreads-i686 create mode 120000 contrib/mingw-w64-winpthreads-x86_64 create mode 100644 contrib/mingw-w64-winpthreads/template.py create mode 100644 contrib/mingw-w64-winpthreads/update.py diff --git a/contrib/mingw-w64-winpthreads-aarch64 b/contrib/mingw-w64-winpthreads-aarch64 new file mode 120000 index 0000000000..b2340ae9b2 --- /dev/null +++ b/contrib/mingw-w64-winpthreads-aarch64 @@ -0,0 +1 @@ +mingw-w64-winpthreads \ No newline at end of file diff --git a/contrib/mingw-w64-winpthreads-armv7 b/contrib/mingw-w64-winpthreads-armv7 new file mode 120000 index 0000000000..b2340ae9b2 --- /dev/null +++ b/contrib/mingw-w64-winpthreads-armv7 @@ -0,0 +1 @@ +mingw-w64-winpthreads \ No newline at end of file diff --git a/contrib/mingw-w64-winpthreads-i686 b/contrib/mingw-w64-winpthreads-i686 new file mode 120000 index 0000000000..b2340ae9b2 --- /dev/null +++ b/contrib/mingw-w64-winpthreads-i686 @@ -0,0 +1 @@ +mingw-w64-winpthreads \ No newline at end of file diff --git a/contrib/mingw-w64-winpthreads-x86_64 b/contrib/mingw-w64-winpthreads-x86_64 new file mode 120000 index 0000000000..b2340ae9b2 --- /dev/null +++ b/contrib/mingw-w64-winpthreads-x86_64 @@ -0,0 +1 @@ +mingw-w64-winpthreads \ No newline at end of file diff --git a/contrib/mingw-w64-winpthreads/template.py b/contrib/mingw-w64-winpthreads/template.py new file mode 100644 index 0000000000..e8df006b26 --- /dev/null +++ b/contrib/mingw-w64-winpthreads/template.py @@ -0,0 +1,91 @@ +pkgname = "mingw-w64-winpthreads" +pkgver = "12.0.0" +pkgrel = 0 +build_wrksrc = "mingw-w64-libraries/winpthreads" +build_style = "gnu_configure" +configure_args = ["--disable-dependency-tracking"] +make_cmd = "gmake" +hostmakedepends = ["autoconf", "automake", "libtool", "gmake"] +depends = [] +checkdepends = [] +pkgdesc = "POSIX threading APIs for Windows development" +maintainer = "Erica Z " +license = "ZPL-2.1" +url = "https://www.mingw-w64.org" +source = f"$(SOURCEFORGE_SITE)/mingw-w64/mingw-w64-v{pkgver}.tar.bz2" +sha256 = "cc41898aac4b6e8dd5cffd7331b9d9515b912df4420a3a612b5ea2955bbeed2f" +# check requires libunwind +options = ["empty", "!check"] + +_targets = ["x86_64", "i686", "aarch64", "armv7"] + +for _an in _targets: + hostmakedepends += [f"mingw-w64-headers-{_an}"] + checkdepends += [f"mingw-w64-crt-{_an}"] + + +def do_configure(self): + for an in _targets: + at = an + "-w64-mingw32" + eargs = [ + f"--host={at}", + f"--prefix=/usr/{at}", + ] + self.mkdir(f"build-{an}") + with self.stamp(f"{an}_configure") as s: + s.check() + self.do( + self.chroot_cwd / "configure", + *configure_args, + *eargs, + wrksrc=f"build-{an}", + env={ + "CC": f"clang -target {at}", + "CFLAGS": "", + "LDFLAGS": "", + }, + ) + + +def do_build(self): + for an in _targets: + with self.stamp(f"{an}_build") as s: + s.check() + self.make.build(wrksrc=f"build-{an}") + + +def do_check(self): + for an in _targets: + with self.stamp(f"{an}_check") as s: + s.check() + self.make.check(wrksrc=f"build-{an}") + + +def do_install(self): + for an in _targets: + with self.stamp(f"{an}_install") as s: + at = an + "-w64-mingw32" + s.check() + self.make.install( + wrksrc=f"build-{an}", + ) + + # don't step on mingw-w64-headers + for hdr in ["signal", "time", "unistd"]: + self.uninstall(f"usr/{at}/include/pthread_{hdr}.h") + + +def _gen(an, at): + @subpackage(f"mingw-w64-winpthreads-{an}") + def _subp(self): + self.subdesc = an + self.depends = [f"mingw-w64-crt-{an}"] + + return [f"usr/{at}"] + + depends.append(self.with_pkgver(f"mingw-w64-winpthreads-{_an}")) + + +for _an in _targets: + _at = _an + "-w64-mingw32" + _gen(_an, _at) diff --git a/contrib/mingw-w64-winpthreads/update.py b/contrib/mingw-w64-winpthreads/update.py new file mode 100644 index 0000000000..5a12ad88c2 --- /dev/null +++ b/contrib/mingw-w64-winpthreads/update.py @@ -0,0 +1 @@ +pattern = r"mingw-w64-v([0-9.]+).tar.bz2" From db5f7c30bfb31dcfde907d729ca1f4ce69a72676 Mon Sep 17 00:00:00 2001 From: Erica Z Date: Sat, 27 Apr 2024 17:45:18 +0200 Subject: [PATCH 4/5] contrib/clang-rt-builtins-mingw-w64: new package (18.1.8) --- contrib/clang-rt-builtins-mingw-w64-aarch64 | 1 + contrib/clang-rt-builtins-mingw-w64-armv7 | 1 + contrib/clang-rt-builtins-mingw-w64-i686 | 1 + contrib/clang-rt-builtins-mingw-w64-x86_64 | 1 + .../clang-rt-builtins-mingw-w64/template.py | 114 ++++++++++++++++++ contrib/clang-rt-builtins-mingw-w64/update.py | 1 + 6 files changed, 119 insertions(+) create mode 120000 contrib/clang-rt-builtins-mingw-w64-aarch64 create mode 120000 contrib/clang-rt-builtins-mingw-w64-armv7 create mode 120000 contrib/clang-rt-builtins-mingw-w64-i686 create mode 120000 contrib/clang-rt-builtins-mingw-w64-x86_64 create mode 100644 contrib/clang-rt-builtins-mingw-w64/template.py create mode 100644 contrib/clang-rt-builtins-mingw-w64/update.py diff --git a/contrib/clang-rt-builtins-mingw-w64-aarch64 b/contrib/clang-rt-builtins-mingw-w64-aarch64 new file mode 120000 index 0000000000..f9ddd30665 --- /dev/null +++ b/contrib/clang-rt-builtins-mingw-w64-aarch64 @@ -0,0 +1 @@ +clang-rt-builtins-mingw-w64 \ No newline at end of file diff --git a/contrib/clang-rt-builtins-mingw-w64-armv7 b/contrib/clang-rt-builtins-mingw-w64-armv7 new file mode 120000 index 0000000000..f9ddd30665 --- /dev/null +++ b/contrib/clang-rt-builtins-mingw-w64-armv7 @@ -0,0 +1 @@ +clang-rt-builtins-mingw-w64 \ No newline at end of file diff --git a/contrib/clang-rt-builtins-mingw-w64-i686 b/contrib/clang-rt-builtins-mingw-w64-i686 new file mode 120000 index 0000000000..f9ddd30665 --- /dev/null +++ b/contrib/clang-rt-builtins-mingw-w64-i686 @@ -0,0 +1 @@ +clang-rt-builtins-mingw-w64 \ No newline at end of file diff --git a/contrib/clang-rt-builtins-mingw-w64-x86_64 b/contrib/clang-rt-builtins-mingw-w64-x86_64 new file mode 120000 index 0000000000..f9ddd30665 --- /dev/null +++ b/contrib/clang-rt-builtins-mingw-w64-x86_64 @@ -0,0 +1 @@ +clang-rt-builtins-mingw-w64 \ No newline at end of file diff --git a/contrib/clang-rt-builtins-mingw-w64/template.py b/contrib/clang-rt-builtins-mingw-w64/template.py new file mode 100644 index 0000000000..0201ffe9dd --- /dev/null +++ b/contrib/clang-rt-builtins-mingw-w64/template.py @@ -0,0 +1,114 @@ +pkgname = "clang-rt-builtins-mingw-w64" +pkgver = "18.1.8" +pkgrel = 0 +build_style = "cmake" +configure_args = [ + "-DCMAKE_BUILD_TYPE=Release", + "-DCMAKE_SYSTEM_NAME=Windows", + f"-DCMAKE_INSTALL_PREFIX=/usr/lib/clang/{pkgver[0:pkgver.find('.')]}", + # prevent executable checks + "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY", + # only build that target + "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON", + # tools + "-DCMAKE_C_COMPILER=/usr/bin/clang", + "-DCMAKE_AR=/usr/bin/llvm-ar", + "-DCMAKE_NM=/usr/bin/llvm-nm", + "-DCMAKE_RANLIB=/usr/bin/llvm-ranlib", + # we are only building builtins at this point + "-DCOMPILER_RT_BUILD_BUILTINS=ON", + # disable everything else + "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF", + "-DCOMPILER_RT_BUILD_MEMPROF=OFF", + "-DCOMPILER_RT_BUILD_PROFILE=OFF", + "-DCOMPILER_RT_BUILD_SANITIZERS=OFF", + "-DCOMPILER_RT_BUILD_XRAY=OFF", + "-DCOMPILER_RT_BUILD_ORC=OFF", +] +cmake_dir = "compiler-rt" +hostmakedepends = [ + "clang-tools-extra", + "cmake", + "python", + "llvm-devel", +] +depends = [] +pkgdesc = "Clang runtime builtins for Windows development" +maintainer = "Erica Z " +license = "Apache-2.0" +url = "https://llvm.org" +source = f"https://github.com/llvm/llvm-project/releases/download/llvmorg-{pkgver}/llvm-project-{pkgver}.src.tar.xz" +sha256 = "0b58557a6d32ceee97c8d533a59b9212d87e0fc4d2833924eb6c611247db2f2a" +# crosstoolchain +options = ["!check", "empty"] + +_targets = ["x86_64", "i686", "aarch64", "armv7"] + +for _an in _targets: + hostmakedepends += [ + f"mingw-w64-headers-{_an}", + ] + + +def do_configure(self): + from cbuild.util import cmake + + for an in _targets: + at = an + "-w64-mingw32" + with self.stamp(f"{an}_configure") as s: + s.check() + cmake.configure( + self, + f"build-{an}", + self.cmake_dir, + [ + *self.configure_args, + f"-DCMAKE_SYSROOT=/usr/{at}", + f"-DCMAKE_ASM_COMPILER_TARGET={at}", + f"-DCMAKE_C_COMPILER_TARGET={at}", + f"-DCMAKE_CXX_COMPILER_TARGET={at}", + ], + cross_build=False, + generator="Unix Makefiles", + ) + + +def do_build(self): + from cbuild.util import cmake + + for an in _targets: + with self.stamp(f"{an}_build") as s: + s.check() + cmake.build(self, f"build-{an}") + + +def do_install(self): + from cbuild.util import cmake + + for an in _targets: + cmake.install(self, f"build-{an}") + + +def _gen(an, at): + @subpackage(f"clang-rt-builtins-mingw-w64-{an}") + def _subp(self): + match an: + case "aarch64" | "x86_64": + suffix = an + case "armv7": + suffix = "arm" + case "i686": + suffix = "i386" + + self.subdesc = f"{an} support" + self.depends = ["clang"] + # strip not supported for COFF + self.options = ["!strip", "!lintstatic"] + + return [f"usr/lib/clang/*/lib/windows/libclang_rt.builtins-{suffix}.a"] + + depends.append(self.with_pkgver(f"clang-rt-builtins-mingw-w64-{an}")) + + +for _an in _targets: + _gen(_an, _an + "-w64-mingw32") diff --git a/contrib/clang-rt-builtins-mingw-w64/update.py b/contrib/clang-rt-builtins-mingw-w64/update.py new file mode 100644 index 0000000000..faff136d0a --- /dev/null +++ b/contrib/clang-rt-builtins-mingw-w64/update.py @@ -0,0 +1 @@ +pkgname = "llvmorg" From f23fc3f3c59a5bf9d3aea61cb0cc621ed328fddd Mon Sep 17 00:00:00 2001 From: Erica Z Date: Thu, 25 Apr 2024 10:36:17 +0200 Subject: [PATCH 5/5] contrib/libcxx-mingw-w64: new package (18.1.8) --- contrib/libcxx-mingw-w64-aarch64 | 1 + contrib/libcxx-mingw-w64-armv7 | 1 + contrib/libcxx-mingw-w64-i686 | 1 + contrib/libcxx-mingw-w64-x86_64 | 1 + contrib/libcxx-mingw-w64/template.py | 191 +++++++++++++++++++++++++++ contrib/libcxx-mingw-w64/update.py | 1 + contrib/libcxxabi-mingw-w64 | 1 + contrib/libcxxabi-mingw-w64-aarch64 | 1 + contrib/libcxxabi-mingw-w64-armv7 | 1 + contrib/libcxxabi-mingw-w64-i686 | 1 + contrib/libcxxabi-mingw-w64-x86_64 | 1 + contrib/libunwind-mingw-w64 | 1 + contrib/libunwind-mingw-w64-aarch64 | 1 + contrib/libunwind-mingw-w64-armv7 | 1 + contrib/libunwind-mingw-w64-i686 | 1 + contrib/libunwind-mingw-w64-x86_64 | 1 + 16 files changed, 206 insertions(+) create mode 120000 contrib/libcxx-mingw-w64-aarch64 create mode 120000 contrib/libcxx-mingw-w64-armv7 create mode 120000 contrib/libcxx-mingw-w64-i686 create mode 120000 contrib/libcxx-mingw-w64-x86_64 create mode 100644 contrib/libcxx-mingw-w64/template.py create mode 100644 contrib/libcxx-mingw-w64/update.py create mode 120000 contrib/libcxxabi-mingw-w64 create mode 120000 contrib/libcxxabi-mingw-w64-aarch64 create mode 120000 contrib/libcxxabi-mingw-w64-armv7 create mode 120000 contrib/libcxxabi-mingw-w64-i686 create mode 120000 contrib/libcxxabi-mingw-w64-x86_64 create mode 120000 contrib/libunwind-mingw-w64 create mode 120000 contrib/libunwind-mingw-w64-aarch64 create mode 120000 contrib/libunwind-mingw-w64-armv7 create mode 120000 contrib/libunwind-mingw-w64-i686 create mode 120000 contrib/libunwind-mingw-w64-x86_64 diff --git a/contrib/libcxx-mingw-w64-aarch64 b/contrib/libcxx-mingw-w64-aarch64 new file mode 120000 index 0000000000..3217560f7b --- /dev/null +++ b/contrib/libcxx-mingw-w64-aarch64 @@ -0,0 +1 @@ +libcxx-mingw-w64 \ No newline at end of file diff --git a/contrib/libcxx-mingw-w64-armv7 b/contrib/libcxx-mingw-w64-armv7 new file mode 120000 index 0000000000..3217560f7b --- /dev/null +++ b/contrib/libcxx-mingw-w64-armv7 @@ -0,0 +1 @@ +libcxx-mingw-w64 \ No newline at end of file diff --git a/contrib/libcxx-mingw-w64-i686 b/contrib/libcxx-mingw-w64-i686 new file mode 120000 index 0000000000..3217560f7b --- /dev/null +++ b/contrib/libcxx-mingw-w64-i686 @@ -0,0 +1 @@ +libcxx-mingw-w64 \ No newline at end of file diff --git a/contrib/libcxx-mingw-w64-x86_64 b/contrib/libcxx-mingw-w64-x86_64 new file mode 120000 index 0000000000..3217560f7b --- /dev/null +++ b/contrib/libcxx-mingw-w64-x86_64 @@ -0,0 +1 @@ +libcxx-mingw-w64 \ No newline at end of file diff --git a/contrib/libcxx-mingw-w64/template.py b/contrib/libcxx-mingw-w64/template.py new file mode 100644 index 0000000000..251659a639 --- /dev/null +++ b/contrib/libcxx-mingw-w64/template.py @@ -0,0 +1,191 @@ +pkgname = "libcxx-mingw-w64" +pkgver = "18.1.8" +pkgrel = 0 +build_style = "cmake" +configure_args = [ + "-DCMAKE_SYSTEM_NAME=Windows", + "-DCMAKE_BUILD_TYPE=Release", + "-DCMAKE_C_COMPILER=/usr/bin/clang", + "-DCMAKE_CXX_COMPILER=/usr/bin/clang++", + "-DCMAKE_AR=/usr/bin/llvm-ar", + "-DCMAKE_NM=/usr/bin/llvm-nm", + "-DCMAKE_RANLIB=/usr/bin/llvm-ranlib", + # prevent executable checks + "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY", + # build these runtimes + "-DLLVM_ENABLE_RUNTIMES=libcxx;libcxxabi;libunwind", + # don't use libgcc + "-DLIBUNWIND_USE_COMPILER_RT=ON", + "-DLIBCXX_USE_COMPILER_RT=ON", + "-DLIBCXXABI_USE_COMPILER_RT=ON", + # FIXME: undefined symbols + "-DLIBCXXABI_ENABLE_SHARED=OFF", + # ensures we don't need to link libc++abi manually + "-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON", + # helps split up target-agnostic from target-specific files + "-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON", + # tries to link to -ldl otherwise + "-DLIBUNWIND_HAS_DL_LIB=OFF", + # same but -latomic + "-DLIBCXX_HAS_ATOMIC_LIB=OFF", + # same but -lc (????) + "-DLIBCXXABI_HAS_C_LIB=OFF", +] +cmake_dir = "runtimes" +hostmakedepends = ["cmake", "python"] +depends = [ + self.with_pkgver("libcxxabi-mingw-w64"), + "mingw-w64-headers", +] +pkgdesc = "LLVM libc++ for Windows development" +maintainer = "Erica Z " +license = "Apache-2.0" +url = "https://llvm.org" +source = f"https://github.com/llvm/llvm-project/releases/download/llvmorg-{pkgver}/llvm-project-{pkgver}.src.tar.xz" +sha256 = "0b58557a6d32ceee97c8d533a59b9212d87e0fc4d2833924eb6c611247db2f2a" +# crosstoolchain +options = ["!check", "empty"] + +_targets = ["x86_64", "i686", "aarch64", "armv7"] + + +for _an in _targets: + hostmakedepends += [ + f"mingw-w64-crt-{_an}", + f"mingw-w64-winpthreads-{_an}", + f"clang-rt-builtins-mingw-w64-{_an}", + ] + + +def do_configure(self): + from cbuild.util import cmake + + for an in _targets: + at = an + "-w64-mingw32" + # configure libcxx + with self.stamp(f"{an}_configure") as s: + s.check() + cmake.configure( + self, + f"build-{an}", + self.cmake_dir, + [ + *self.configure_args, + f"-DCMAKE_SYSROOT=/usr/{at}", + # don't let llvm come up with its own triple + f"-DLLVM_DEFAULT_TARGET_TRIPLE={at}", + f"-DCMAKE_ASM_COMPILER_TARGET={at}", + f"-DCMAKE_CXX_COMPILER_TARGET={at}", + f"-DCMAKE_C_COMPILER_TARGET={at}", + ], + cross_build=False, + generator="Unix Makefiles", + env={ + "CFLAGS": "", + "CXXFLAGS": "", + "LDFLAGS": "", + }, + ) + + +def do_build(self): + from cbuild.util import cmake + + for an in _targets: + with self.stamp(f"{an}_build") as s: + s.check() + cmake.build(self, f"build-{an}", ["--verbose"]) + + +def do_install(self): + from cbuild.util import cmake + + for an in _targets: + with self.stamp(f"{an}_install") as s: + s.check() + cmake.install( + self, + f"build-{an}", + ) + + # move target-specific paths to sysroot so clang can find them later + at = an + "-w64-mingw32" + self.rename( + f"usr/include/{at}", f"usr/{at}/include", relative=False + ) + self.rename(f"usr/lib/{at}", f"usr/{at}/lib", relative=False) + + # why are dlls installed to a target-agnostic path anyway???? + self.rename("usr/bin", f"usr/{at}/bin", relative=False) + + # yoink remaining (target-agnostic) files + self.uninstall("usr/include") + self.uninstall("usr/lib") + + +def _gen(an, at): + @subpackage(f"libunwind-mingw-w64-{an}") + def _unw(self): + self.pkgdesc = "LLVM libunwind for Windows development" + self.subdesc = an + self.depends = [f"mingw-w64-crt-{an}"] + # strip not supported for COFF + self.options = ["!strip"] + + return [ + f"usr/{at}/lib/libunwind.*", + ] + + @subpackage(f"libcxxabi-mingw-w64-{an}") + def _abi(self): + self.pkgdesc = "LLVM libc++abi for Windows development" + self.subdesc = an + self.depends = [self.with_pkgver(f"libunwind-mingw-w64-{an}")] + self.options = ["!strip"] + + return [ + f"usr/{at}/lib/libc++abi*", + ] + + @subpackage(f"libcxx-mingw-w64-{an}") + def _subp(self): + self.subdesc = an + self.depends = [ + self.with_pkgver(f"libcxxabi-mingw-w64-{an}"), + # host headers + "libcxx-devel", + # for include_next + f"mingw-w64-headers-{an}", + ] + self.options = ["!strip"] + + return [f"usr/{at}"] + + depends.append(self.with_pkgver(f"libcxx-mingw-w64-{an}")) + + +for _an in _targets: + _at = _an + "-w64-mingw32" + _gen(_an, _at) + + +@subpackage("libunwind-mingw-w64") +def _unw(self): + self.pkgdesc = "LLVM libunwind for Windows development" + self.depends = ["mingw-w64-crt"] + self.options = ["empty"] + for an in _targets: + self.depends.append(self.with_pkgver(f"libunwind-mingw-w64-{an}")) + + return [] + + +@subpackage("libcxxabi-mingw-w64") +def _abi(self): + self.pkgdesc = "LLVM libc++abi for Windows development" + self.depends = [self.with_pkgver("libunwind-mingw-w64")] + self.options = ["empty"] + for an in _targets: + self.depends.append(self.with_pkgver(f"libcxxabi-mingw-w64-{an}")) + + return [] diff --git a/contrib/libcxx-mingw-w64/update.py b/contrib/libcxx-mingw-w64/update.py new file mode 100644 index 0000000000..faff136d0a --- /dev/null +++ b/contrib/libcxx-mingw-w64/update.py @@ -0,0 +1 @@ +pkgname = "llvmorg" diff --git a/contrib/libcxxabi-mingw-w64 b/contrib/libcxxabi-mingw-w64 new file mode 120000 index 0000000000..3217560f7b --- /dev/null +++ b/contrib/libcxxabi-mingw-w64 @@ -0,0 +1 @@ +libcxx-mingw-w64 \ No newline at end of file diff --git a/contrib/libcxxabi-mingw-w64-aarch64 b/contrib/libcxxabi-mingw-w64-aarch64 new file mode 120000 index 0000000000..3217560f7b --- /dev/null +++ b/contrib/libcxxabi-mingw-w64-aarch64 @@ -0,0 +1 @@ +libcxx-mingw-w64 \ No newline at end of file diff --git a/contrib/libcxxabi-mingw-w64-armv7 b/contrib/libcxxabi-mingw-w64-armv7 new file mode 120000 index 0000000000..3217560f7b --- /dev/null +++ b/contrib/libcxxabi-mingw-w64-armv7 @@ -0,0 +1 @@ +libcxx-mingw-w64 \ No newline at end of file diff --git a/contrib/libcxxabi-mingw-w64-i686 b/contrib/libcxxabi-mingw-w64-i686 new file mode 120000 index 0000000000..3217560f7b --- /dev/null +++ b/contrib/libcxxabi-mingw-w64-i686 @@ -0,0 +1 @@ +libcxx-mingw-w64 \ No newline at end of file diff --git a/contrib/libcxxabi-mingw-w64-x86_64 b/contrib/libcxxabi-mingw-w64-x86_64 new file mode 120000 index 0000000000..3217560f7b --- /dev/null +++ b/contrib/libcxxabi-mingw-w64-x86_64 @@ -0,0 +1 @@ +libcxx-mingw-w64 \ No newline at end of file diff --git a/contrib/libunwind-mingw-w64 b/contrib/libunwind-mingw-w64 new file mode 120000 index 0000000000..3217560f7b --- /dev/null +++ b/contrib/libunwind-mingw-w64 @@ -0,0 +1 @@ +libcxx-mingw-w64 \ No newline at end of file diff --git a/contrib/libunwind-mingw-w64-aarch64 b/contrib/libunwind-mingw-w64-aarch64 new file mode 120000 index 0000000000..3217560f7b --- /dev/null +++ b/contrib/libunwind-mingw-w64-aarch64 @@ -0,0 +1 @@ +libcxx-mingw-w64 \ No newline at end of file diff --git a/contrib/libunwind-mingw-w64-armv7 b/contrib/libunwind-mingw-w64-armv7 new file mode 120000 index 0000000000..3217560f7b --- /dev/null +++ b/contrib/libunwind-mingw-w64-armv7 @@ -0,0 +1 @@ +libcxx-mingw-w64 \ No newline at end of file diff --git a/contrib/libunwind-mingw-w64-i686 b/contrib/libunwind-mingw-w64-i686 new file mode 120000 index 0000000000..3217560f7b --- /dev/null +++ b/contrib/libunwind-mingw-w64-i686 @@ -0,0 +1 @@ +libcxx-mingw-w64 \ No newline at end of file diff --git a/contrib/libunwind-mingw-w64-x86_64 b/contrib/libunwind-mingw-w64-x86_64 new file mode 120000 index 0000000000..3217560f7b --- /dev/null +++ b/contrib/libunwind-mingw-w64-x86_64 @@ -0,0 +1 @@ +libcxx-mingw-w64 \ No newline at end of file