Advanced grammar is great to help with ensuring that things are declarative instead of imperative, but a key missing support is on the plugin-provided keys, like cmake-parameters
, autotools-configure-parameters
, meson-parameters
, etc. This post is a request for snapcraft plugins to grow support for advanced grammar on keys they add to the snapcraft.yaml
schema. Specifically I want to be able to do something like this:
libaom:
after: [gegl]
source: https://aomedia.googlesource.com/aom
source-type: git
plugin: cmake
build-snaps: [cmake]
build-environment:
- CFLAGS: -Ofast -g -pipe -flto
- CXXFLAGS: -Ofast -g -pipe -flto
- LDFLAGS: -flto
cmake-parameters:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr
- -DENABLE_DOCS=OFF
- -DENABLE_EXAMPLES=OFF
- -DENABLE_TESTDATA=OFF
- -DENABLE_TESTS=OFF
- -DCONFIG_PIC=1
- -DCONFIG_AV1_ENCODER=1
- -DCONFIG_AV1_DECODER=1
- -DCONFIG_MULTITHREAD=1
# Needs advanced grammar support from Snapcraft that isn't available here
- to armhf:
- -DAOM_NEON_INTRIN_FLAG=-mfpu=neon
Because this isn’t available I have to do everything the plugin would do for me in an override-build
block, which is prone to error in implementation, and is duplicating work that has already been done in Snapcraft upstream.