Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arch Linux build, packaging, and install #125

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,21 @@ Dependencies:

python src/doc/regenerate_docstring.py

#### Arch Linux

On Arch Linux the Arch User Repository PKGBUILD can be used to build, package, and install:

```shell
cd packaging/aur
makepkg
sudo pacman -U libgaia2-<version>-<release>-<architecture>.pkg.tar.zst
```

To uninstall on Arch Linux:

```shell
sudo pacman -R libgaia2
```

### MacOS

Expand Down
19 changes: 19 additions & 0 deletions packaging/aur/.SRCINFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
pkgbase = libgaia2
pkgdesc = C++ library with python bindings which implements similarity measures and classifcations on the results of audio analysis, and generates classifcation models that Essentia can use to compute high-level description of music.
pkgver = v2.4.6r2
pkgrel = 1
url = https://github.com/doctorfree/gaia
arch = x86_64
arch = armv7h
license = AGPL3
makedepends = eigen
makedepends = git
makedepends = libyaml
makedepends = pkg-config
makedepends = python
makedepends = qt5-base
makedepends = swig
source = gaia::git+https://github.com/doctorfree/gaia.git
sha256sums = SKIP

pkgname = libgaia2
53 changes: 53 additions & 0 deletions packaging/aur/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Maintainer: Ronald Record <[email protected]>

pkgname=libgaia2
pkgver=v2.4.6r2
pkgrel=1
pkgdesc="C++ library with python bindings which implements similarity measures and classifcations on the results of audio analysis, and generates classifcation models that Essentia can use to compute high-level description of music."
arch=('x86_64' 'armv7h')
url="https://github.com/doctorfree/gaia"
license=('AGPL3')
makedepends=(eigen git libyaml pkg-config python qt5-base swig)
source=("${pkgname}::git+https://github.com/doctorfree/gaia.git#tag=${pkgver}")
sha256sums=('SKIP')

prepare() {
cd "${srcdir}/${pkgname}"
# Prior to configure, determine SSE2 support and set CXXFLAGS
grep sse2 /proc/cpuinfo > /dev/null || {
# Remove -msse2 from CXXFLAGS
cat wscript | sed -e "s/'-O2', '-msse2'/'-O2'/" > /tmp/wsc$$
cp /tmp/wsc$$ wscript
rm -f /tmp/wsc$$
}
}

build() {
cd "${srcdir}/${pkgname}"
# Build gaia
./waf configure --prefix=/usr --with-python-bindings --with-asserts
./waf
}

package() {
cd "${srcdir}/${pkgname}"
./waf install --destdir="${pkgdir}"

destdir=usr
[ -d ${pkgdir}/${destdir}/share ] || {
mkdir -p ${pkgdir}/${destdir}/share
}
[ -d ${pkgdir}/${destdir}/share/doc ] || {
mkdir -p ${pkgdir}/${destdir}/share/doc
}
[ -d ${pkgdir}/${destdir}/share/doc/${pkgname} ] || {
mkdir -p ${pkgdir}/${destdir}/share/doc/${pkgname}
}
cp AUTHORS ${pkgdir}/${destdir}/share/doc/${pkgname}
cp ChangeLog ${pkgdir}/${destdir}/share/doc/${pkgname}
cp COPYING.txt ${pkgdir}/${destdir}/share/doc/${pkgname}
cp README.md ${pkgdir}/${destdir}/share/doc/${pkgname}
cp VERSION ${pkgdir}/${destdir}/share/doc/${pkgname}
gzip -9 ${pkgdir}/${destdir}/share/doc/${pkgname}/ChangeLog
chmod 755 ${pkgdir}/${destdir}/bin/* ${pkgdir}/${destdir}/bin
}
22 changes: 22 additions & 0 deletions packaging/aur/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Arch Linux AUR packaging

This directory contains the packaging files for the Arch User Repository.
See https://wiki.archlinux.org/title/Arch_User_Repository

To build on Arch Linux, in this directory issue the command:

```shell
makepkg
```

After successfully building, to install:

```shell
sudo pacman -U libgaia2-<version>-<release>-<architecture>.pkg.tar.zst
```

To uninstall:

```shell
sudo pacman -R libgaia2
```
46 changes: 46 additions & 0 deletions packaging/aur/makepkg.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/hint/bash
#
#########################################################################
# GLOBAL PACKAGE OPTIONS
# These are default values for the options=() settings
#########################################################################
#
# Makepkg defaults: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug !lto)
# A negated option will do the opposite of the comments below.
#
#-- strip: Strip symbols from binaries/libraries
#-- docs: Save doc directories specified by DOC_DIRS
#-- libtool: Leave libtool (.la) files in packages
#-- staticlibs: Leave static library (.a) files in packages
#-- emptydirs: Leave empty directories in packages
#-- zipman: Compress manual (man and info) pages in MAN_DIRS with gzip
#-- purge: Remove files specified by PURGE_TARGETS
#-- debug: Add debugging flags as specified in DEBUG_* variables
#-- lto: Add compile flags for building with link time optimization
#
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug !lto)
#
#-- Compiler and Linker Flags
#CPPFLAGS=""
#CFLAGS="-march=native -O2 -pipe -fno-plt -fexceptions \
# -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
# -fstack-clash-protection -fcf-protection"
#CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
#########################################################################
# PACKAGE OUTPUT
#########################################################################
#
# Default: put built package and cached source in build directory
#
#-- Destination: specify a fixed directory where all packages will be placed
#PKGDEST=/home/doctorwhen/packages
#-- Source cache: specify a fixed directory where source files will be cached
#SRCDEST=/home/doctorwhen/sources
#-- Source packages: specify a fixed directory where all src packages will be placed
#SRCPKGDEST=/home/doctorwhen/srcpackages
#-- Log files: specify a fixed directory where all log files will be placed
#LOGDEST=/home/doctorwhen/makepkglogs
#-- Packager: name/email of the person or organization building packages
PACKAGER="Ronald Record <[email protected]>"
#-- Specify a key to use for package signing
#GPGKEY=""