Skip to content

PKGBUILD

Typical PKGBUILD for python

Cause at the end of the idea, all I care about with such packages is that it should work for now, and pacman should be able to get rid of it when it creates issues.

pkgname=python-paginate
pkgver=0.1
pkgrel=1
pkgdesc='This module helps dividing large lists of items into pages.'
arch=('any')
url='https://github.com/Pylons/paginate'
license=('MIT')
source=("${pkgname}.zip"::"https://github.com/Pylons/paginate/archive/refs/heads/master.zip")
sha256sums=('SKIP')

build() {
  cd "${_pkgname}-${pkgver}"
  python -m build --wheel --no-isolation
}

package() {
  cd "${_pkgname}-${pkgver}"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dvm644 'README.rst' -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dvm644 'LICENSE' -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

Typical PKGBUILD for github projects

source: https://github.com/neovim/neovim/blob/master/BUILD.md

# Maintainer: VectorXYZ <resonyze@gmail.com>
pkgname=nvim-vector
# pkgver is found in CMakeLists.txt NVIM_VERSION_MAJOR, NVIM_VERSION_MINOR ..
pkgver=0.11.0_dev
pkgrel=1
pkgdesc="Neovim"
arch=(any)
url="https://github.com/neovim/neovim"
license=('MIT')
# depends = 
conflicts=('neovim')
makedepends=('git' 'base-devel' 'cmake' 'unzip' 'ninja' 'curl')
# source=("${pkgname}"::"git+https://github.com/neovim/neovim")
source=("${pkgname}.zip"::"https://github.com/neovim/neovim/archive/refs/heads/master.zip")
sha256sums=('SKIP')

build() {
  cd "$srcdir/neovim-master"
  make CMAKE_BUILD_TYPE=Release
}

package() {
  cd "$srcdir/neovim-master"
  make CMAKE_INSTALL_PREFIX=$pkgdir/usr install
}

PKGBUILD if your workplace has crappy internet

I) Replace git source with zip source

# source=("${pkgname}"::"git+https://github.com/neovim/neovim")
source=("${pkgname}.zip"::"https://github.com/neovim/neovim/archive/refs/heads/master.zip")

II) Configure makepkg to use aria2c

source: https://wiki.archlinux.org/title/Aria2#Using_aria2_with_makepkg

#########################################################################
# SOURCE ACQUISITION
#########################################################################
#
#-- The download utilities that makepkg should use to acquire sources
#  Format: 'protocol::agent'
# DLAGENTS=('file::/usr/bin/curl -qgC - -o %o %u'
#           'ftp::/usr/bin/curl -qgfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
#           'http::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
#           'https::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
#           'rsync::/usr/bin/rsync --no-motd -z %u %o'
#           'scp::/usr/bin/scp -C %u %o')

DLAGENTS=('ftp::/usr/bin/aria2c -UWget -s10 -x10 %u -o %o --follow-metalink=mem'
          'http::/usr/bin/aria2c -UWget -s10 -x10 %u -o %o --follow-metalink=mem'
          'https::/usr/bin/aria2c -UWget -s10 -x10 %u -o %o --follow-metalink=mem'
          'rsync::/usr/bin/rsync --no-motd -z %u %o'
          'scp::/usr/bin/scp -C %u %o')


Comments