|
| 1 | +#!/usr/bin/bash |
| 2 | +# |
| 3 | +# {{{ CDDL HEADER |
| 4 | +# |
| 5 | +# This file and its contents are supplied under the terms of the |
| 6 | +# Common Development and Distribution License ("CDDL"), version 1.0. |
| 7 | +# You may only use this file in accordance with the terms of version |
| 8 | +# 1.0 of the CDDL. |
| 9 | +# |
| 10 | +# A full copy of the text of the CDDL should have accompanied this |
| 11 | +# source. A copy of the CDDL is also available via the Internet at |
| 12 | +# http://www.illumos.org/license/CDDL. |
| 13 | +# }}} |
| 14 | + |
| 15 | +# Copyright 2024 OmniOS Community Edition (OmniOSce) Association. |
| 16 | + |
| 17 | +. ../../lib/build.sh |
| 18 | + |
| 19 | +PROG=swtpm |
| 20 | +VER=0.10.0 |
| 21 | +PKG=ooce/security/swtpm |
| 22 | +SUMMARY="SWTPM - Software TPM Emulator" |
| 23 | +DESC="TPM emulators with different front-end interfaces to libtpms" |
| 24 | + |
| 25 | +JSONGLIBVER=1.9.2 |
| 26 | + |
| 27 | +OPREFIX=$PREFIX |
| 28 | +PREFIX+="/$PROG" |
| 29 | + |
| 30 | +set_arch 64 |
| 31 | +set_clangver |
| 32 | +set_standard XPG6 |
| 33 | + |
| 34 | +XFORM_ARGS=" |
| 35 | + -DPREFIX=${PREFIX#/} |
| 36 | + -DOPREFIX=${OPREFIX#/} |
| 37 | + -DPROG=$PROG |
| 38 | + -DPKGROOT=$PROG |
| 39 | +" |
| 40 | + |
| 41 | +init |
| 42 | +prep_build |
| 43 | + |
| 44 | +######################################################################### |
| 45 | +# Download and build static versions of dependencies |
| 46 | + |
| 47 | +pre_configure() { |
| 48 | + typeset arch=$1 |
| 49 | + |
| 50 | + ! cross_arch $arch && return |
| 51 | + |
| 52 | + CONFIGURE_CMD+=" --cross-file $SRCDIR/files/aarch64-gcc.txt" |
| 53 | +} |
| 54 | + |
| 55 | +save_buildenv |
| 56 | + |
| 57 | +CONFIGURE_OPTS="-Ddefault_library=static" |
| 58 | +CONFIGURE_OPTS[aarch64]=" |
| 59 | + --prefix=$PREFIX |
| 60 | + --libdir=$PREFIX/${LIBDIRS[aarch64]} |
| 61 | +" |
| 62 | + |
| 63 | +build_dependency -meson json-glib json-glib-$JSONGLIBVER \ |
| 64 | + $PROG/json-glib json-glib $JSONGLIBVER |
| 65 | + |
| 66 | +restore_buildenv |
| 67 | + |
| 68 | +######################################################################### |
| 69 | + |
| 70 | +note -n "-- Building $PROG" |
| 71 | + |
| 72 | +CONFIGURE_OPTS=" |
| 73 | + --localstatedir=/var$PREFIX |
| 74 | + --disable-static |
| 75 | + --with-tss-user=root |
| 76 | + --with-tss-group=root |
| 77 | +" |
| 78 | + |
| 79 | +pre_configure() { |
| 80 | + typeset arch=$1 |
| 81 | + |
| 82 | + subsume_arch $arch PKG_CONFIG_PATH |
| 83 | + addpath PKG_CONFIG_PATH $DEPROOT$PREFIX/${LIBDIRS[$arch]}/pkgconfig |
| 84 | + |
| 85 | + CPPFLAGS+=" -DHAVE_SYS_IOCCOM_H -I$DEPROOT$PREFIX/include/json-glib-1.0" |
| 86 | + LDFLAGS[$arch]+=" -L$DEPROOT$PREFIX/${LIBDIRS[$arch]} -lsocket" |
| 87 | + LDFLAGS[$arch]+=" -Wl,-R$OPREFIX/${LIBDIRS[$arch]}" |
| 88 | + LDFLAGS[$arch]+=" -Wl,-R$PREFIX/${LIBDIRS[$arch]}/$PROG" |
| 89 | + |
| 90 | + run_autoreconf -fi |
| 91 | +} |
| 92 | + |
| 93 | +download_source $PROG v$VER |
| 94 | +patch_source |
| 95 | +build |
| 96 | +make_package |
| 97 | +clean_up |
| 98 | + |
| 99 | +# Vim hints |
| 100 | +# vim:ts=4:sw=4:et:fdm=marker |
0 commit comments