Package Details: slock-git 1.5.r6.ga34d8fb-1

Git Clone URL: https://aur.archlinux.org/slock-git.git (read-only, click to copy)
Package Base: slock-git
Description: Simple X display locker
Upstream URL: http://tools.suckless.org/slock
Licenses: MIT
Conflicts: slock
Provides: slock
Submitter: vesath
Maintainer: Farzat
Last Packager: Farzat
Votes: 23
Popularity: 0.24
First Submitted: 2012-12-02 07:22 (UTC)
Last Updated: 2024-02-02 11:50 (UTC)

Dependencies (3)

Required by (3)

Sources (1)

Latest Comments

Farzat commented on 2024-01-10 03:52 (UTC) (edited on 2024-01-10 03:54 (UTC) by Farzat)


# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: A Farzat <a@farzat.xyz>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: T.J. Townsend <blakkheim@archlinux.org>
# Contributor: Sebastian A. Liem <sebastian at liem dot se>

pkgname=slock-git
_pkgname=slock
pkgver=1.5.r6.ga34d8fb
pkgrel=1
pkgdesc='Simple X display locker'
url='http://tools.suckless.org/slock'
arch=('i686' 'x86_64' 'armv7h')
license=('MIT')
makedepends=('git')
depends=('libxext' 'libxrandr')
source=('git://git.suckless.org/slock')
sha256sums=('SKIP')

provides=("${_pkgname}")
conflicts=("${_pkgname}")

pkgver() {
  cd "$_pkgname"
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  echo "Applying patches from $BUILDDIR if they exist..."
  if [ -d "$BUILDDIR/patches" ]; then
  for patch in "$BUILDDIR/patches"/*.diff; do
  echo "Applying $patch ..."
  patch -d "$_pkgname" -p1 -s -i "$patch"
  done;
  fi;

  # This package provides a mechanism to provide a custom config.h. Multiple
  # configuration states are determined by the presence of two files in
  # $BUILDDIR:
  #
  # config.h  config.def.h  state
  # ========  ============  =====
  # absent    absent        Initial state. The user receives a message on how
  #                         to configure this package.
  # absent    present       The user was previously made aware of the
  #                         configuration options and has not made any
  #                         configuration changes. The package is built using
  #                         default values.
  # present                 The user has supplied his or her configuration. The
  #                         file will be copied to $srcdir and used during
  #                         build.
  #
  # After this test, config.def.h is copied from $srcdir to $BUILDDIR to
  # provide an up to date template for the user.
  if [ -e "$BUILDDIR/config.h" ]
  then
    cp "$BUILDDIR/config.h" "$_pkgname"
  elif [ ! -e "$BUILDDIR/config.def.h" ]
  then
    msg='This package can be configured in config.h. Copy the config.def.h '
    msg+='that was just placed into the package directory to config.h and '
    msg+='modify it to change the configuration. Or just leave it alone to '
    msg+='continue to use default values.'
    printf %s\\n "$msg"
  fi
  cd "$_pkgname"
  sed -i 's|static const char \*group = "nogroup";|static const char *group = "nobody";|' config.def.h
  sed -ri 's/((CPP|C|LD)FLAGS) =/\1 +=/g' config.mk
  cp config.def.h "$BUILDDIR"
}

build() {
  cd "$_pkgname"
  make X11INC=/usr/include/X11 X11LIB=/usr/lib/X11
}

package() {
  cd "$_pkgname"
  make PREFIX=/usr DESTDIR="$pkgdir" install
  install -m644 -D LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

fixes pkgver, makes it closer to the one in main repos, and allows custom config and patches.

vesath commented on 2017-05-09 06:51 (UTC)

What is there to fix?

n4nn31355 commented on 2017-05-09 06:29 (UTC)

Fix `pkgver` please

vesath commented on 2013-03-06 09:30 (UTC)

I have just merged slock-hg into this package; there was no point to keep a package that does not build around - thanks for letting me know. And to answer your question I'm happy to keep maintaining slock-git.

<deleted-account> commented on 2013-03-06 09:19 (UTC)

Hi, I made a request on the aur-general mailing list, see https://mailman.archlinux.org/pipermail/aur-general/2013-March/022346.html , to remove or merge every hg package for suckless projects, because suckless switched to git. Since your package doesn't build anymore, it should be merged with slock-git, created by vesath. You two should come to an agreement, who will continue maintaining slock-git after the merging. In that case I think it would be polite if vesath gets to do it, because he created slock-git. In case he's ok with you being the new maintainer, that's ok as well. If none of you two want to do it, I'll adopt it. Please leave a comment here or on the mailing list about your point of view on this. Thanks!