I’ve been experimenting a bit lately with creating a snap of whipper, a command line tool to rip audio cds to flac.
So far, I have managed to get something together that seems to mostly function okay (in devmode).
However, I am hitting an issue with sox, specifically the following error.
exception Exception at /snap/whipper/x1/lib/python2.7/site-packages/whipper/common/config.py:116: getDefeatsCache(): soxi failed: soxi FAIL formats: no handler for detected file type `flac'
Weird thing is, when I run sox from within the snap, it reports that flac files are supported.
duncan@duncan-desktop:/snap/whipper/x1/usr/bin$ ./sox --help
...
AUDIO FILE FORMATS: 8svx aif aifc aiff aiffc al amb amr-nb amr-wb anb au avr awb caf cdda cdr cvs cvsd cvu dat dvms f32 f4 f64 f8 fap flac fssd gsm gsrt hcom htk ima ircam la lpc lpc10 lu mat mat4 mat5 maud mp2 mp3 nist ogg paf prc pvf raw s1 s16 s2 s24 s3 s32 s4 s8 sb sd2 sds sf sl sln smp snd sndfile sndr sndt sou sox sph sw txw u1 u16 u2 u24 u3 u32 u4 u8 ub ul uw vms voc vorbis vox w64 wav wavpcm wv wve xa xi
So I’m really a bit stumped as to what the issue could be. I’m not sure whether it’s my snapcraft file, a bug in the program, or something else entirely.
For reference, my snapcraft.yaml looks as follows.
name: whipper
version: '0.5.1+git'
summary: Python CD-DA ripper preferring accuracy over speed (FORKED from morituri)
description: |
Whipper is a Python 2.7 CD-DA ripper, fork of the morituri project (CDDA ripper for *nix systems aiming for accuracy over speed). It improves morituri which development seems to have halted merging old ignored pull requests, improving it with bugfixes and new features.
grade: devel
confinement: devmode
apps:
whipper:
command: bin/whipper
parts:
whipper:
source: https://github.com/JoeLametta/whipper.git
plugin: python
python-version: python2
build-packages:
- libiso9660-dev
- python-pip
- swig
# - cdparanoia
# - cdrdao
- flac
- libcdio-dev
- libsndfile1-dev
- python-cddb
- python-gobject
- python-musicbrainzngs
- python-mutagen
- python-setuptools
- sox
stage-packages:
- cdparanoia
- cdrdao
- flac
- libcdio13
- libsndfile1
- python-cddb
- python-gobject
- python-musicbrainzngs
- python-mutagen
- python-setuptools
- sox
python-packages:
- pycdio
prepare: |
cd src
make
install: |
cd src
cp accuraterip-checksum $SNAPCRAFT_PART_INSTALL/usr/bin
The command used to rip cds (and produce the error) are as follows
snap run whipper offset find
snap run whipper cd rip
I had a bit more time to work on this and managed to resolve this issue by including SOX as a part in my snap. I’m not entirely sure why this works where throwing it in the stage-packages doesn’t.
My updated yaml now looks as follows
name: whipper
version: '0.5.1'
summary: Python CD-DA ripper preferring accuracy over speed (FORKED from morituri)
description: |
Whipper is a Python 2.7 CD-DA ripper, fork of the morituri project (CDDA ripper for *nix systems aiming for accuracy over speed). It improves morituri which development seems to have halted merging old ignored pull requests, improving it with bugfixes and new features.
grade: devel
confinement: strict
apps:
whipper:
command: bin/whipper
plugs:
- optical-drive
- network
- home
- mount-observe
parts:
whipper:
source: https://github.com/JoeLametta/whipper/archive/v0.5.1.tar.gz
plugin: python
python-version: python2
build-packages:
- libiso9660-dev
- python-pip
- swig
# - cdparanoia
# - cdrdao
- flac
- libcdio-dev
- libsndfile1-dev
- python-cddb
- python-gobject
- python-musicbrainzngs
- python-mutagen
- python-setuptools
stage-packages:
- cdparanoia
- cdrdao
- flac
- libcdio13
- libsndfile1
- python-cddb
- python-gobject
- python-musicbrainzngs
- python-mutagen
- python-setuptools
python-packages:
- pycdio
prepare: |
cd src
make
install: |
cd src
cp accuraterip-checksum $SNAPCRAFT_PART_INSTALL/usr/bin
sox:
source: http://downloads.sourceforge.net/sox/sox-14.4.2.tar.gz
plugin: autotools
I am now working on removing devmode and am encountering what looks like an apparmour issue with cdparanoia. So far I have run the following commands