From a91c66717a4650ec9a2ad79f43c304d162a2322a Mon Sep 17 00:00:00 2001 From: Xiangyan Sun Date: Sun, 3 May 2026 12:48:05 -0700 Subject: [PATCH] otpw: fix build with gcc15 --- pkgs/by-name/ot/otpw/package.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ot/otpw/package.nix b/pkgs/by-name/ot/otpw/package.nix index 8814b6ffee54..7a81dd0bb3cf 100644 --- a/pkgs/by-name/ot/otpw/package.nix +++ b/pkgs/by-name/ot/otpw/package.nix @@ -2,6 +2,7 @@ lib, stdenv, coreutils, + fetchDebianPatch, fetchurl, libxcrypt, pam, @@ -20,7 +21,17 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-mKyjimHHcTZ3uW8kQmynBTSAwP0HfZGx6ZvJ+SzLgyo="; }; - patchPhase = '' + patches = [ + (fetchDebianPatch { + pname = "otpw"; + version = "1.5"; + debianRevision = "6"; + patch = "gcc15.patch"; + hash = "sha256-lR/FZannn9YVCTj+DWZvIyu99lmkaUxG48TGzckyolU="; + }) + ]; + + postPatch = '' sed -i 's/^CFLAGS.*/CFLAGS=-O2 -fPIC/' Makefile substituteInPlace otpw-gen.c \ --replace "head -c 20 /dev/urandom 2>&1" "${coreutils}/bin/head -c 20 /dev/urandom 2>&1" \