# Template file for 'debug-me'
pkgname=debug-me
version=1.20221231
revision=1
build_style=cabal
cabal_index_state=2025-07-05T11:40:57Z
makedepends="zlib-devel"
short_desc="Secure remote debugging"
maintainer="Orphaned <orphan@voidlinux.org>"
license="AGPL-3.0-or-later"
homepage="https://debug-me.branchable.com/"
distfiles="https://git.joeyh.name/index.cgi/${pkgname}.git/snapshot/${pkgname}-${version}.tar.gz
 https://hackage.haskell.org/package/basement-0.0.16/basement-0.0.16.tar.gz
 https://hackage.haskell.org/package/memory-0.18.0/memory-0.18.0.tar.gz
 https://hackage.haskell.org/package/cborg-0.2.10.0/cborg-0.2.10.0.tar.gz"
checksum="c16b63a99d9cb177f28318e4598debaf974eda791da37fc66e13780959356373
 7fb77e249aef76ba5aed3059d556800ce02b614597c488ba01f0a16449146300
 fd4eb6f638e24b81b4e6cdd68772a531726f2f67686c8969d3407d82f7862e3e
 17fe070c38fc498cab49bcb9d6215b7747d53bedf96502e9bcce9cad73b9c797"
nocross=yes # Can't yet cross compile Haskell
nopie_files="/usr/bin/debug-me"
skip_extraction="basement-0.0.16.tar.gz memory-0.18.0.tar.gz cborg-0.2.10.0.tar.gz"

post_extract() {
	vsrcextract -C basement basement-0.0.16.tar.gz
	vsrcextract -C memory memory-0.18.0.tar.gz
	vsrcextract -C cborg cborg-0.2.10.0.tar.gz
}

post_configure() {
	# Fix build on i686 by using patched basement, memory and cborg packages
	echo 'packages: ./basement ./memory ./cborg' >> cabal.project.local

	# Fix build on musl by pretending to be glibc,
	# otherwise it thinks we're freebsd
	echo 'package posix-pty' >> cabal.project.local
	echo '  ghc-options: -optc=-D__GLIBC__' >> cabal.project.local
}

post_install() {
	vman debug-me.1
	vlicense AGPL
}
