From 38e8772c1422ce84a56d03ac3e509faea4438c91 Mon Sep 17 00:00:00 2001 From: Senwen Deng Date: Sat, 4 Mar 2023 23:06:11 +0100 Subject: [PATCH] New package: singularity-3.11.0 --- srcpkgs/singularity/INSTALL | 10 ++++++ srcpkgs/singularity/template | 67 ++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 srcpkgs/singularity/INSTALL create mode 100644 srcpkgs/singularity/template diff --git a/srcpkgs/singularity/INSTALL b/srcpkgs/singularity/INSTALL new file mode 100644 index 000000000000..77fe1c22bdcd --- /dev/null +++ b/srcpkgs/singularity/INSTALL @@ -0,0 +1,10 @@ +case "${ACTION}" in +post) + if [ "$(readlink -f . 2>/dev/null || echo .)" != "/" ]; then + exit 1 + else + chown root:_singularity usr/libexec/singularity/bin/starter-suid + chmod 4755 usr/libexec/singularity/bin/starter-suid + fi + ;; +esac diff --git a/srcpkgs/singularity/template b/srcpkgs/singularity/template new file mode 100644 index 000000000000..8847fb174e64 --- /dev/null +++ b/srcpkgs/singularity/template @@ -0,0 +1,67 @@ +# Template file for 'singularity' +pkgname=singularity +version=3.11.0 +revision=1 +build_style=configure +configure_script=./mconfig +configure_args="--prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --libexecdir=/usr/libexec \ + --sysconfdir=/etc \ + --sharedstatedir=/var/lib \ + --mandir=/usr/share/man \ + --localstatedir=/var/lib \ + --without-conmon" +make_dirs="/var/lib/singularity/mnt/session 755 root root" +hostmakedepends="wget pkg-config go cryptsetup" +# makedepends="libseccomp-devel glib-devel squashfs-tools runc" +makedepends="libseccomp-devel squashfs-tools runc" +depends="squashfs-tools cryptsetup conmon" +short_desc="HPC centric container platform" +maintainer="Senwen Deng " +license="BSD-3-Clause-LBNL" +homepage="https://sylabs.io/singularity/" +distfiles="https://github.com/sylabs/${pkgname}/releases/download/v${version}/${pkgname}-ce-${version}.tar.gz" +checksum=45c297f05065c7c920898af37acb781070b2330f141d7a566073197801577753 + +do_configure() { + if ! [[ -z ${CROSS_BUILD} ]]; then + vsed -i \ + -e '/feature: NO_NEW_PRIVS/,/feature: MS_SLAVE/{//!d}' \ + ./mlocal/checks/project-post.chk + GOOS=linux GOARCH=$(go env | grep GOHOSTARCH | sed "s/GOHOSTARCH=//" | tr -d '"') ${configure_script} ${configure_args} -C ${XBPS_CROSS_TRIPLET}-gcc -X ${XBPS_CROSS_TRIPLET}-c++ + else + ${configure_script} ${configure_args} + fi +} + +post_configure() { + # Fixup Makefile + # * Force use of vendored packages + # * Don't install bash completions into /etc/bash_completion.d + vsed -i \ + -e 's@^GO_MODFLAGS := .*@GO_MODFLAGS := -mod=vendor@' \ + -e 's@INSTALLFILES += $(bash_completion_INSTALL)@@' \ + builddir/Makefile +} + +do_build() { + if ! [[ -z ${CROSS_BUILD} ]]; then + GOOS=linux GOARCH=amd64 srcdir=$PWD make -C builddir old_config= + fi + srcdir=$PWD make -C builddir old_config= +} + +do_install() { + make DESTDIR="${DESTDIR}" -C builddir install all + chmod 0750 $DESTDIR/usr/libexec/singularity/bin/starter-suid + vlicense LICENSE.md + vcompletion builddir/etc/bash_completion.d/singularity bash +} + +do_check() { + # XXX: tests require sudo, so skip for now. + # make -C builddir unit-test integration-test e2e-test + : "Pass" +}