[packages/dmd] - up to 2.070.2; now needs fairly recent dmd compiler to bootstrap - added opt patch (to pass C++ op

qboosh qboosh at pld-linux.org
Sun Mar 13 20:53:31 CET 2016


commit bf555f484fcdb8b61ae5ea7133d3b2976af62141
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Mar 13 20:57:26 2016 +0100

    - up to 2.070.2; now needs fairly recent dmd compiler to bootstrap
    - added opt patch (to pass C++ optflags)

 dmd-opt.patch         | 10 ++++++++++
 dmd-system-zlib.patch | 39 ++++++++++++++-----------------------
 dmd.spec              | 53 +++++++++++++++++++++++++--------------------------
 3 files changed, 50 insertions(+), 52 deletions(-)
---
diff --git a/dmd.spec b/dmd.spec
index 2e8f6da..c7ec049 100644
--- a/dmd.spec
+++ b/dmd.spec
@@ -1,24 +1,27 @@
 #
 # Conditional build:
-%bcond_with	dynamic	# dynamic linking with libphobos (doesn't work properly as of 2.065.0)
+%bcond_with	bootstrap	# bootstrap using upstream binaries
+%bcond_with	dynamic		# dynamic linking with libphobos (doesn't work properly as of 2.065.0)
 #
 Summary:	Digital Mars D compiler
 Summary(pl.UTF-8):	Digital Mars D - kompilator języka D
 Name:		dmd
-Version:	2.065.0
+Version:	2.070.2
 Release:	1
 # Digital Mars is proprietary license (not redistributable)
-License:	Boost v1.0 (D runtime, Phobos, tools), GPL v1+ or Artistic (compiler frontend), Digital Mars (the rest)
+License:	Boost v1.0 (D runtime, Phobos, tools), GPL v1+ or Artistic (frontend), Digital Mars (backend)
 Group:		Development/Languages
-Source0:	http://downloads.dlang.org/releases/2014/%{name}.%{version}.zip
-# NoSource0-md5:	a17a699a7e4715658393819e9dc1814a
+Source0:	http://downloads.dlang.org/releases/2.x/%{version}/%{name}.%{version}.linux.tar.xz
+# NoSource0-md5:	309e6968abb813a654d24ba43aba832f
 Source1:	https://github.com/D-Programming-Language/tools/archive/v%{version}/d-tools-%{version}.tar.gz
-# Source1-md5:	d6b0b7a2a6b90a1374202c7582fc38e7
+# Source1-md5:	8e664bb5b8849b373a210b6ebff27633
 Patch0:		%{name}-system-zlib.patch
-Patch1:		%{name}-shared.patch
+Patch1:		%{name}-opt.patch
+Patch2:		%{name}-shared.patch
 NoSource:	0
 URL:		http://dlang.org/dmd-linux.html
 BuildRequires:	curl-devel
+%{!?with_bootstrap:BuildRequires:	dmd >= 2.068.2}
 BuildRequires:	libstdc++-devel
 BuildRequires:	zlib-devel
 %if %{with dynamic}
@@ -69,7 +72,8 @@ Biblioteki statyczne Phobos oraz D-runtime dla języka D.
 %{__mv} tools-%{version} tools
 
 %patch0 -p1
-%{?with_dynamic:%patch1 -p1}
+%patch1 -p1
+%{?with_dynamic:%patch2 -p1}
 
 echo "%{version}" > src/dmd/VERSION
 
@@ -84,24 +88,24 @@ cp -p src/druntime/README.md druntime-README.md
 	TARGET_CPU=X86 \
 	MODEL=%{model} \
 	HOST_CC="%{__cxx}" \
-	GFLAGS='%{rpmcxxflags} $(WARNINGS) -D__pascal= -fno-exceptions'
+	%{?with_bootstrap:HOST_DMD=$(pwd)/linux/bin%{model}/dmd} \
+	CXXOPTFLAGS="%{rpmcxxflags}"
 
 DMD=$(pwd)/src/dmd/dmd
-for t in target lib/libdruntime-linux%{model}.so ; do
-%{__make} -C src/druntime -f posix.mak $t \
+
+%{__make} -C src/druntime -f posix.mak \
 	OS=linux \
 	MODEL=%{model} \
 	CC="%{__cc}" \
-	CFLAGS="%{rpmcflags} -m%{model} -fPIC" \
+	CFLAGS="%{rpmcflags} -m%{model} -fPIC -DHAVE_UNISTD_H" \
 	DMD="$DMD" \
 	PIC="-fPIC"
-done
 
 %{__make} -C src/phobos -f posix.mak \
 	OS=linux \
 	MODEL=%{model} \
 	CC="%{__cc}" \
-	CFLAGS="%{rpmcflags} -m%{model} -fPIC" \
+	CFLAGS="%{rpmcflags} -m%{model} -fPIC -DHAVE_UNISTD_H" \
 	DMD="$DMD" \
 	LIBCURL_STUB= \
 	PIC="-fPIC"
@@ -110,21 +114,19 @@ done
 	OS=linux \
 	MODEL=%{model} \
 	CC="%{__cc}" \
-	CFLAGS="%{rpmcflags} -m%{model} -fPIC" \
-	DMD="$DMD -I$(pwd)/src/phobos -I$(pwd)/src/druntime -L-L$(pwd)/src/phobos/generated/linux/release/%{model}"
+	DMD="$DMD -I$(pwd)/src/phobos -I$(pwd)/src/druntime/import -L-L$(pwd)/src/phobos/generated/linux/release/%{model}"
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_includedir}/d/dmd/phobos/etc/c,%{_libdir},%{_sysconfdir},%{_docdir}/dmd}
 
 install -Dp src/dmd/dmd $RPM_BUILD_ROOT%{_bindir}/dmd
