Skip to content
Snippets Groups Projects
APKBUILD 1.30 KiB
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=dynamips
pkgver=0.2.23
pkgrel=1
pkgdesc="Cisco router emulator"
url="https://github.com/GNS3/dynamips"
# x86:
# common/ppc32_x86_trans.h:63:4: error: 'asm' operand has impossible constraints
#    63 |    asm volatile ("movl %0,%%edi"::"r"(cpu):
arch="all !x86"
license="GPL-2.0"
makedepends="cmake libpcap-dev elfutils-dev linux-headers libnsl-dev samurai"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/GNS3/dynamips/archive/v$pkgver.tar.gz
	add-loongarch64-support.patch
	"
options="!check" # no tests

prepare() {
	sed -e "s:^set ( DYNAMIPS_FLAGS:#&:" -i cmake/dependencies.cmake
	default_prepare
}

build() {
	if [ "$CARCH" = "x86_64" ]; then
		export DYNAMIPS_ARCH=amd64
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
b68af39cd66f10555d860437f55e63887aefdb5a949bacacf3a308cc0c4eaaab3bb9a496c5ac32fd19d3920bada807bff2af8eb66b01d8d735419fec5d134746  dynamips-0.2.23.tar.gz
b62d8c8dd91bd7d8614884ff93c66c0e9bec46ba97ae923742ded3aa8423a606db78201f1adf2c774445aca0052029dae70696338395bfc2f09b2bb755fb5d42  add-loongarch64-support.patch
"