makedeb


fluffychat 1.7.1-1


Chat with your friends

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for fluffychat.

# Maintainer: garionion <garionion at entr0py.de>
# thanks to celogeek, sseneca, dr460nf1r3, dr460nf1r3 and AverytheFurry for pointing out multiple things

pkgname=fluffychat
pkgver=1.7.1
pkgrel=1
pkgdesc="Chat with your friends"
arch=('amd64' 'arm64' 'armel' 'armhf' 
'i386' 'mipsel' 'mips64el' 'ppc64el' 's390x')
url="https://fluffychat.im/"
license=('AGPL3')
depends=('libgtk-3-0' 'libjsoncpp25' 'libsecret-1-0' 
    'libolm3' 'librhash0')
makedepends=('build-essential'
             'cmake'
             'flutter'
             'ninja-build'
             'clang'
             'libsecret-1-dev'
             'libgtk-3-dev'
             'libolm-dev'
             'librhash-dev'
             'libjsoncpp-dev'
             'libwebkit2gtk-4.1-dev')

provides=("$pkgname")
conflicts=("$pkgname")
source=("fluffychat-v${pkgver}.tar.gz::https://gitlab.com/famedly/fluffychat/-/archive/v${pkgver}/fluffychat-v${pkgver}.tar.gz")
sha256sums=('f09a05d22db07f1d6334139eadb56465a761b5ae9ea7f755c9b9d37ac7cc409f')

prepare() {
  flutter --no-version-check --suppress-analytics config --enable-linux-desktop

  # overriding CMake flags for aarch64 in order to ensure build
  # is not failing
  if [[ "$(uname -m)" == "aarch64" ]]; then
    export CXXFLAGS="${CXXFLAGS/-fstack-protector-strong/ }"
    export CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/ }"

    export CFLAGS="${CFLAGS/-fstack-protector-strong/ }"
    export CFLAGS="${CFLAGS/-fstack-clash-protection/ }"
  fi
  
  cd ${pkgname}-v$pkgver
  flutter --no-version-check --suppress-analytics clean --verbose
  flutter --no-version-check --suppress-analytics pub get --verbose
}

build() {
  cd ${pkgname}-v$pkgver
  flutter --no-version-check --suppress-analytics build linux --release --verbose
}

package() {  
  case "$(uname -m)" in
    "x86_64")
      export FLUTTER_ARCH="x64"
      ;;
    "aarch64")
      export FLUTTER_ARCH="arm64"
      ;;
  esac

  # install
  install -dm755 ${pkgdir}/opt
  mv ${pkgname}-v$pkgver/build/linux/$FLUTTER_ARCH/release/bundle ${pkgdir}/opt/${pkgname}
  
  # link
  install -dm755 ${pkgdir}/usr/bin
  ln -s /opt/${pkgname}/${pkgname} ${pkgdir}/usr/bin/${pkgname}

  # icon
  install -Dm 644 ${pkgdir}/opt/${pkgname}/data/flutter_assets/assets/favicon.png ${pkgdir}/usr/share/pixmaps/${pkgname}.png

  # desktop entry

  install -dm 755 "${pkgdir}/usr/share/applications"
  cat > ${pkgdir}/usr/share/applications/${pkgname}.desktop << EOF
[Desktop Entry]
Type=Application
Version=${pkgver}
Name=FluffyChat
Comment=Open. Nonprofit. Cute. Easy to use (matrix) messenger. Secure and decentralized.
Exec=${pkgname}
Icon=${pkgname}
Terminal=false
EOF

}

# vim: set sw=2 ts=2 et: