Add a custom apparmor profile to a snap

I cannot build my own library and i cannot package any GPL code, yet my snap depends on it. I want to use the library, that the users already have on their system, but app armor won’t let me. Can I somehow, in snapcraft.yaml, define an additional rule for app armor?

P.S.: my snap wants to access /run/pcscd/pcscd.comm.

P.P.S.: my current workaround is

sudo ln -s /var/lib/snapd/apparmor/profiles/snap.our-app.our-app /etc/apparmor.d/
sudo aa-complain snap.our-app.our-app

and I obviously don’t like it.

Snaps cannot define their own apparmor snippets directly, the only way to modify the AppArmor profile for a snap is by connecting interfaces. If you need to access pcscd socket from the host system, you could try using system-files for this specific path /run/pcscd/pcscd.comm and ask for auto-connection of this for your snap. That does mean your software depends on the user having pcscd installed on their host, which is not a typical usage pattern for strict snaps which should ideally ship all dependencies inside themselves for optimal compatibility.

IANAL, but this sounds like a legal problem? If your code depends on GPL code, but is not itself GPL, that sounds fishy to me…