A new user interface for you! Read more...

File gdc.spec of Package gdc

#
# spec file for package gdc
#
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define gdc_ver 2.066.1
%define gcc_ver 5.3.0
Name:           gdc
Version:        %{gdc_ver}gcc5
Release:        0
License:        GPL-2.0+
Summary:        GNU D Compiler
Url:            http://gdcproject.org/
Group:          Development/Languages/Other
Source0:        https://github.com/D-Programming-GDC/GDC/archive/v%{gdc_ver}_gcc5/%{name}-%{version}.tar.gz
Source1:        ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{gcc_ver}/gcc-%{gcc_ver}.tar.bz2
# https://github.com/D-Programming-GDC/GDMD
Source2:        GDMD-20150829.tar.xz
BuildRequires:  binutils-gold
BuildRequires:  zlib-devel
BuildRequires:  gcc-c++
BuildRequires:  gmp-devel >= 4.2
BuildRequires:  mpfr-devel >= 2.4.0
BuildRequires:  mpc-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%define gdc_dir 

%package phobos-devel
Group:          Development/Libraries/Other
Summary:        Development files

%description
GNU D Compiler
GDC is a GPL implementation of the D compiler which integrates the open source D front end with GCC.

%description phobos-devel
Phobos library development files

%prep
%setup -q -n GDC-%{gdc_ver}_gcc5 -a 1 -a 2
./setup-gcc.sh gcc-%{gcc_ver}

%build
mkdir build
cd build
LDFLAGS="-fuse-ld=gold" ../gcc-%{gcc_ver}/configure \
        --prefix=%{_prefix} --host=%{_host} --build=%{_build} \
        --libdir=%{_libdir} --libexecdir=%{_libexecdir} \
        --mandir=%{_mandir} --infodir=%{_infodir} \
        --with-bugurl="http://bugzilla.gdcproject.org" \
        --enable-languages=d \
        --enable-shared --enable-threads=posix \
        --with-system-zlib --enable-__cxa_atexit \
        --disable-libunwind-exceptions --enable-clocale=gnu \
        --disable-libstdcxx-pch --disable-libssp \
        --enable-gnu-unique-object --enable-linker-build-id \
        --enable-cloog-backend=isl --disable-cloog-version-check \
        --enable-gold --enable-plugin --enable-ld=default \
        --enable-install-libiberty --with-plugin-ld=ld.gold \
        --with-linker-hash-style=gnu \
        --disable-multilib --disable-libgomp --disable-libmudflap \
        --disable-libquadmath --enable-checking=release
make %{?_smp_mflags}

%install
install -D -m755 build/gcc/gdc %{buildroot}%{_bindir}/gdc
install -D -m755 build/gcc/cc1d %{buildroot}%{_libdir}/gcc/%{_host}/%{gcc_ver}/cc1d
# tools
install -D -m755 GDMD/dmd-script %{buildroot}%{_bindir}/gdmd
gzip GDMD/dmd-script.1
install -D -m644 GDMD/dmd-script.1.gz %{buildroot}%{_mandir}/man1/gdmd.1.gz
# druntime
install -D libphobos/libdruntime/object.di %{buildroot}/%{_includedir}/d/gdc/object.di
install -D libphobos/libdruntime/__entrypoint.di  %{buildroot}/%{_includedir}/d/gdc/__entrypoint.di
cp -r libphobos/libdruntime/core %{buildroot}/%{_includedir}/d/gdc/core
cp -r libphobos/libdruntime/gcc %{buildroot}/%{_includedir}/d/gdc/gcc
# workaround for auto-generated libbacktrace issue
# script needs to be re-written to first call normal gcc instalaltion targets to
# avoid such problems in future
cp build/%{_host}/libphobos/libdruntime/gcc/libbacktrace.d %{buildroot}/%{_includedir}/d/gdc/gcc/
rm %{buildroot}/%{_includedir}/d/gdc/gcc/libbacktrace.d.in
# phobos
cp -r libphobos/src/std %{buildroot}/%{_includedir}/d/gdc/std
cp -r libphobos/src/etc %{buildroot}/%{_includedir}/d/gdc/etc
install -D -m644 build/%{_host}/libphobos/src/libgphobos2.a %{buildroot}/%{_libdir}/libgphobos2.a
    
%files
%defattr(-,root,root)
%{_bindir}/gdc
%{_bindir}/gdmd
%dir %{_libdir}/gcc/
%dir %{_libdir}/gcc/%{_host}/
%dir %{_libdir}/gcc/%{_host}/
%dir %{_libdir}/gcc/%{_host}/%{gcc_ver}/
%{_libdir}/gcc/%{_host}/%{gcc_ver}/cc1d
%{_mandir}/man1/gdmd.1.gz

%files phobos-devel
%defattr(-,root,root)
%{_includedir}/d
%{_libdir}/libgphobos2.a