makedeb


makedeb-lapce-bin 0.2.7-1


Lightning-fast and powerful code editor

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for makedeb-lapce-bin.

#!/usr/bin/env bash
# -- vim: filetype=sh syntax=sh softtabstop=2 tabstop=2 shiftwidth=2 fileencoding=utf-8 smartindent autoindent expandtab
# Maintainer: alfador <contact@havi.dev>

# ─── INTERNALS ────────────────────────────────────────────────────────────────
set -e ;
_github_repo="lapce/lapce"
_pkgname="$(basename "${_github_repo}")"
_get() {
    curl \
    -s \
      "https://api.github.com/repos/${_github_repo}/releases/tags/v${pkgver}" \
    | awk -F '"' '/"'"$1"'":/{print $4}'
}
# ──────────────────────────────────────────────────────────────────────────────
pkgname="makedeb-${_pkgname}-bin"
# shellcheck disable=SC2034
pkgver="0.2.7"
# shellcheck disable=SC2034
pkgrel=1
# shellcheck disable=SC2034
pkgdesc="Lightning-fast and powerful code editor"
# arch=('amd64' 'arm' 'aarch64')
# shellcheck disable=SC2034
arch=('amd64')
# shellcheck disable=SC2034
provides=("${_pkgname}" "${_pkgname}-bin")
# shellcheck disable=SC2034
conflicts=("${_pkgname}" "${_pkgname}-git" "${_pkgname}-bin")
# shellcheck disable=SC2034
url="https://lapce.dev"
# shellcheck disable=SC2034
license=("Apache")
# shellcheck disable=SC2034
makedepends=("curl" "jq")
# shellcheck disable=SC2034
depends=(
  "expat"
  "libfontconfig-dev"
  "libgtk-3-dev"
)
# shellcheck disable=SC2034
source=(
  "https://github.com/${_github_repo}/releases/download/v${pkgver}/${_pkgname^}-linux.tar.gz"
  https://raw.githubusercontent.com/lapce/lapce/$(_get target_commitish)/extra/images/logo.png
  https://raw.githubusercontent.com/lapce/lapce/$(_get target_commitish)/extra/linux/dev.lapce.lapce.desktop
  https://raw.githubusercontent.com/lapce/lapce/$(_get target_commitish)/extra/linux/dev.lapce.lapce.metainfo.xml
)
# shellcheck disable=SC2034
sha512sums=(
  '67245ac8969f074b3ae51094db7986471e41b9308815403c900f957a8e6fbbccac370a5356b5579f57a6bec73a8bbc4ad87720ed0629c0aa22637ba0a0a3c98e'
  '2a087d481dad425e6280ac32b01fbd41f6df6253a0a0674f9d0f9cfa447a0e0aefd1e1d1e0b78a1705c5ca32557fcee5ec3510efb6fd27f8f64e2db6e50307fb'
  '03f0179acc789dc7d40618b684368342e0e8c62c3a4bc1c04558f0a66da4492b826de7395416993f8a87a4642454abce7fbbd3d5b42eae5403fbf1f82cd7aa77'
  '28aa6b8fed7f8eb5d965296b7b47d650c061c496d9034817fb4de512c1a2a85839b9e2473f915cae9099151c994169be9c3b6e939337749a0ecdeadb183ebfd1'
)
# shellcheck disable=SC2034
options=('!lto')
pkgver() {
  curl \
    -sL "https://api.github.com/repos/${_github_repo}/releases/latest" |
    jq -r '.tag_name' |
    sed -e 's/v//g'
}
# ──────────────────────────────────────────────────────────────────────
prepare() {
  msg2 "ensuring '${srcdir}/${_pkgname^}/${_pkgname}' is executable"
  chmod +x "${srcdir}/${_pkgname^}/${_pkgname}"
}
check() {
  [ "$("${srcdir}/${_pkgname^}/${_pkgname}" -V)" != "${_pkgname^} ${pkgver}" ] \
  && return 1 \
  || return 0 ;
}


package() {
  msg2 "packaging ${pkgname}-${pkgver} ..."
  install -D Lapce/lapce "$pkgdir/usr/bin/lapce"
  install -Dm 644 dev.lapce.lapce.desktop "$pkgdir/usr/share/applications/dev.lapce.lapce.desktop"
  install -Dm 644 dev.lapce.lapce.metainfo.xml "$pkgdir/usr/share/metainfo/dev.lapce.lapce.metainfo.xml"
  install -Dm 644 logo.png "$pkgdir/usr/share/pixmaps/dev.lapce.lapce.png"
}
# ─── REFRENCES ──────────────────────────────────────────────────────────────────
# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=lapce-bin
# ────────────────────────────────────────────────────────────────────────────────