aboutsummaryrefslogtreecommitdiff
path: root/contrib/snap/snapcraft.yaml
blob: 5b18bd420235ceb1d4b418a218296042dbf3c7b5 (plain) (blame)
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
name: discoin-core # you probably want to 'snapcraft register <name>'
version: '1.14.4'
summary: Reference client of Discoin, a peer-to-peer digital currency like Bitcoin.
description: |
  Discoin is a cryptocurrency like Bitcoin, although it does not use SHA256 as its proof of work (POW). Taking development cues from Tenebrix and Litecoin, Discoin currently employs a simplified variant of scrypt. MIT licenced.

base: core18
grade: stable
confinement: strict
architectures:
  - build-on: [amd64, i386, arm64]

apps:
  d:
    command: discoind
    plugs: [home, removable-media, network, network-bind]
    environment:
    # Override HOME so the datadir is located at ~/snap/discoin-core/common/.discoin/ instead of ~/snap/discoin-core/current/.discoin/, and each new version of the snap won't have a different data directory: https://docs.snapcraft.io/environment-variables/7983
      HOME: $SNAP_USER_COMMON
  qt:
    command: qt4-launch discoin-qt
    plugs: [home, removable-media, network, network-bind, desktop, x11, unity7]
    environment:
      HOME: $SNAP_USER_COMMON
      DISABLE_WAYLAND: 1
  cli:
    command: discoin-cli
    plugs: [home, removable-media, network]
    environment:
      HOME: $SNAP_USER_COMMON

parts:
  discoin-core:
    plugin: nil
    override-build: |
      echo "Downloading files..."
      wget https://github.com/discoin/discoin/releases/download/v${SNAPCRAFT_PROJECT_VERSION}/discoin-${SNAPCRAFT_PROJECT_VERSION}-${SNAPCRAFT_ARCH_TRIPLET}.tar.gz
      wget https://github.com/discoin/gitian.sigs/archive/refs/heads/master.zip
      unzip master.zip
      echo "Verifying secure hash matches signed values..."
      checksum=$(sha256sum discoin-${SNAPCRAFT_PROJECT_VERSION}-${SNAPCRAFT_ARCH_TRIPLET}.tar.gz)
      if ! grep -r $checksum *; then
        echo "Secure hash not verified."
        return
      fi
      tar -xvf discoin-${SNAPCRAFT_PROJECT_VERSION}-${SNAPCRAFT_ARCH_TRIPLET}.tar.gz
      echo "Running tests..."
      discoin-${SNAPCRAFT_PROJECT_VERSION}/bin/test_discoin
      echo "Installing Discoin..."
      install -m 0755 -D -t $SNAPCRAFT_PART_INSTALL/bin discoin-${SNAPCRAFT_PROJECT_VERSION}/bin/discoind
      install -m 0755 -D -t $SNAPCRAFT_PART_INSTALL/bin discoin-${SNAPCRAFT_PROJECT_VERSION}/bin/discoin-qt
      install -m 0755 -D -t $SNAPCRAFT_PART_INSTALL/bin discoin-${SNAPCRAFT_PROJECT_VERSION}/bin/discoin-cli
      wget https://raw.githubusercontent.com/discoin/discoin/v${SNAPCRAFT_PROJECT_VERSION}/share/pixmaps/bitcoin128.png
      install -m 0644 -D -t $SNAPCRAFT_PART_INSTALL/share/pixmaps bitcoin128.png
    build-packages:
      - unzip
      - wget
    stage-packages:
      - libfreetype6
      - libpng16-16
      - libx11-xcb1
      - libx11-6
      - libfontconfig
  qt4conf:
    build-packages:
      - dpkg-dev
    plugin: make
    source: https://github.com/kyrofa/qt4conf.git