|
name: octave |
|
base: core18 |
|
summary: Interactive programming environment for numerical computations |
|
description: | |
|
GNU Octave is a high-level interpreted language, primarily intended for |
|
numerical computations. It provides capabilities for the numerical |
|
solution of linear and nonlinear problems, and for performing other |
|
numerical experiments. It also provides extensive graphics capabilities |
|
for data visualization and manipulation. Octave is normally used through |
|
its interactive command line interface, but it can also be used to write |
|
non-interactive programs. The Octave language is quite similar to |
|
Matlab so that most programs are easily portable. |
|
confinement: strict |
|
adopt-info: octave |
|
|
|
apps: |
|
octave: |
|
command: bin/octave |
|
common-id: org.octave.Octave |
|
desktop: share/applications/org.octave.Octave.desktop |
|
environment: |
|
OCTAVE_HOME: "$SNAP" |
|
GNUPLOT_DRIVER_DIR: "$SNAP/usr/lib/gnuplot" |
|
GNUPLOT_LUA_DIR: "$SNAP/usr/share/gnuplot/gnuplot/5.2/lua" |
|
GNUPLOT_PS_DIR: "$SNAP/usr/share/gnuplot/gnuplot/5.2/PostScript" |
|
GS_LIB: "$SNAP/usr/share/ghostscript/9.26/Resource/Init:$SNAP/usr/share/ghostscript/9.26/lib:$SNAP/usr/share/ghostscript/9.26/Resource/Font:$SNAP/usr/share/ghostscript/fonts:$SNAP/usr/share/fonts" |
|
LD_LIBRARY_PATH: "$SNAP/lib/octave/$SNAPCRAFT_PROJECT_VERSION" |
|
LOCPATH: "$SNAP/usr/lib/locale" |
|
PKG_CONFIG_PATH: "$SNAP/lib/pkgconfig:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pkgconfig:$SNAP/usr/share/pkgconfig" |
|
PKG_CONFIG_SYSROOT_DIR: "$SNAP" |
|
UNITSFILE: "$SNAP/usr/share/units/definitions.units" |
|
plugs: |
|
- desktop |
|
- desktop-legacy |
|
- home |
|
- network |
|
- opengl |
|
- pulseaudio |
|
- removable-media |
|
- unity7 |
|
- wayland |
|
- x11 |
|
octave-cli: |
|
command: bin/octave-cli |
|
environment: |
|
OCTAVE_HOME: "$SNAP" |
|
GNUPLOT_DRIVER_DIR: "$SNAP/usr/lib/gnuplot" |
|
GNUPLOT_LUA_DIR: "$SNAP/usr/share/gnuplot/gnuplot/5.2/lua" |
|
GNUPLOT_PS_DIR: "$SNAP/usr/share/gnuplot/gnuplot/5.2/PostScript" |
|
GS_LIB: "$SNAP/usr/share/ghostscript/9.26/Resource/Init:$SNAP/usr/share/ghostscript/9.26/lib:$SNAP/usr/share/ghostscript/9.26/Resource/Font:$SNAP/usr/share/ghostscript/fonts:$SNAP/usr/share/fonts" |
|
LD_LIBRARY_PATH: "$SNAP/lib/octave/$SNAPCRAFT_PROJECT_VERSION" |
|
LOCPATH: "$SNAP/usr/lib/locale" |
|
PKG_CONFIG_PATH: "$SNAP/lib/pkgconfig:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pkgconfig:$SNAP/usr/share/pkgconfig" |
|
PKG_CONFIG_SYSROOT_DIR: "$SNAP" |
|
UNITSFILE: "$SNAP/usr/share/units/definitions.units" |
|
plugs: |
|
- desktop |
|
- desktop-legacy |
|
- home |
|
- network |
|
- opengl |
|
- pulseaudio |
|
- removable-media |
|
- unity7 |
|
- wayland |
|
- x11 |
|
|
|
parts: |
|
alsa: |
|
plugin: nil |
|
source: https://github.com/diddledan/snapcraft-alsa.git |
|
override-pull: | |
|
cat > asound.conf <<EOF |
|
pcm.!default { |
|
type pulse |
|
fallback "sysdefault" |
|
hint { |
|
show on |
|
description "Default ALSA Output (currently PulseAudio Sound Server)" |
|
} |
|
} |
|
ctl.!default { |
|
type pulse |
|
fallback "sysdefault" |
|
} |
|
EOF |
|
override-build: | |
|
install -m644 -D -t $SNAPCRAFT_PART_INSTALL/etc asound.conf |
|
prime: |
|
- -usr/share/doc |
|
- -usr/share/man |
|
build-packages: |
|
- libasound2-dev |
|
stage-packages: |
|
- libasound2 |
|
- libasound2-plugins |
|
|
|
octave: |
|
plugin: autotools |
|
source: https://hg.savannah.gnu.org/hgweb/octave |
|
source-type: hg |
|
source-commit: "@" |
|
build-environment: |
|
# Use a sensible default set of build flags, append flags from environment |
|
- CFLAGS: "-g -O2 -fexceptions -fstack-protector-strong${CFLAGS:+ $CFLAGS}" |
|
- CPPFLAGS: "-D_FORTIFY_SOURCE=2${CPPFLAGS:+ $CPPFLAGS}" |
|
- CXXFLAGS: "-g -O2 -fexceptions -fstack-protector-strong${CXXFLAGS:+ $CXXFLAGS}" |
|
- FFLAGS: "-g -O2${FFLAGS:+ $FFLAGS}" |
|
- FLIBS: "-lgfortran -lquadmath -lm" |
|
- LDFLAGS: "-Wl,-z,relro,-z,now -Wl,--as-needed${LDFLAGS:+ $LDFLAGS}" |
|
# Strip debug symbols from programs and libraries when installing |
|
- INSTALL_PROGRAM: "/usr/bin/install -s" |
|
- INSTALL_STRIP_FLAG: "-s" |
|
# Force Octave header files to be found before system header files |
|
# This override can be dropped after upgrading to snapcraft version 3.11 |
|
- INCLUDES: "-Ilibinterp/corefcn" |
|
override-build: | |
|
# Parse octave version information and set snap grade and version |
|
sed -n '/^AC_INIT/{s/^[^,]*, *\[//;s/\],.*//;p}' configure.ac > ac-version.txt |
|
if test -d .hg; then |
|
# Construct a snapshot version string if we are building from mercurial |
|
hg log -r . -T "{node|short}" | cut -c1-8 > commit.txt |
|
date -u +%Y-%m-%d > date.txt |
|
echo "$(cat ac-version.txt)+hg$(cat commit.txt)" > version.txt |
|
echo "<release version=\"$(cat version.txt)\" type=\"development\" date=\"$(cat date.txt)\" />" > release.xml |
|
sed -i "/<releases>/a\ $(cat release.xml)" etc/icons/org.octave.Octave.appdata.xml |
|
sed -i "s/hg_safe.*||/hg_safe log -r . -T \"{node|short}\" ||/" build-aux/mk-hg-id.sh |
|
grade=devel |
|
version="$(cat version.txt)" |
|
else |
|
grade=stable |
|
version="$(cat ac-version.txt)" |
|
fi |
|
snapcraftctl set-grade "$grade" |
|
snapcraftctl set-version "$version" |
|
|
|
# Patch RapidJSON header files with upstream fixes that haven't been |
|
# incorporated into the Ubuntu distributed version of the library |
|
if test -d /usr/include/rapidjson/.orig; then |
|
cp -a /usr/include/rapidjson/.orig/*.h /usr/include/rapidjson |
|
fi |
|
patch -p3 -N -d /usr/include/rapidjson -b -B .orig/ < $SNAPCRAFT_PROJECT_DIR/patches/rapidjson-issue-905.patch |
|
patch -p3 -N -d /usr/include/rapidjson -b -B .orig/ < $SNAPCRAFT_PROJECT_DIR/patches/rapidjson-issue-1718.patch |
|
|
|
# Patch build_env and mkoctfile to record the original build flags from |
|
# above, so that additional flags from snapcraft build setup aren't leaked |
|
sed -i "s|%OCTAVE_CONF_CFLAGS%|\"-g -O2 -fexceptions -fstack-protector-strong\"|" libinterp/build-env.in.cc src/mkoctfile.in.cc |
|
sed -i "s|%OCTAVE_CONF_CPPFLAGS%|\"-D_FORTIFY_SOURCE=2\"|" libinterp/build-env.in.cc src/mkoctfile.in.cc |
|
sed -i "s|%OCTAVE_CONF_CXXFLAGS%|\"-g -O2 -fexceptions -fstack-protector-strong\"|" libinterp/build-env.in.cc src/mkoctfile.in.cc |
|
sed -i "s|%OCTAVE_CONF_LDFLAGS%|\"-Wl,-z,relro,-z,now -Wl,--as-needed\"|" libinterp/build-env.in.cc src/mkoctfile.in.cc |
|
sed -i "s|%OCTAVE_CONF_OCT_LINK_OPTS%|\"-Wl,-z,relro,-z,now -Wl,--as-needed\"|" libinterp/build-env.in.cc src/mkoctfile.in.cc |
|
snapcraftctl build |
|
override-prime: | |
|
snapcraftctl prime |
|
sed -i 's|^Icon=octave|Icon=/share/icons/hicolor/scalable/apps/octave.svg|' share/applications/org.octave.Octave.desktop |
|
sed -i 's|^prefix=.*|prefix=/usr|' usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pkgconfig/*.pc |
|
rm -f usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pkgconfig/hdf5.pc |
|
ln -s hdf5-serial.pc usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pkgconfig/hdf5.pc |
|
rm -f usr/bin/gnuplot |
|
ln -s gnuplot-qt usr/bin/gnuplot |
|
prime: |
|
- -share/man |
|
- -usr/share/doc |
|
- -usr/share/doc-base |
|
- -usr/share/man |
|
- -usr/share/texmf/ls-R |
|
organize: |
|
usr/lib/$SNAPCRAFT_ARCH_TRIPLET/openblas: usr/lib/$SNAPCRAFT_ARCH_TRIPLET |
|
after: [alsa] |
|
|
|
build-packages: |
|
- bison |
|
- epstool |
|
- flex |
|
- gfortran |
|
- ghostscript |
|
- gnuplot-nox |
|
- gperf |
|
- icoutils |
|
- less |
|
- libarpack2-dev |
|
- libcurl4-gnutls-dev |
|
- libfftw3-dev |
|
- libfltk1.3-dev |
|
- libfontconfig1-dev |
|
- libgl2ps-dev |
|
- libglpk-dev |
|
- libglu1-mesa-dev |
|
- libgraphicsmagick++1-dev |
|
- libhdf5-dev |
|
- libnetcdf-dev |
|
- libncurses5-dev |
|
- libopenblas-dev |
|
- libpcre3-dev |
|
- libqhull-dev |
|
- libqrupdate-dev |
|
- libqscintilla2-qt5-dev |
|
- libqt5opengl5-dev |
|
- libreadline-dev |
|
- librsvg2-bin |
|
- libsndfile1-dev |
|
- libsuitesparse-dev |
|
- pkg-config |
|
- portaudio19-dev |
|
- qtbase5-dev |
|
- qttools5-dev |
|
- qttools5-dev-tools |
|
- rapidjson-dev |
|
- texinfo |
|
- texlive-fonts-recommended |
|
- texlive-latex-base |
|
- texlive-plain-generic |
|
|
|
stage-packages: |
|
- build-essential |
|
- curl |
|
- epstool |
|
- gfortran |
|
- ghostscript |
|
- gnuplot-qt |
|
- info |
|
- libamd2 |
|
- libarpack2 |
|
- libcamd2 |
|
- libccolamd2 |
|
- libcholmod3 |
|
- libcolamd2 |
|
- libcurl3-gnutls |
|
- libcxsparse3 |
|
- libfftw3-double3 |
|
- libfftw3-single3 |
|
- libfltk-gl1.3 |
|
- libfltk1.3 |
|
- libfontconfig1 |
|
- libgl2ps1.4 |
|
- libglpk40 |
|
- libglu1-mesa |
|
- libgraphicsmagick++-q16-12 |
|
- libhdf5-dev |
|
- libnetcdf-dev |
|
- libncurses5-dev |
|
- libopenblas-dev |
|
- libpcre3-dev |
|
- libportaudio2 |
|
- libpython3-dev |
|
- libqhull-r7 |
|
- libqrupdate1 |
|
- libqscintilla2-qt5-13 |
|
- libqt5core5a |
|
- libqt5gui5 |
|
- libqt5help5 |
|
- libqt5network5 |
|
- libqt5opengl5 |
|
- libqt5printsupport5 |
|
- libqt5sql5 |
|
- libqt5sql5-sqlite |
|
- libqt5widgets5 |
|
- libqt5xml5 |
|
- libsndfile1 |
|
- libspqr2 |
|
- libumfpack5 |
|
- locales-all |
|
- pkg-config |
|
- python3-venv |
|
- texinfo |
|
- units |
|
- unzip |
|
- zip |
|
|
|
python-packages: |
|
plugin: python |
|
python-packages: |
|
- mpmath==1.1.0 |
|
- sympy==1.5.1 |
|
prime: |
|
- -bin/isympy |
|
- -share/man |
|
- -usr/share/doc |
|
- -usr/share/man |
|
|
|
|
|
layout: |
|
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/alsa-lib: |
|
bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/alsa-lib |
|
/etc/asound.conf: |
|
bind-file: $SNAP/etc/asound.conf |
|
/usr/share/alsa/alsa.conf: |
|
bind-file: $SNAP/etc/asound.conf |
|
|
|
# Make staged dri and pulseaudio modules available in expected locations |
|
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri: |
|
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri |
|
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio: |
|
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio |
|
|
|
# Make staged perl modules available in expected perl path directories |
|
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/perl/5.26: |
|
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/perl/5.26 |
|
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/perl5: |
|
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/perl5 |
|
/usr/share/perl: |
|
symlink: $SNAP/usr/share/perl |
|
/usr/share/perl5/Text: |
|
symlink: $SNAP/usr/share/perl5/Text |
|
/usr/share/perl5/XML: |
|
symlink: $SNAP/usr/share/perl5/XML |
|
|
|
# Make staged qt plugins available in expected locations |
|
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5: |
|
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5 |
|
|
|
# Make xkb configuration files available in expected locations, required |
|
# by qt in 18.04, may not be needed in 20.04 |
|
/usr/share/X11: |
|
symlink: $SNAP/usr/share/X11 |
|
|
|
# Make all system and staged development library header files available in |
|
# standard /usr/include location, to allow compiling oct files and packages |
|
/usr/include: |
|
bind: $SNAP/usr/include |
|
|
|
# Make certain libc static library fragments available in expected locations, |
|
# to allow linking oct files and packages |
|
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libc_nonshared.a: |
|
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libc_nonshared.a |
|
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libmvec_nonshared.a: |
|
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libmvec_nonshared.a |
|
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libpthread_nonshared.a: |
|
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libpthread_nonshared.a |
|
|
|
# Make staged Python wheels available in expected system directory |
|
/usr/share/python-wheels: |
|
symlink: $SNAP/usr/share/python-wheels |