-cp -p src/druntime/lib/libdruntime-linux%{model}* $RPM_BUILD_ROOT%{_libdir}
+cp -p src/druntime/generated/linux/release/%{model}/libdruntime* $RPM_BUILD_ROOT%{_libdir}
 cp -a src/phobos/generated/linux/release/%{model}/libphobos2.so* $RPM_BUILD_ROOT%{_libdir}
 cp -p src/phobos/generated/linux/release/%{model}/libphobos2.a $RPM_BUILD_ROOT%{_libdir}
 cp -pr src/druntime/import $RPM_BUILD_ROOT%{_includedir}/d/dmd/druntime
 cp -pr src/phobos/{std,*.d} $RPM_BUILD_ROOT%{_includedir}/d/dmd/phobos
 cp -p src/phobos/etc/c/*.d $RPM_BUILD_ROOT%{_includedir}/d/dmd/phobos/etc/c
-cp -pr src/druntime/doc $RPM_BUILD_ROOT%{_docdir}/dmd/druntime
 install tools/generated/linux/%{model}/{ddemangle,rdmd} $RPM_BUILD_ROOT%{_bindir}
 install -Dp man/man1/dmd.1 $RPM_BUILD_ROOT%{_mandir}/man1/dmd.1
 install -Dp man/man5/dmd.conf.5 $RPM_BUILD_ROOT%{_mandir}/man5/dmd.conf.5
@@ -142,8 +144,8 @@ rm -rf $RPM_BUILD_ROOT
 
 %files libs
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libphobos2.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libphobos2.so.0.65
+%attr(755,root,root) %{_libdir}/libphobos2.so.0.70.2
+%attr(755,root,root) %ghost %{_libdir}/libphobos2.so.0.70
 
 %files
 %defattr(644,root,root,755)
@@ -151,12 +153,10 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/ddemangle
 %attr(755,root,root) %{_bindir}/dmd
 %attr(755,root,root) %{_bindir}/rdmd
-%if %{with dynamic}
 %attr(755,root,root) %{_libdir}/libphobos2.so
-%attr(755,root,root) %{_libdir}/libdruntime-linux%{model}.so
-%endif
-%{_libdir}/libdruntime-linux%{model}so.a
-%{_libdir}/libdruntime-linux%{model}so.o
+%{_libdir}/libdruntime.so.a
+%{_libdir}/libdruntime.so.o
+%{_libdir}/libphobos2.so.0.70.o
 %{_sysconfdir}/dmd.conf
 %dir %{_includedir}/d
 %{_includedir}/d/dmd
@@ -168,6 +168,5 @@ rm -rf $RPM_BUILD_ROOT
 %files static
 %defattr(644,root,root,755)
 %endif
-%{_libdir}/libdruntime-linux%{model}.a
-%{_libdir}/libdruntime-linux%{model}.o
+%{_libdir}/libdruntime.a
 %{_libdir}/libphobos2.a
diff --git a/dmd-opt.patch b/dmd-opt.patch
new file mode 100644
index 0000000..1cacab1
--- /dev/null
+++ b/dmd-opt.patch
@@ -0,0 +1,10 @@
+--- dmd2/src/dmd/posix.mak.orig	2016-03-03 11:42:12.000000000 +0100
++++ dmd2/src/dmd/posix.mak	2016-03-13 08:59:49.245630206 +0100
+@@ -126,6 +126,7 @@
+ 
+ # Default compiler flags for all source files
+ CFLAGS := $(WARNINGS) \
++	$(CXXOPTFLAGS) \
+ 	-fno-exceptions -fno-rtti \
+ 	-D__pascal= -DMARS=1 -DTARGET_$(OS_UPCASE)=1 -DDM_TARGET_CPU_$(TARGET_CPU)=1 \
+ 	$(MODEL_FLAG)
diff --git a/dmd-system-zlib.patch b/dmd-system-zlib.patch
index a0aca4f..a0a6e69 100644
--- a/dmd-system-zlib.patch
+++ b/dmd-system-zlib.patch
@@ -1,6 +1,6 @@
---- dmd2/src/phobos/posix.mak.orig	2014-02-24 05:23:10.000000000 +0100
-+++ dmd2/src/phobos/posix.mak	2014-03-21 19:46:59.187698023 +0100
-@@ -147,7 +147,7 @@
+--- dmd2/src/phobos/posix.mak.orig	2015-04-25 05:20:30.000000000 +0200
++++ dmd2/src/phobos/posix.mak	2015-07-22 15:28:25.126243307 +0200
+@@ -160,7 +160,7 @@
  	PATHSEP:=$(shell echo "\\")
  endif
  
@@ -9,34 +9,23 @@
  
  # Set VERSION, where the file is that contains the version string
  VERSION=../dmd/VERSION
-@@ -236,8 +236,6 @@
+@@ -262,7 +262,7 @@
  # Aggregate all C files over all OSs (this is for the zip file)
  ALL_C_FILES = $(C_FILES) $(C_EXTRAS)
  
 -OBJS = $(addsuffix $(DOTOBJ),$(addprefix $(ROOT)/,$(C_MODULES)))
--
- MAKEFILE = $(firstword $(MAKEFILE_LIST))
- 
- SUBMAKE = $(MAKE) --no-print-directory OS=$(OS) -f $(MAKEFILE)
-@@ -274,8 +272,8 @@
- 	@[ -d $(dir $@) ] || mkdir -p $(dir $@) || [ -d $(dir $@) ]
- 	$(CC) -c $(CFLAGS) $< -o$@
++OBJS =
  
--$(LIB) : $(OBJS) $(ALL_D_FILES) druntime_libs
--	$(DMD) $(DFLAGS) -lib -of$@ $(DRUNTIME) $(D_FILES) $(OBJS)
-+$(LIB) : $(ALL_D_FILES) druntime_libs
-+	$(DMD) $(DFLAGS) -lib -of$@ $(DRUNTIME) $(D_FILES)
- 
- dll : $(ROOT)/libphobos2.so
+ MAKEFILE = $(firstword $(MAKEFILE_LIST))
  
---- dmd2/tools/posix.mak.orig	2014-02-13 16:09:46.000000000 +0100
-+++ dmd2/tools/posix.mak	2014-03-22 10:01:55.092212006 +0100
-@@ -102,7 +102,7 @@
- #dreadful custom step because of libcurl dmd linking problem (Bugzilla 7044)
- $(CURL_TOOLS): $(ROOT)/%: %.d
- 	$(DMD) -c -of$(@).o $(<)
--	($(DMD) -v -of$(@) $(@).o 2>/dev/null | grep '\-Xlinker' | cut -f2- -d' ' ; echo -lcurl  ) | xargs $(CC)
-+	($(DMD) -v -of$(@) $(@).o 2>/dev/null | grep '\-Xlinker' | cut -f2- -d' ' ; echo -lcurl -lz) | xargs $(CC)
+--- dmd2/tools/posix.mak.orig	2015-07-21 22:13:45.308848546 +0200
++++ dmd2/tools/posix.mak	2015-07-22 15:29:39.346240185 +0200
+@@ -103,7 +103,7 @@
+ 	$(DMD) $(MODEL_FLAG) $(DFLAGS) -c -of$(@).o $(<)
+ # grep for the linker invocation and append -lcurl
+ 	LINKCMD=$$($(DMD) $(MODEL_FLAG) $(DFLAGS) -v -of$(@) $(@).o 2>/dev/null | grep $(@).o); \
+-	$${LINKCMD} -lcurl
++	$${LINKCMD} -lcurl -lz
  
  $(TOOLS) $(DOC_TOOLS): $(ROOT)/%: %.d
  	$(DMD) $(MODEL_FLAG) $(DFLAGS) -of$(@) $(<)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/dmd.git/commitdiff/bf555f484fcdb8b61ae5ea7133d3b2976af62141



More information about the pld-cvs-commit mailing list