Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] ldc: build in 2 stages, update to 1.30.0
@ 2022-12-06 15:41 sgn
  2022-12-06 18:09 ` [PR REVIEW] " oreo639
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: sgn @ 2022-12-06 15:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1247 bytes --]

There is a new pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages ldc-2-stage
https://github.com/void-linux/void-packages/pull/40931

ldc: build in 2 stages, update to 1.30.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/40931.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ldc-2-stage-40931.patch --]
[-- Type: text/x-diff, Size: 13352 bytes --]

From 50d79a72b605d2223a47c230c1d5829ff2a68482 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 6 Dec 2022 22:29:47 +0700
Subject: [PATCH 1/2] New package: ldc-stage1-1.30.0

---
 srcpkgs/ldc-stage1/files/float-limits.patch | 51 +++++++++++++++++++++
 srcpkgs/ldc-stage1/files/musl.patch         | 48 +++++++++++++++++++
 srcpkgs/ldc-stage1/template                 | 48 +++++++++++++++++++
 3 files changed, 147 insertions(+)
 create mode 100644 srcpkgs/ldc-stage1/files/float-limits.patch
 create mode 100644 srcpkgs/ldc-stage1/files/musl.patch
 create mode 100644 srcpkgs/ldc-stage1/template

diff --git a/srcpkgs/ldc-stage1/files/float-limits.patch b/srcpkgs/ldc-stage1/files/float-limits.patch
new file mode 100644
index 000000000000..f0f44c02df19
--- /dev/null
+++ b/srcpkgs/ldc-stage1/files/float-limits.patch
@@ -0,0 +1,51 @@
+Index: ldc-1.30.0/gen/target.cpp
+===================================================================
+--- ldc-1.30.0.orig/gen/target.cpp
++++ ldc-1.30.0/gen/target.cpp
+@@ -157,46 +157,6 @@ void Target::_init(const Param &params)
+ 
+   RealProperties.nan = CTFloat::nan;
+   RealProperties.infinity = CTFloat::infinity;
+-
+-  if (targetRealSemantics == IEEEdouble) {
+-    RealProperties.max = CTFloat::parse("0x1.fffffffffffffp+1023");
+-    RealProperties.min_normal = CTFloat::parse("0x1p-1022");
+-    RealProperties.epsilon = CTFloat::parse("0x1p-52");
+-    RealProperties.dig = 15;
+-    RealProperties.mant_dig = 53;
+-    RealProperties.max_exp = 1024;
+-    RealProperties.min_exp = -1021;
+-    RealProperties.max_10_exp = 308;
+-    RealProperties.min_10_exp = -307;
+-  } else if (targetRealSemantics == x87DoubleExtended) {
+-    RealProperties.max = CTFloat::parse("0x1.fffffffffffffffep+16383");
+-    RealProperties.min_normal = CTFloat::parse("0x1p-16382");
+-    RealProperties.epsilon = CTFloat::parse("0x1p-63");
+-    RealProperties.dig = 18;
+-    RealProperties.mant_dig = 64;
+-    RealProperties.max_exp = 16384;
+-    RealProperties.min_exp = -16381;
+-    RealProperties.max_10_exp = 4932;
+-    RealProperties.min_10_exp = -4931;
+-  } else if (targetRealSemantics == IEEEquad) {
+-    // FIXME: hex constants
+-    RealProperties.max =
+-        CTFloat::parse("1.18973149535723176508575932662800702e+4932");
+-    RealProperties.min_normal =
+-        CTFloat::parse("3.36210314311209350626267781732175260e-4932");
+-    RealProperties.epsilon =
+-        CTFloat::parse("1.92592994438723585305597794258492732e-34");
+-    RealProperties.dig = 33;
+-    RealProperties.mant_dig = 113;
+-    RealProperties.max_exp = 16384;
+-    RealProperties.min_exp = -16381;
+-    RealProperties.max_10_exp = 4932;
+-    RealProperties.min_10_exp = -4931;
+-  } else {
+-    // leave initialized with host real_t values
+-    warning(Loc(), "unknown properties for target `real` type, relying on D "
+-                   "host compiler");
+-  }
+ }
+ 
+ /******************************
diff --git a/srcpkgs/ldc-stage1/files/musl.patch b/srcpkgs/ldc-stage1/files/musl.patch
new file mode 100644
index 000000000000..492e0a2538ec
--- /dev/null
+++ b/srcpkgs/ldc-stage1/files/musl.patch
@@ -0,0 +1,48 @@
+taken from: https://github.com/dlang/druntime/pull/3830/commits/210d4c8b42ef916c65b8f052829f7b2aa27061b0.patch
+
+--- a/runtime/druntime/src/core/sys/posix/sys/socket.d
++++ b/runtime/druntime/src/core/sys/posix/sys/socket.d
+@@ -188,10 +188,40 @@
+ 
+     extern (D) inout(ubyte)*   CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
+ 
+-    private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
+-    extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
++    version (CRuntime_Musl)
+     {
+-        return __cmsg_nxthdr(msg, cmsg);
++        extern (D)
++        {
++            private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
++            {
++                return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
++            }
++
++            private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
++            {
++                return cmsg + __CMSG_LEN(cmsg);
++            }
++
++            private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
++            {
++                return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
++            }
++
++            inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
++            {
++                return cmsg.cmsg_len < cmsghdr.sizeof ||
++                    __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
++                        ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
++            }
++        }
++    }
++    else
++    {
++        private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
++        extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
++        {
++            return __cmsg_nxthdr(msg, cmsg);
++        }
+     }
+ 
+     extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
diff --git a/srcpkgs/ldc-stage1/template b/srcpkgs/ldc-stage1/template
new file mode 100644
index 000000000000..f3c9a7082ffa
--- /dev/null
+++ b/srcpkgs/ldc-stage1/template
@@ -0,0 +1,48 @@
+# Template file for 'ldc-stage1'
+pkgname=ldc-stage1
+version=1.30.0
+revision=1
+build_style=cmake
+configure_args="
+ -DINCLUDE_INSTALL_DIR=/usr/include/dlang/ldc
+ -DBUILD_SHARED_LIBS=ON
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo
+ -DBASH_COMPLETION_COMPLETIONSDIR=/usr/share/bash-completion
+ -DC_SYSTEM_LIBS='unwind;m;pthread;rt;dl'"
+hostmakedepends="dmd llvm perl pkg-config"
+makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
+ llvm-libunwind-devel"
+depends="llvm-libunwind-devel"
+checkdepends="python3"
+short_desc="LLVM D Compiler - stage 1"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="BSD-3-Clause, BSL-1.0"
+homepage="https://wiki.dlang.org/LDC"
+changelog="https://raw.githubusercontent.com/ldc-developers/ldc/master/CHANGELOG.md"
+distfiles="https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"
+checksum=fdbb376f08242d917922a6a22a773980217fafa310046fc5d6459490af23dacd
+nopie=yes
+nocross="dmd compilation fails on cross"
+make_check=no
+make_build_args=-v
+conflicts="ldc>=0 ldc-runtime>=0 ldc-runtime-debug>=0"
+provides="ldc-${version}_1
+ ldc-runtime-${version}_1
+ ldc-runtime-debug-${version}_1"
+shlib_provides="
+ libdruntime-ldc-debug-shared.so.100
+ libphobos2-ldc-debug-shared.so.100
+ libdruntime-ldc-shared.so.100
+ libphobos2-ldc-shared.so.100"
+
+post_patch() {
+	if [ "$XBPS_TARGET_LIBC" = musl ]; then
+		patch -Np1 -i "$FILESDIR/musl.patch"
+		# ldc built by dmd crashed if build those limits on musl
+		patch -Np1 -i "$FILESDIR/float-limits.patch"
+	fi
+}
+
+post_install() {
+	vlicense LICENSE
+}

From 58fc7272cd54319218680657fc707c1ab0bf6040 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 4 Dec 2022 10:03:22 +0700
Subject: [PATCH 2/2] ldc: update to 1.30.0.

---
 common/shlibs                | 10 ++++----
 srcpkgs/ldc-runtime-debug    |  1 +
 srcpkgs/ldc/files/musl.patch | 48 ++++++++++++++++++++++++++++++++++++
 srcpkgs/ldc/template         | 35 +++++++++++++++++++-------
 4 files changed, 80 insertions(+), 14 deletions(-)
 create mode 120000 srcpkgs/ldc-runtime-debug
 create mode 100644 srcpkgs/ldc/files/musl.patch

diff --git a/common/shlibs b/common/shlibs
index 965eef4df56f..d8e8bb88d3e1 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2189,11 +2189,11 @@ libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
 libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
 libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_1
-libdruntime-ldc-debug-shared.so.98 ldc-runtime-1.28.0_1
-libdruntime-ldc-shared.so.98 ldc-runtime-1.28.0_1
-libphobos2-ldc-shared.so.98 ldc-runtime-1.28.0_1
-libphobos2-ldc-debug-shared.so.98 ldc-runtime-1.28.0_1
-libldc-jit.so.99 ldc-runtime-1.29.0_1
+libdruntime-ldc-debug-shared.so.100 ldc-runtime-debug-1.30.0_1
+libphobos2-ldc-debug-shared.so.100 ldc-runtime-debug-1.30.0_1
+libdruntime-ldc-shared.so.100 ldc-runtime-1.30.0_1
+libphobos2-ldc-shared.so.100 ldc-runtime-1.30.0_1
+libldc-jit.so.100 ldc-runtime-1.30.0_1
 libmarblewidget-qt5.so.28 marble5-17.12.2_1
 libastro.so.2 marble5-17.12.2_1
 libparrot.so.6.9.0 parrot-6.9.0_1
diff --git a/srcpkgs/ldc-runtime-debug b/srcpkgs/ldc-runtime-debug
new file mode 120000
index 000000000000..12f0b1bf64f0
--- /dev/null
+++ b/srcpkgs/ldc-runtime-debug
@@ -0,0 +1 @@
+ldc
\ No newline at end of file
diff --git a/srcpkgs/ldc/files/musl.patch b/srcpkgs/ldc/files/musl.patch
new file mode 100644
index 000000000000..492e0a2538ec
--- /dev/null
+++ b/srcpkgs/ldc/files/musl.patch
@@ -0,0 +1,48 @@
+taken from: https://github.com/dlang/druntime/pull/3830/commits/210d4c8b42ef916c65b8f052829f7b2aa27061b0.patch
+
+--- a/runtime/druntime/src/core/sys/posix/sys/socket.d
++++ b/runtime/druntime/src/core/sys/posix/sys/socket.d
+@@ -188,10 +188,40 @@
+ 
+     extern (D) inout(ubyte)*   CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
+ 
+-    private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
+-    extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
++    version (CRuntime_Musl)
+     {
+-        return __cmsg_nxthdr(msg, cmsg);
++        extern (D)
++        {
++            private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
++            {
++                return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
++            }
++
++            private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
++            {
++                return cmsg + __CMSG_LEN(cmsg);
++            }
++
++            private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
++            {
++                return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
++            }
++
++            inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
++            {
++                return cmsg.cmsg_len < cmsghdr.sizeof ||
++                    __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
++                        ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
++            }
++        }
++    }
++    else
++    {
++        private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
++        extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
++        {
++            return __cmsg_nxthdr(msg, cmsg);
++        }
+     }
+ 
+     extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index fec8a9c80452..664a82be14d8 100644
--- a/srcpkgs/ldc/template
+++ b/srcpkgs/ldc/template
@@ -1,8 +1,7 @@
 # Template file for 'ldc'
 pkgname=ldc
-version=1.28.0
-revision=2
-reverts="1.29.0_1"
+version=1.30.0
+revision=1
 build_style=cmake
 configure_args="
  -DINCLUDE_INSTALL_DIR=/usr/include/dlang/ldc
@@ -11,30 +10,48 @@ configure_args="
  -DBASH_COMPLETION_COMPLETIONSDIR=/usr/share/bash-completion
  -DC_SYSTEM_LIBS='unwind;m;pthread;rt;dl'"
 conf_files="/etc/ldc2.conf"
-hostmakedepends="dmd llvm12 perl pkg-config"
+hostmakedepends="ldc-stage1 llvm12 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
  llvm-libunwind-devel"
 depends="ldc-runtime llvm-libunwind-devel"
-checkdepends="python3"
+checkdepends="python3-lit gdb"
 short_desc="Portable D programming language compiler based on LLVM"
 maintainer="Auri <me@aurieh.me>"
 license="BSD-3-Clause, BSL-1.0"
 homepage="https://wiki.dlang.org/LDC"
 changelog="https://raw.githubusercontent.com/ldc-developers/ldc/master/CHANGELOG.md"
 distfiles="https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"
-checksum=17fee8bb535bcb8cda0a45947526555c46c045f302a7349cc8711b254e54cf09
+checksum=fdbb376f08242d917922a6a22a773980217fafa310046fc5d6459490af23dacd
 nopie=yes
-nocross="dmd compilation fails on cross"
+# nocross="dmd compilation fails on cross"
 # tests timeout on musl; also require unpackaged python3-lit
-make_check=no
+# make_check=no
+make_build_args=-v
+
+if [ "$XBPS_TARGET_LIBC" = glibc ]; then
+	checkdepends+=" libsanitizer-devel"
+fi
+
+post_patch() {
+	if [ "$XBPS_TARGET_LIBC" = musl ]; then
+		patch -Np1 -i "$FILESDIR/musl.patch"
+	fi
+}
 
 post_install() {
 	vlicense LICENSE
 }
 
+ldc-runtime-debug_package() {
+	short_desc+=" - D runtime (debug version)"
+	pkg_install() {
+		vmove "usr/lib/*ldc-debug-shared.so.*"
+	}
+}
+
 ldc-runtime_package() {
 	short_desc+=" - D runtime"
 	pkg_install() {
-		vmove "usr/lib/*.so*"
+		vmove "usr/lib/*ldc-shared.so.*"
 	}
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR REVIEW] ldc: build in 2 stages, update to 1.30.0
  2022-12-06 15:41 [PR PATCH] ldc: build in 2 stages, update to 1.30.0 sgn
@ 2022-12-06 18:09 ` oreo639
  2022-12-19  8:57 ` [PR PATCH] [Updated] " sgn
  2022-12-20  2:24 ` [PR PATCH] [Closed]: " sgn
  2 siblings, 0 replies; 4+ messages in thread
