From 191fd5ffb2646811e27e1f6e1228068faacdd10c Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sun, 7 Mar 2021 11:48:45 +0100 Subject: [PATCH] New package: rundird-0.1.1 --- common/build-style/zig.sh | 30 ++++++++++++++++++++++++++++++ srcpkgs/rundird/files/rundird/run | 2 ++ srcpkgs/rundird/template | 17 +++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 common/build-style/zig.sh create mode 100644 srcpkgs/rundird/files/rundird/run create mode 100644 srcpkgs/rundird/template diff --git a/common/build-style/zig.sh b/common/build-style/zig.sh new file mode 100644 index 000000000000..49d7aea742b4 --- /dev/null +++ b/common/build-style/zig.sh @@ -0,0 +1,30 @@ +do_build() { + local zig_target + local zig_cpu + case $XBPS_TARGET_MACHINE in + aarch64-musl|i686-musl|x86_64-musl) + zig_target="${XBPS_TARGET_MACHINE%-musl}-linux-musl" zig_cpu="generic";; + aarch64|i686|x86_64) + zig_target="${XBPS_TARGET_MACHINE}-linux-gnu" zig_cpu="generic";; + armv6l-musl) zig_target="arm-linux-musl" zig_cpu="generic+v6";; + armv6l) zig_target="arm-linux-gnu" zig_cpu="generic+v6";; + armv7l-musl) zig_target="arm-linux-musl" zig_cpu="generic+v7a";; + armv7l) zig_target="arm-linux-gnu" zig_cpu="generic+v7a";; + *) broken="TODO: support more target machines for the zig build style";; + esac + + # The Zig build system only has a single install step, there is no + # way to build artifacts for a given prefix and then install those artifacts + # to that prefix at some later time. Therefore, we build and install to the zig-out + # directory and later copy the artifacts to the destdir in do_install(). + # We use zig-out to avoid path conflicts as it is the default install + # prefix used by the zig build system. + DESTDIR="zig-out" zig build \ + --search-prefix $XBPS_CROSS_BASE \ + -Dtarget=$zig_target -Dcpu=$zig_cpu \ + -Drelease-safe --prefix /usr install +} + +do_install() { + cp -r zig-out/* "${DESTDIR}" +} diff --git a/srcpkgs/rundird/files/rundird/run b/srcpkgs/rundird/files/rundird/run new file mode 100644 index 000000000000..df06fdb0fc88 --- /dev/null +++ b/srcpkgs/rundird/files/rundird/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/rundird diff --git a/srcpkgs/rundird/template b/srcpkgs/rundird/template new file mode 100644 index 000000000000..5c7ab5408adf --- /dev/null +++ b/srcpkgs/rundird/template @@ -0,0 +1,17 @@ +# Template file for 'rundird' +pkgname=rundird +version=0.1.1 +revision=1 +build_style=zig +hostmakedepends="zig" +makedepends="pam-devel" +short_desc="Simple daemon + PAM module providing an XDG_RUNTIME_DIR" +maintainer="Isaac Freund " +license="GPL-3.0-or-later" +homepage="https://github.com/ifreund/rundird" +distfiles="${homepage}/archive/v${version}.tar.gz" +checksum=d3a848fba0016841385aab57298164ba8f30377799c217b6b6abf83ce1d2ca91 + +post_install() { + vsv rundird +}