swtpm: 0.10.1 -> 0.10.1-unstable-2026-05-21 (#524592)

This commit is contained in:
Arthur Gautier 2026-05-29 22:53:17 +00:00 committed by GitHub
commit 278d6500cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 48 deletions

View file

@ -10,17 +10,15 @@
stdenv.mkDerivation (finalAttrs: {
pname = "libtpms";
version = "0.10.2";
version = "0.10.2-unstable-2026-05-06";
src = fetchFromGitHub {
owner = "stefanberger";
repo = "libtpms";
rev = "v${finalAttrs.version}";
sha256 = "sha256-UhEpq5f/FT5DmtzQBe/Si414mOq+D4glikgRNK60GKQ=";
rev = "521c51073fe6f7c56023db78e56961fcaf7906e8";
hash = "sha256-wCipOOr3LnLq1NqDtxw6hq0VTyniDwp18vBxyET/WGM=";
};
hardeningDisable = [ "strictflexarrays3" ];
nativeBuildInputs = [
autoreconfHook
pkg-config

View file

@ -7,7 +7,7 @@
pkg-config,
libtasn1,
openssl,
fuse,
fuse3,
glib,
libseccomp,
json-glib,
@ -15,6 +15,7 @@
unixtools,
expect,
socat,
gmp,
gnutls,
perl,
makeWrapper,
@ -27,23 +28,15 @@
stdenv.mkDerivation (finalAttrs: {
pname = "swtpm";
version = "0.10.1";
version = "0.10.1-unstable-2026-05-21"; # fuse3 support, switch to openssl
src = fetchFromGitHub {
owner = "stefanberger";
repo = "swtpm";
rev = "v${finalAttrs.version}";
hash = "sha256-N79vuI0FhawLyQtwVF6ABIvCmEaYefq/YkyrafUfUHE=";
rev = "89a67f3d4070887a1ab86ca641f8da13529c54b7";
hash = "sha256-ebVfzKloJGmiaguxtcPC/MUuOQYzxIZDdi/0oEGXJ64=";
};
patches = [
(fetchpatch {
name = "retry-nwwrite.patch";
url = "https://github.com/stefanberger/swtpm/commit/4da66c66f92438443e66b67555673c9cb898b0ae.patch";
hash = "sha256-TTS+ViN4g6EfNLrhvGPobcSQEbr/mEl9ZLZTWdxbifs=";
})
];
nativeBuildInputs = [
pkg-config
unixtools.netstat
@ -65,15 +58,17 @@ stdenv.mkDerivation (finalAttrs: {
libtasn1
glib
json-glib
gmp
gnutls
]
++ lib.optionals stdenv.hostPlatform.isLinux [
fuse
fuse3
libseccomp
];
configureFlags = [
"--localstatedir=/var"
"--with-gnutls"
]
++ lib.optionals stdenv.hostPlatform.isLinux [
"--with-cuse"
@ -87,39 +82,14 @@ stdenv.mkDerivation (finalAttrs: {
# Makefile tries to create the directory /var/lib/swtpm-localca, which fails
substituteInPlace samples/Makefile.am \
--replace 'install-data-local:' 'do-not-execute:'
--replace-fail 'install-data-local:' 'do-not-execute:'
# Use the correct path to the certtool binary
# Use the correct path to the openssl binary
# instead of relying on it being in the environment
substituteInPlace src/swtpm_localca/swtpm_localca.c \
--replace \
'# define CERTTOOL_NAME "gnutls-certtool"' \
'# define CERTTOOL_NAME "${gnutls}/bin/certtool"' \
--replace \
'# define CERTTOOL_NAME "certtool"' \
'# define CERTTOOL_NAME "${gnutls}/bin/certtool"'
substituteInPlace tests/common --replace \
'CERTTOOL=gnutls-certtool;;' \
'CERTTOOL=certtool;;'
# Fix error on macOS:
# stat: invalid option -- '%'
# This is caused by the stat program not being the BSD version,
# as is expected by the test
substituteInPlace tests/common tests/sed-inplace --replace \
'if [[ "$(uname -s)" =~ (Linux|CYGWIN_NT-) ]]; then' \
'if [[ "$(uname -s)" =~ (Linux|Darwin|CYGWIN_NT-) ]]; then'
# Otherwise certtool seems to pick up the system language on macOS,
# which might cause a test to fail
substituteInPlace tests/test_swtpm_setup_create_cert --replace \
'$CERTTOOL' \
'LC_ALL=C.UTF-8 $CERTTOOL'
substituteInPlace tests/test_tpm2_swtpm_cert --replace \
'certtool' \
'LC_ALL=C.UTF-8 certtool'
--replace-fail \
'#define OPENSSL_TOOL "openssl"' \
'#define OPENSSL_TOOL "${lib.getExe openssl}"'
'';
# Workaround for https://github.com/stefanberger/swtpm/issues/795
@ -129,6 +99,7 @@ stdenv.mkDerivation (finalAttrs: {
'';
doCheck = true;
__darwinAllowLocalNetworking = true; # tests do socket things, requires local networking to pass
enableParallelBuilding = true;
outputs = [