Thread overview
Packaging GDC
Jan 18, 2016
Marc Schütz
Jan 18, 2016
Dicebot
Jan 18, 2016
Marc Schütz
January 18, 2016
Hi!

I'm working on packaging GDC for openSUSE, and I have a few questions.

Is it possible to make the build process install only D related files, for example cc1d, but not cc1?

If the above works (or I manually exclude generic GCC files from the package), will the D specific binaries be compatible with generic GCC binaries/libs from other GCC versions?

I'm asking this because I'd rather not have to make the GDC package depend on the distribution's default GCC packages, because then I would have to match the GCC versions across the different openSUSE versions...

Any hints?
January 18, 2016
On Monday, 18 January 2016 at 10:58:52 UTC, Marc Schütz wrote:
> Hi!
>
> I'm working on packaging GDC for openSUSE, and I have a few questions.
>
> Is it possible to make the build process install only D related files, for example cc1d, but not cc1?
>
> If the above works (or I manually exclude generic GCC files from the package), will the D specific binaries be compatible with generic GCC binaries/libs from other GCC versions?
>
> I'm asking this because I'd rather not have to make the GDC package depend on the distribution's default GCC packages, because then I would have to match the GCC versions across the different openSUSE versions...
>
> Any hints?

1)

About not having gcc as dependency - no, as far as I have understood so far, gcc backend is not designed not be used as library for building independent compilers, it only works as a platform which provides set of supported languages. There are plenty of shared libraries/tools between different gcc-based compilers which would conflict if installed all together.

And using different gcc version from distribution default gcc is a good way to screw people systems in a very hideous ways :)

2)

However if you do use the same base GCC version as existing distro gcc there is no need to package common stuff like cc1 (it would conflict) - you can only package D additions and specify system gcc package as dependency.

This is what I do on Arch Linux:
https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/gdc (see PKGBUILD for bash script which builds/packages stuff)

As you can see actual GDC essentials come down to this:

install -D -m755 $srcdir/gcc-build/gcc/gdc $pkgdir/usr/bin/gdc
install -D -m755 $srcdir/gcc-build/gcc/cc1d $pkgdir/usr/lib/gcc/$CHOST/$pkgver/cc1d
install -D -m755 $srcdir/GDMD/dmd-script $pkgdir/usr/bin/gdmd

# + copy/install libphobos2.a and all runtime/phobos modules
January 18, 2016
On Monday, 18 January 2016 at 14:31:03 UTC, Dicebot wrote:
> However if you do use the same base GCC version as existing distro gcc there is no need to package common stuff like cc1 (it would conflict) - you can only package D additions and specify system gcc package as dependency.

Ok, I guess I will have to use the same GCC versions as the base distro, and try to match their configuration as closely as possible, to avoid incompatibilities.

>
> This is what I do on Arch Linux:
> https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/gdc (see PKGBUILD for bash script which builds/packages stuff)
>
> As you can see actual GDC essentials come down to this:
>
> install -D -m755 $srcdir/gcc-build/gcc/gdc $pkgdir/usr/bin/gdc
> install -D -m755 $srcdir/gcc-build/gcc/cc1d $pkgdir/usr/lib/gcc/$CHOST/$pkgver/cc1d
> install -D -m755 $srcdir/GDMD/dmd-script $pkgdir/usr/bin/gdmd
>
> # + copy/install libphobos2.a and all runtime/phobos modules

Thanks for this! That's actually a nice idea not to call `make install`, but instead package the compiled files directly. I'll have to try this, should make things a bit easier compared to deleting all the unwanted files.