#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=jwm
pkgver=2.4.3
pkgrel=01
pkgdesc="A lightweight window manager for the X11 Window System"
arch=(x86_64)
url="https://github.com/joewing/jwm"
#url="https://joewing.net/projects/jwm"
#$pkgname::git+https://github.com/joewing/jwm.git
groups=(joborun-pkg-x11)
provides=('jwm')
depends=('libx11' 'libxft' 'libjpeg-turbo' 'libxpm' 'libxinerama' 'libpng' 'cairo' 'librsvg')
backup=('etc/system.jwmrc')
#https://github.com/joewing/jwm/releases/download/v$pkgver/jwm-$pkgver.tar.xz
source=("${url}/releases/download/v$pkgver/$pkgname-$pkgver.tar.xz"
		jwm.desktop)


prepare() {
# this is an Obarun patch - don't waste time building without it - it crashes out after 10" amd throws you back to tty
    cd "$srcdir/$pkgname-$pkgver"
    sed -i 's|/usr/local/share/|/usr/share/|' contrib/Makefile po/Makefile* example.jwmrc
    # locales were broken in 2.4.0
    sed -i 's|mkdir_p = @mkdir_p@|mkdir_p = /usr/bin/mkdir -p --|' po/Makefile*
}

build() {
  cd $pkgname-$pkgver
  ./configure	--prefix=/usr \
				--sysconfdir=/etc \
				--disable-fribidi 
  make
}


package() {
  cd $pkgname-$pkgver
  make BINDIR="$pkgdir/usr/bin" MANDIR="$pkgdir/usr/share/man" \
       DESTDIR="$pkgdir" SYSCONF="$pkgdir/etc" install
  install -Dm644 "$srcdir/jwm.desktop" "$pkgdir/usr/share/xsessions/jwm.desktop"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

#---- license gpg-key sha256sums ----

license=('MIT')

sha256sums=(ee3b4ee0c452ef31fcb9303ab50aaf496cf5bdf7b5f1fdc9a1251b7175ca67ab  # jwm-2.4.3.tar.xz
	489327c12bb44c6802144f972411dab7a44a61920c07028fa3d81cfd0ba9fd30) # jwm.desktop
 
 
 