From: oreo639 @ 2022-12-06 18:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40931#discussion_r1041299358

Comment:
This patch supports glibc so it doesn't need to be conditional.
It was merged upstream:
https://github.com/dlang/dmd/commit/54544260a848c8ebad5582e27ac1e09627cdfb17

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Updated] ldc: build in 2 stages, update to 1.30.0
  2022-12-06 15:41 [PR PATCH] ldc: build in 2 stages, update to 1.30.0 sgn
  2022-12-06 18:09 ` [PR REVIEW] " oreo639
@ 2022-12-19  8:57 ` sgn
  2022-12-20  2:24 ` [PR PATCH] [Closed]: " sgn
  2 siblings, 0 replies; 4+ messages in thread
From: sgn @ 2022-12-19  8:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1252 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages ldc-2-stage
https://github.com/void-linux/void-packages/pull/40931

ldc: build in 2 stages, update to 1.30.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/40931.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ldc-2-stage-40931.patch --]
[-- Type: text/x-diff, Size: 10863 bytes --]

From 2e460a467ab54eb36bce58f6c633675e52c20817 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 6 Dec 2022 22:29:47 +0700
Subject: [PATCH 1/2] New package: ldc-stage1-1.30.0

---
 srcpkgs/ldc-stage1/files/musl.patch | 48 +++++++++++++++++++++++++++++
 srcpkgs/ldc-stage1/template         | 47 ++++++++++++++++++++++++++++
 2 files changed, 95 insertions(+)
 create mode 100644 srcpkgs/ldc-stage1/files/musl.patch
 create mode 100644 srcpkgs/ldc-stage1/template

diff --git a/srcpkgs/ldc-stage1/files/musl.patch b/srcpkgs/ldc-stage1/files/musl.patch
new file mode 100644
index 000000000000..492e0a2538ec
--- /dev/null
+++ b/srcpkgs/ldc-stage1/files/musl.patch
@@ -0,0 +1,48 @@
+taken from: https://github.com/dlang/druntime/pull/3830/commits/210d4c8b42ef916c65b8f052829f7b2aa27061b0.patch
+
+--- a/runtime/druntime/src/core/sys/posix/sys/socket.d
++++ b/runtime/druntime/src/core/sys/posix/sys/socket.d
+@@ -188,10 +188,40 @@
+ 
+     extern (D) inout(ubyte)*   CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
+ 
+-    private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
+-    extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
++    version (CRuntime_Musl)
+     {
+-        return __cmsg_nxthdr(msg, cmsg);
++        extern (D)
++        {
++            private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
++            {
++                return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
++            }
++
++            private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
++            {
++                return cmsg + __CMSG_LEN(cmsg);
++            }
++
++            private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
++            {
++                return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
++            }
++
++            inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
++            {
++                return cmsg.cmsg_len < cmsghdr.sizeof ||
++                    __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
++                        ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
++            }
++        }
++    }
++    else
++    {
++        private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
++        extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
++        {
++            return __cmsg_nxthdr(msg, cmsg);
++        }
+     }
+ 
+     extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
diff --git a/srcpkgs/ldc-stage1/template b/srcpkgs/ldc-stage1/template
new file mode 100644
index 000000000000..8690807af460
--- /dev/null
+++ b/srcpkgs/ldc-stage1/template
@@ -0,0 +1,47 @@
+# Template file for 'ldc-stage1'
+pkgname=ldc-stage1
+version=1.30.0
+revision=1
+build_style=cmake
+configure_args="
+ -DINCLUDE_INSTALL_DIR=/usr/include/dlang/ldc
+ -DBUILD_SHARED_LIBS=ON
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo
+ -DBASH_COMPLETION_COMPLETIONSDIR=/usr/share/bash-completion
+ -DCOMPILE_D_MODULES_SEPARATELY=ON
+ -DC_SYSTEM_LIBS='unwind;m;pthread;rt;dl'"
+hostmakedepends="dmd llvm perl pkg-config"
+makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
+ llvm-libunwind-devel"
+depends="llvm-libunwind-devel"
+checkdepends="python3"
+short_desc="LLVM D Compiler - stage 1"
+maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
+license="BSD-3-Clause, BSL-1.0"
+homepage="https://wiki.dlang.org/LDC"
+changelog="https://raw.githubusercontent.com/ldc-developers/ldc/master/CHANGELOG.md"
+distfiles="https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"
+checksum=fdbb376f08242d917922a6a22a773980217fafa310046fc5d6459490af23dacd
+nopie=yes
+nocross="dmd compilation fails on cross"
+make_check=no
+make_build_args=-v
+conflicts="ldc>=0 ldc-runtime>=0 ldc-runtime-debug>=0"
+provides="ldc-${version}_1
+ ldc-runtime-${version}_1
+ ldc-runtime-debug-${version}_1"
+shlib_provides="
+ libdruntime-ldc-debug-shared.so.100
+ libphobos2-ldc-debug-shared.so.100
+ libdruntime-ldc-shared.so.100
+ libphobos2-ldc-shared.so.100"
+
+post_patch() {
+	if [ "$XBPS_TARGET_LIBC" = musl ]; then
+		patch -Np1 -i "$FILESDIR/musl.patch"
+	fi
+}
+
+post_install() {
+	vlicense LICENSE
+}

From 7b19d637122dde5e65c8c5b2ac640e5e293fe74e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 4 Dec 2022 10:03:22 +0700
Subject: [PATCH 2/2] ldc: update to 1.30.0.

---
 common/shlibs                | 10 ++++----
 srcpkgs/ldc-runtime-debug    |  1 +
 srcpkgs/ldc/files/musl.patch | 48 ++++++++++++++++++++++++++++++++++++
 srcpkgs/ldc/template         | 37 +++++++++++++++++++--------
 4 files changed, 81 insertions(+), 15 deletions(-)
 create mode 120000 srcpkgs/ldc-runtime-debug
 create mode 100644 srcpkgs/ldc/files/musl.patch

diff --git a/common/shlibs b/common/shlibs
index ba5c89ee3bad..2e97e9803104 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2189,11 +2189,11 @@ libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
 libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
 libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_1
-libdruntime-ldc-debug-shared.so.98 ldc-runtime-1.28.0_1
-libdruntime-ldc-shared.so.98 ldc-runtime-1.28.0_1
-libphobos2-ldc-shared.so.98 ldc-runtime-1.28.0_1
-libphobos2-ldc-debug-shared.so.98 ldc-runtime-1.28.0_1
-libldc-jit.so.99 ldc-runtime-1.29.0_1
+libdruntime-ldc-debug-shared.so.100 ldc-runtime-debug-1.30.0_1
+libphobos2-ldc-debug-shared.so.100 ldc-runtime-debug-1.30.0_1
+libdruntime-ldc-shared.so.100 ldc-runtime-1.30.0_1
+libphobos2-ldc-shared.so.100 ldc-runtime-1.30.0_1
+libldc-jit.so.100 ldc-runtime-1.30.0_1
 libmarblewidget-qt5.so.28 marble5-17.12.2_1
 libastro.so.2 marble5-17.12.2_1
 libparrot.so.6.9.0 parrot-6.9.0_1
diff --git a/srcpkgs/ldc-runtime-debug b/srcpkgs/ldc-runtime-debug
new file mode 120000
index 000000000000..12f0b1bf64f0
--- /dev/null
+++ b/srcpkgs/ldc-runtime-debug
@@ -0,0 +1 @@
+ldc
\ No newline at end of file
diff --git a/srcpkgs/ldc/files/musl.patch b/srcpkgs/ldc/files/musl.patch
new file mode 100644
index 000000000000..492e0a2538ec
--- /dev/null
+++ b/srcpkgs/ldc/files/musl.patch
@@ -0,0 +1,48 @@
+taken from: https://github.com/dlang/druntime/pull/3830/commits/210d4c8b42ef916c65b8f052829f7b2aa27061b0.patch
+
+--- a/runtime/druntime/src/core/sys/posix/sys/socket.d
++++ b/runtime/druntime/src/core/sys/posix/sys/socket.d
+@@ -188,10 +188,40 @@
+ 
+     extern (D) inout(ubyte)*   CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
+ 
+-    private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
+-    extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
++    version (CRuntime_Musl)
+     {
+-        return __cmsg_nxthdr(msg, cmsg);
++        extern (D)
++        {
++            private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
++            {
++                return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
++            }
++
++            private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
++            {
++                return cmsg + __CMSG_LEN(cmsg);
++            }
++
++            private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
++            {
++                return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
++            }
++
++            inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
++            {
++                return cmsg.cmsg_len < cmsghdr.sizeof ||
++                    __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
++                        ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
++            }
++        }
++    }
++    else
++    {
++        private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
++        extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
++        {
++            return __cmsg_nxthdr(msg, cmsg);
++        }
+     }
+ 
+     extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index fec8a9c80452..0860a9842c7b 100644
--- a/srcpkgs/ldc/template
+++ b/srcpkgs/ldc/template
@@ -1,8 +1,7 @@
 # Template file for 'ldc'
 pkgname=ldc
-version=1.28.0
-revision=2
-reverts="1.29.0_1"
+version=1.30.0
+revision=1
 build_style=cmake
 configure_args="
  -DINCLUDE_INSTALL_DIR=/usr/include/dlang/ldc
@@ -11,30 +10,48 @@ configure_args="
  -DBASH_COMPLETION_COMPLETIONSDIR=/usr/share/bash-completion
  -DC_SYSTEM_LIBS='unwind;m;pthread;rt;dl'"
 conf_files="/etc/ldc2.conf"
-hostmakedepends="dmd llvm12 perl pkg-config"
+hostmakedepends="ldc-stage1 llvm12 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
  llvm-libunwind-devel"
-depends="ldc-runtime llvm-libunwind-devel"
-checkdepends="python3"
+depends="ldc-runtime ldc-runtime-debug llvm-libunwind-devel"
+checkdepends="python3-lit gdb"
 short_desc="Portable D programming language compiler based on LLVM"
 maintainer="Auri <me@aurieh.me>"
 license="BSD-3-Clause, BSL-1.0"
 homepage="https://wiki.dlang.org/LDC"
 changelog="https://raw.githubusercontent.com/ldc-developers/ldc/master/CHANGELOG.md"
 distfiles="https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"
-checksum=17fee8bb535bcb8cda0a45947526555c46c045f302a7349cc8711b254e54cf09
+checksum=fdbb376f08242d917922a6a22a773980217fafa310046fc5d6459490af23dacd
 nopie=yes
-nocross="dmd compilation fails on cross"
+# nocross="dmd compilation fails on cross"
 # tests timeout on musl; also require unpackaged python3-lit
-make_check=no
+# make_check=no
+make_build_args=-v
+
+if [ "$XBPS_TARGET_LIBC" = glibc ]; then
+	checkdepends+=" libsanitizer-devel"
+fi
+
+post_patch() {
+	if [ "$XBPS_TARGET_LIBC" = musl ]; then
+		patch -Np1 -i "$FILESDIR/musl.patch"
+	fi
+}
 
 post_install() {
 	vlicense LICENSE
 }
 
+ldc-runtime-debug_package() {
+	short_desc+=" - D runtime (debug version)"
+	pkg_install() {
+		vmove "usr/lib/*ldc-debug-shared.so.*"
+	}
+}
+
 ldc-runtime_package() {
 	short_desc+=" - D runtime"
 	pkg_install() {
-		vmove "usr/lib/*.so*"
+		vmove "usr/lib/*ldc-shared.so.*"
 	}
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Closed]: ldc: build in 2 stages, update to 1.30.0
  2022-12-06 15:41 [PR PATCH] ldc: build in 2 stages, update to 1.30.0 sgn
  2022-12-06 18:09 ` [PR REVIEW] " oreo639
  2022-12-19  8:57 ` [PR PATCH] [Updated] " sgn
@ 2022-12-20  2:24 ` sgn
  2 siblings, 0 replies; 4+ messages in thread
From: sgn @ 2022-12-20  2:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1100 bytes --]

There's a closed pull request on the void-packages repository

ldc: build in 2 stages, update to 1.30.0
https://github.com/void-linux/void-packages/pull/40931

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-20  2:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-06 15:41 [PR PATCH] ldc: build in 2 stages, update to 1.30.0 sgn
2022-12-06 18:09 ` [PR REVIEW] " oreo639
2022-12-19  8:57 ` [PR PATCH] [Updated] " sgn
2022-12-20  2:24 ` [PR PATCH] [Closed]: " sgn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).