Skip to content

Commit

Permalink
Merge pull request YosysHQ#134 from FFY00/arch-pkgs
Browse files Browse the repository at this point in the history
github: build archlinux package
  • Loading branch information
gatecat committed Apr 22, 2020
2 parents 3159695 + 2b932b3 commit d476073
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/archlinux/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>

_prj=trellis
_pkgname=prj$_prj
pkgname=$_pkgname-git
_commit=%COMMIT%
pkgver=dummy
pkgrel=1
pkgdesc='Documentation and definitions for the Lattice ECP5 bit-stream format'
arch=('x86_64')
url='https://github.com/SymbiFlow/prjtrellis'
license=('custom:ISC' 'MIT')
depends=('boost-libs' "$_pkgname-db")
makedepends=('git' 'cmake' 'boost' 'python-sphinx' 'python-sphinx_rtd_theme' 'python-recommonmark')
optdepends=('python: Python support')
provides=("$_pkgname")
conflicts=("$_pkgname")
source=("git+$url.git#commit=$_commit")
sha512sums=('SKIP')

pkgver() {
cd $_pkgname

printf "%s.r%s.%s" \
$(git tag | tail -n1) \
$(git rev-list --count HEAD) \
$(git rev-parse --short HEAD)
}

build() {
mkdir $_pkgname/libtrellis/build
cd $_pkgname/libtrellis/build

cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=/usr/lib \
-DCMAKE_BUILD_TYPE=Release

make

# cd ../../docs
#
# make html
}

package() {
cd $_pkgname

# install -dm 755 "$pkgdir"/usr/share/doc/$pkgname
# cp -r --no-preserve=ownership docs/_build/* "$pkgdir"/usr/share/doc/$pkgname/

install -Dm 644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/LICENSE

cd libtrellis/build

make DESTDIR="$pkgdir" install

# The database is provided in a separate package
rmdir "$pkgdir"/usr/share/$_prj/database
}

19 changes: 19 additions & 0 deletions .github/workflows/arch-pkg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: arch-pkg
on: [push, pull_request]

jobs:
arch-pkg:
runs-on: ubuntu-latest
container:
image: archlinux
options: --privileged
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup
steps:
- uses: actions/checkout@v2
- name: Build Arch Linux package
uses: FFY00/build-arch-package@master
with:
PKGBUILD: $GITHUB_WORKSPACE/.github/archlinux/PKGBUILD


0 comments on commit d476073

Please sign in to comment.