Snapping LDC (LLVM-based D compiler)

Andrew Wilkins andrew.wilkins at canonical.com
Fri Sep 2 03:42:12 UTC 2016


On Fri, Sep 2, 2016 at 6:34 AM Joseph Rushton Wakeling <
joseph.wakeling at webdrake.net> wrote:

> On 01.09.2016 23:52, Joseph Rushton Wakeling wrote:
> > Now create a file `prime/bin/gcc.wrapper` with the following contents:
> > https://gist.github.com/WebDrake/0081628d70b61e271006c9b8fa3454ef
> >
> > (This is basically the command-gcc.wrapper that would be generated if I
> were
> > exposing the gcc command outside the snap, but minus the path-related
> stuff that
> > I presume is the objectionable part of using that wrapper.)
>
> Even easier solution: remove the `-gcc=` flag from the ldc2.conf, and just
> name
> the wrapper in prime/bin as `gcc`.
>

What I'm going to do with llgo is:
 - use "organize" in the gcc part, renaming usr/bin/gcc to usr/bin/gcc.real
 - add another part using the "dump" plugin, with a simple #!/bin/sh script
called usr/bin/gcc that invokes gcc.real with --sysroot=$SNAP

You can do something similar for ldc2.conf: omit the default one from your
ldc2 part's installed files (add "-etc/ldc2.conf" to the "snap"), and
provide another part that has the ldc2.conf you want.

I've forked your gist here:
    https://gist.github.com/axw/371db15c5139c9dc64bf920f30118e19
If you create gcc-wrapper and ldc2-conf directories in the same directory
as snapcraft.yaml, and add the gcc-wrapper and ldc2.conf files to those,
respectively, it should build cleanly with a single "snapcraft". At least
it did for me - and "snap run ldc2" was able to compile something from my
home directory.

Cheers,
Andrew

I also note that libgcc-5-dev doesn't need to be in the `parts:` section of
> snapcraft.yaml.
>
>

> --
> Snapcraft mailing list
> Snapcraft at lists.snapcraft.io
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/snapcraft
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20160902/96abe975/attachment.html>


More information about the Snapcraft mailing list