forked from ubuntu/gnome-calculator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
snapcraft.yaml
89 lines (81 loc) · 3.34 KB
/
snapcraft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: gnome-calculator
adopt-info: gnome-calculator
summary: GNOME Calculator
description: |
GNOME Calculator is an application that solves mathematical equations.
Though it at first appears to be a simple calculator with only basic
arithmetic operations, you can switch into Advanced, Financial, or
Programming mode to find a surprising set of capabilities.
The Advanced calculator supports many operations, including:
logarithms, factorials, trigonometric and hyperbolic functions,
modulus division, complex numbers, random number generation, prime
factorization and unit conversions.
Financial mode supports several computations, including periodic interest
rate, present and future value, double declining and straight line
depreciation, and many others.
Programming mode supports conversion between common bases (binary, octal,
decimal, and hexadecimal), boolean algebra, one’s and two’s complementation,
character to character code conversion, and more.
grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict
base: core22
slots:
# for GtkApplication registration
gnome-calculator:
interface: dbus
bus: session
name: org.gnome.Calculator
apps:
gnome-calculator:
command: usr/bin/gnome-calculator
extensions: [gnome]
plugs:
- gsettings
- network
- network-status
desktop: usr/share/applications/org.gnome.Calculator.desktop
common-id: org.gnome.Calculator.desktop
parts:
gnome-calculator:
source: https://gitlab.gnome.org/GNOME/gnome-calculator.git
source-tag: '42.2'
# ext:updatesnap
# version-format:
# no-9x-revisions: true
plugin: meson
parse-info: [usr/share/metainfo/org.gnome.Calculator.appdata.xml]
meson-parameters:
- --prefix=/snap/gnome-calculator/current/usr
- --buildtype=release
- -Dvala_args="--vapidir=$CRAFT_STAGE/usr/share/vala/vapi"
- -Ddisable-introspection=true
organize:
snap/gnome-calculator/current/usr: usr
build-packages:
- libmpc-dev
- libmpfr-dev
- libgvc6
override-pull: |
craftctl default
craftctl set version=$(git describe --tags --abbrev=10)
override-build: |
# valadoc fails, but we don't need it in the snap anyway
sed -i.bak -e "s|subdir('doc')||g" $CRAFT_PART_SRC/meson.build
# Don't symlink media it leaves dangling symlinks in the snap
sed -i.bak -e 's|media: gnome_calculator_help_media|media: gnome_calculator_help_media, symlink_media: false|g' $CRAFT_PART_SRC/help/meson.build
# Use bundled icon rather than themed icon, needed for 18.04
sed -i.bak -e 's|Icon=org.gnome.Calculator$|Icon=${SNAP}/meta/gui/org.gnome.Calculator.svg|g' $CRAFT_PART_SRC/data/org.gnome.Calculator.desktop.in
mkdir -p $CRAFT_PART_INSTALL/meta/gui/
cp $CRAFT_PART_SRC/data/icons/hicolor/scalable/apps/org.gnome.Calculator.svg $CRAFT_PART_INSTALL/meta/gui/
craftctl default
# Find files provided by the base and platform snap and ensure they aren't
# duplicated in this snap
cleanup:
after: [gnome-calculator]
plugin: nil
build-snaps: [core22, gtk-common-themes, gnome-42-2204]
override-prime: |
set -eux
for snap in "core22" "gtk-common-themes" "gnome-42-2204"; do
cd "/snap/$snap/current" && find . -type f,l -name *.so.* -exec rm -f "$CRAFT_PRIME/{}" \;
done