From 8ef37db7a0e3d84c1e4a746a4fcdb13767f5489b Mon Sep 17 00:00:00 2001 From: Auri Date: Thu, 29 Oct 2020 11:47:37 +0200 Subject: [PATCH 1/5] dmd2.081: backport clean ld exit, revbump --- srcpkgs/dmd2.081/patches/backport-ld-exit.patch | 11 +++++++++++ srcpkgs/dmd2.081/template | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/dmd2.081/patches/backport-ld-exit.patch diff --git a/srcpkgs/dmd2.081/patches/backport-ld-exit.patch b/srcpkgs/dmd2.081/patches/backport-ld-exit.patch new file mode 100644 index 00000000000..a3012be7bee --- /dev/null +++ b/srcpkgs/dmd2.081/patches/backport-ld-exit.patch @@ -0,0 +1,11 @@ +--- dmd/src/dmd/link.d ++++ dmd/src/dmd/link.d +@@ -685,7 +685,7 @@ public int runLINK() + close(fds[0]); + execvp(argv[0], cast(char**)argv.tdata()); + perror(argv[0]); // failed to execute +- return -1; ++ _exit(-1); + } + else if (childpid == -1) + { diff --git a/srcpkgs/dmd2.081/template b/srcpkgs/dmd2.081/template index 6bb0d3160ab..79aad094008 100644 --- a/srcpkgs/dmd2.081/template +++ b/srcpkgs/dmd2.081/template @@ -1,7 +1,7 @@ # Template file for 'dmd2.081' pkgname=dmd2.081 version=2.081.1 -revision=2 +revision=3 create_wrksrc=yes hostmakedepends="which" makedepends="dmd-bootstrap" From bc63fa1f4fc90b29aa1a0a6a852d07c0ab73fd25 Mon Sep 17 00:00:00 2001 From: Auri Date: Sun, 25 Oct 2020 17:13:56 +0200 Subject: [PATCH 2/5] new package: dmd2.091 dmd2.091: libphobos2.091 conflicts with libphobos2.081 dmd2.091: implement requested changes dmd2.091: backport clean ld exit --- srcpkgs/dmd2.091/files/dmd.conf | 2 + .../dmd2.091/patches/backport-ld-exit.patch | 11 +++ srcpkgs/dmd2.091/template | 78 +++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 srcpkgs/dmd2.091/files/dmd.conf create mode 100644 srcpkgs/dmd2.091/patches/backport-ld-exit.patch create mode 100644 srcpkgs/dmd2.091/template diff --git a/srcpkgs/dmd2.091/files/dmd.conf b/srcpkgs/dmd2.091/files/dmd.conf new file mode 100644 index 00000000000..e8d42d10620 --- /dev/null +++ b/srcpkgs/dmd2.091/files/dmd.conf @@ -0,0 +1,2 @@ +[Environment] +DFLAGS=-I/usr/include/d -I/usr/include/d/druntime/import -L-L/usr/lib -L-L/usr/lib -L--no-warn-search-mismatch -L--export-dynamic -fPIC diff --git a/srcpkgs/dmd2.091/patches/backport-ld-exit.patch b/srcpkgs/dmd2.091/patches/backport-ld-exit.patch new file mode 100644 index 00000000000..d4d34035791 --- /dev/null +++ b/srcpkgs/dmd2.091/patches/backport-ld-exit.patch @@ -0,0 +1,11 @@ +--- dmd/src/dmd/link.d ++++ dmd/src/dmd/link.d +@@ -782,7 +782,7 @@ public int runLINK() + close(fds[0]); + execvp(argv[0], argv.tdata()); + perror(argv[0]); // failed to execute +- return -1; ++ _exit(-1); + } + else if (childpid == -1) + { diff --git a/srcpkgs/dmd2.091/template b/srcpkgs/dmd2.091/template new file mode 100644 index 00000000000..2048a1886bb --- /dev/null +++ b/srcpkgs/dmd2.091/template @@ -0,0 +1,78 @@ +# Template file for 'dmd2.091' +pkgname=dmd2.091 +version=2.091.0 +revision=1 +create_wrksrc=yes +hostmakedepends="dmd2.081 which" +makedepends="git" +depends="gcc" +short_desc="Digital Mars D compiler, 2.091" +maintainer="Auri " +license="BSL-1.0" +homepage="http://www.digitalmars.com/d/2.0/" +distfiles=" + https://github.com/dlang/dmd/archive/v${version}.tar.gz>dmd-${version}.tar.gz + https://github.com/dlang/druntime/archive/v${version}.tar.gz>druntime-${version}.tar.gz + https://github.com/dlang/phobos/archive/v${version}.tar.gz>phobos-${version}.tar.gz + http://downloads.dlang.org/releases/2.x/${version}/dmd.${version}.linux.tar.xz" +checksum="bcca38f4b80b51ae0a1955dc29e6cbfaa4d01d94869ddfcacf9292898c34343a + cc8ba196b08cca04488d97d0e35c878f7351b7d8128aec90eaa312d2bd9a6af2 + df9f81eecda4366adc5ca9ed31a0b4474c248544b120ff6fa3f6cb45917d8769 + 6e4bd4ee73a553921cdca7e3e21768b842b18186d07c0b4898fbd13a359875c0" +conf_files="/etc/dmd.conf" +provides="d-compiler-${version}_${revision}" +conflicts="dmd-bootstrap dmd2.081 libphobos2.081" +nopie=yes +nocross=yes +LDFLAGS="-lpthread" + +case "$XBPS_TARGET_MACHINE" in + x86_64*) _archbits=64;; + i686) _archbits=32;; + *) broken="unsupported arch upstream";; +esac + +post_extract() { + mv dmd-${version} dmd + mv druntime-${version} druntime + mv phobos-${version} phobos +} + +do_build() { + local dmd + + cd dmd + make ${makejobs} -f posix.mak MODEL=${_archbits} TARGET_CPU=X86 ENABLE_RELEASE=1 PIC=1 + dmd=${wrksrc}/dmd/generated/linux/release/$_archbits/dmd + + make ${makejobs} -C docs + + cd ../druntime + make ${makejobs} -f posix.mak MODEL=${_archbits} DMD=$dmd ENABLE_RELEASE=1 PIC=1 + + cd ../phobos + make ${makejobs} -f posix.mak MODEL=${_archbits} DMD=$dmd ENABLE_RELEASE=1 PIC=1 +} + +do_install() { + cd dmd + vbin generated/linux/release/$_archbits/dmd + vinstall ${FILESDIR}/dmd.conf 644 etc + + # note: dmd, druntime and phobos all share the same license + vlicense LICENSE.txt + + vman generated/docs/man/man1/dmd.1 + vman generated/docs/man/man5/dmd.conf.5 + + vmkdir usr/include/d + + cd ../phobos + cp -r ./{*.d,etc,std} ${PKGDESTDIR}/usr/include/d + vinstall generated/linux/release/$_archbits/libphobos2.a 644 usr/lib libphobos2.a + + cd ../druntime + vmkdir usr/include/d/druntime + cp -r import ${PKGDESTDIR}/usr/include/d/druntime + vinstall generated/linux/release/$_archbits/libdruntime.a 644 usr/lib libdruntime.a +} From f74af8fbdd848467822fc7dd1833fb9e2dfdd13b Mon Sep 17 00:00:00 2001 From: Auri Date: Sun, 25 Oct 2020 17:14:54 +0200 Subject: [PATCH 3/5] dmd: update to 2.094.1 dmd: fix build for x86_64-musl Reverts https://github.com/dlang/dmd/commit/bab39b625f875ac14dd6668c2b442e76898ac342 on musl systems. dmd: implement requested changes --- srcpkgs/dmd/files/musl.patch | 12 ++++++++++++ srcpkgs/dmd/template | 23 ++++++++++++++--------- 2 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 srcpkgs/dmd/files/musl.patch diff --git a/srcpkgs/dmd/files/musl.patch b/srcpkgs/dmd/files/musl.patch new file mode 100644 index 00000000000..bf41a3e4961 --- /dev/null +++ b/srcpkgs/dmd/files/musl.patch @@ -0,0 +1,12 @@ +--- dmd/src/dmd/link.d ++++ dmd/src/dmd/link.d +@@ -759,8 +759,7 @@ + perror("unable to create pipe to linker"); + return -1; + } +- // vfork instead of fork to avoid https://issues.dlang.org/show_bug.cgi?id=21089 +- childpid = vfork(); ++ childpid = fork(); + if (childpid == 0) + { + // pipe linker stderr to fds[0] diff --git a/srcpkgs/dmd/template b/srcpkgs/dmd/template index 6167a347f49..09de75c6413 100644 --- a/srcpkgs/dmd/template +++ b/srcpkgs/dmd/template @@ -1,10 +1,10 @@ # Template file for 'dmd' pkgname=dmd -version=2.091.0 +version=2.094.1 revision=1 create_wrksrc=yes -hostmakedepends="which" -makedepends="dmd2.081 git" +hostmakedepends="dmd2.091 which" +makedepends="git" depends="libphobos>=${version} gcc" short_desc="Digital Mars D compiler" maintainer="streaks " @@ -15,13 +15,13 @@ distfiles=" https://github.com/dlang/druntime/archive/v${version}.tar.gz>druntime-${version}.tar.gz https://github.com/dlang/phobos/archive/v${version}.tar.gz>phobos-${version}.tar.gz http://downloads.dlang.org/releases/2.x/${version}/dmd.${version}.linux.tar.xz" -checksum="bcca38f4b80b51ae0a1955dc29e6cbfaa4d01d94869ddfcacf9292898c34343a - cc8ba196b08cca04488d97d0e35c878f7351b7d8128aec90eaa312d2bd9a6af2 - df9f81eecda4366adc5ca9ed31a0b4474c248544b120ff6fa3f6cb45917d8769 - 6e4bd4ee73a553921cdca7e3e21768b842b18186d07c0b4898fbd13a359875c0" +checksum="63271e939dbe5c39e866074b97f53c515c2b9161fcae9bae1df3b38924b0098d + 4bd91e438996363ec62f0b72392fa88f9d53ee73c51bea1c3be1ae97bd28d30c + e84536c538f47247d4803a9d2163f32e4b1e03acac090fa195a77083147c556f + 5208ef1babdb17bf63324d3fd439af774e4bb90d242d55c2471775deba3a399b" conf_files="/etc/dmd.conf" provides="d-compiler-${version}_${revision}" -conflicts="dmd-bootstrap dmd2.081" +conflicts="dmd-bootstrap dmd2.081 dmd2.091" nopie=yes LDFLAGS="-lpthread" @@ -32,12 +32,17 @@ case "$XBPS_TARGET_MACHINE" in esac post_extract() { - rm -rf dmd druntime phobos mv dmd-${version} dmd mv druntime-${version} druntime mv phobos-${version} phobos } +pre_configure() { + if [ "$XBPS_TARGET_LIBC" = musl ]; then + patch -p0 < ${FILESDIR}/musl.patch + fi +} + do_build() { local dmd From 851bc485972a881975e025d272ffd6918f6affd9 Mon Sep 17 00:00:00 2001 From: Auri Date: Mon, 23 Nov 2020 13:22:39 +0200 Subject: [PATCH 4/5] dmd2.091: disable parallel build --- srcpkgs/dmd2.091/template | 1 + 1 file changed, 1 insertion(+) diff --git a/srcpkgs/dmd2.091/template b/srcpkgs/dmd2.091/template index 2048a1886bb..72521df7cd3 100644 --- a/srcpkgs/dmd2.091/template +++ b/srcpkgs/dmd2.091/template @@ -24,6 +24,7 @@ provides="d-compiler-${version}_${revision}" conflicts="dmd-bootstrap dmd2.081 libphobos2.081" nopie=yes nocross=yes +disable_parallel_build=yes LDFLAGS="-lpthread" case "$XBPS_TARGET_MACHINE" in From a43e73cc4e5eb4f6186951794ddcd00eca395bb9 Mon Sep 17 00:00:00 2001 From: Auri Date: Mon, 23 Nov 2020 13:22:57 +0200 Subject: [PATCH 5/5] dmd: disable parallel build --- srcpkgs/dmd/template | 1 + 1 file changed, 1 insertion(+) diff --git a/srcpkgs/dmd/template b/srcpkgs/dmd/template index 09de75c6413..c05cadbb592 100644 --- a/srcpkgs/dmd/template +++ b/srcpkgs/dmd/template @@ -23,6 +23,7 @@ conf_files="/etc/dmd.conf" provides="d-compiler-${version}_${revision}" conflicts="dmd-bootstrap dmd2.081 dmd2.091" nopie=yes +disable_parallel_build=yes LDFLAGS="-lpthread" case "$XBPS_TARGET_MACHINE" in