Skip to content

libtpms: new port, version 0.10.2 - #33884

Open
trodemaster wants to merge 1 commit into
macports:masterfrom
trodemaster:security/libtpms-new-port
Open

libtpms: new port, version 0.10.2#33884
trodemaster wants to merge 1 commit into
macports:masterfrom
trodemaster:security/libtpms-new-port

Conversation

@trodemaster

Copy link
Copy Markdown
Contributor

Description

New port: libtpms, a library for software emulation of a Trusted
Platform Module (TPM). It provides TPM 1.2 and TPM 2.0 functionality
for integrating TPM emulation into hypervisors, primarily QEMU, via
the swtpm software TPM emulator.

Tested on

macOS 26.6 25G70 arm64 / Command Line Tools 26.6.0.0.1781586589
macOS 27.0 26A5388g arm64 / Command Line Tools 27.0.0.0.1784267383

Verification

Have you

Comment thread security/libtpms/Portfile Outdated
Comment thread security/libtpms/Portfile
Comment thread security/libtpms/Portfile Outdated

@barracuda156 barracuda156 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P. S. If someone cares about this working on older macOS, pick fixes from macos-powerpc/powerpc-ports@2772b2b

P. S. Let me check if those flags are still relevant.
Upd. Flags that I had in my portfile to downgrade errors to warnings are NOT needed with 0.10.2.

P. P. S. The port was submitted earlier in #29634

Library for software emulation of a Trusted Platform Module (TPM).
libtpms provides TPM 1.2 and TPM 2.0 functionality for integrating
TPM emulation into hypervisors, primarily QEMU, via the swtpm
software TPM emulator.
@trodemaster
trodemaster force-pushed the security/libtpms-new-port branch from 9ed15cc to 994c65e Compare August 5, 2026 00:13
trodemaster added a commit to trodemaster/blakeports that referenced this pull request Aug 5, 2026
Matches the amended macports/macports-ports#33884 per barracuda156's
review comment.
@commitmaniac

commitmaniac commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@trodemaster Since MacPorts supports "older" platforms, there are more changes you should take into account given @barracuda156's suggetion. Tested on macOS 10.7.5 11G63 x86_64 Xcode 4.6.3 4H1503.

Essentially

  • Add the legacysupport PortGroup in order to link with MacPorts's clock_gettime on older systems, particularly on macOS 10.11 and older.
  • Limit which compiler is used when building. This is often done by setting a standard, but there are times in which this is not sufficient. clang < 700 do not build the project, so they need to be blacklisted.
diff --git a/security/libtpms/Portfile b/security/libtpms/Portfile
index 6b262e80225..2c07a72ebc9 100644
--- a/security/libtpms/Portfile
+++ b/security/libtpms/Portfile
@@ -3,6 +3,10 @@
 PortSystem          1.0
 PortGroup           github 1.0
 PortGroup           openssl 1.0
+PortGroup           legacysupport 1.1
+
+# clock_gettime
+legacysupport.newest_darwin_requires_legacy 15

 github.setup        stefanberger libtpms 0.10.2 v
 github.tarball_from archive
@@ -28,6 +32,12 @@ depends_build-append \

 use_autoreconf      yes

+# clang: error: unrecognized command line option "-fstack-protector-strong"
+# VerifyConfiguration.h:72: error: expected declaration specifiers or '...' before '(' token
+compiler.blacklist-append \
+                    *gcc-4.* {clang < 700}
+
 configure.args-append \
                     --with-openssl \
-                    --with-tpm2
+                    --with-tpm2 \
+                    --disable-silent-rules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants