Skip to content

Instantly share code, notes, and snippets.

@Ashark
Last active January 5, 2018 05:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ashark/9e35f0a6dc1fd8a0e7f114cd60dbf0c5 to your computer and use it in GitHub Desktop.
Save Ashark/9e35f0a6dc1fd8a0e7f114cd60dbf0c5 to your computer and use it in GitHub Desktop.
xneur-git package build script for ArchLinux (needs review before publish in AUR)
# Maintainer: Andrew Shark <ashark@linuxcomp.ru>
pkgname=xneur-git
pkgver=0.20.0.r155.75ebdcc
pkgrel=1
pkgdesc="Automatic Keyboard Layout Switcher like Punto Switcher"
arch=('x86_64')
url="https://xneur.ru/"
license=('GPL')
depends=()
makedepends=('git' 'gcc' 'make' 'cmake')
optdepends=()
provides=('xneur')
conflicts=('xneur')
source=( #'git+https://github.com/AndrewCrewKuznetsov/xneur-devel' # Choose only one of these sources
#'git+https://github.com/Ashark/xneur-devel' # I use it when developing
)
sha1sums=( #'SKIP'
)
pkgver() {
cd xneur-devel
xnrelver=`cat xneur/CMakeLists.txt | grep "xneur VERSION" | cut -f3 -d ' ' | tr -d ")"`
printf "$xnrelver.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
# set amake or cmake here
build_system=amake
prepare() {
mkdir -p ${srcdir}/xneur-devel/xneur/build
cd ${srcdir}/xneur-devel/xneur # I use it when developing
git checkout transition-to-cmake # I use it when developing
}
build() {
if [[ $build_system == cmake ]]; then
# clear cache. I use for debugging while developing
if [ -d "${srcdir}/xneur-devel/xneur/build/" ]; then
: # if statement should contain at least something (empty op).
rm -r ${srcdir}/xneur-devel/xneur/build/* # Comment if do not want to clear cache
fi
cd ${srcdir}/xneur-devel/xneur/build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make
elif [[ $build_system == amake ]]; then
cd ${srcdir}/xneur-devel/xneur
./autogen.sh --prefix=/usr --sysconfdir=/etc # autogen.sh creates configure file and runs it with parameters
make
fi
}
package() {
if [[ $build_system == cmake ]]; then
cd ${srcdir}/xneur-devel/xneur/build
make DESTDIR=${pkgdir} install
elif [[ $build_system == amake ]]; then
cd ${srcdir}/xneur-devel/xneur
make DESTDIR=${pkgdir} install
make clean # removing am build-time stuff from sources
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment