From 7469f463da761ab0e20d4a4eabdca4bd4f86f7ef Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Thu, 9 Oct 2025 16:03:45 +0200 Subject: [PATCH] sofia_sip: Modernise - rec -> finalAttrs - src.sha256 -> src.hash - drop meta-wide "with lib" - correct license to LGPL 2.1+ - use patch url with full indices, known issue with fetchpatch2 - add pkg-config information + test - add passthru.updateScript --- pkgs/by-name/so/sofia_sip/package.nix | 34 ++++++++++++++++++++------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/so/sofia_sip/package.nix b/pkgs/by-name/so/sofia_sip/package.nix index 3b9229c8af57..98b4dc63220a 100644 --- a/pkgs/by-name/so/sofia_sip/package.nix +++ b/pkgs/by-name/so/sofia_sip/package.nix @@ -3,6 +3,8 @@ stdenv, fetchFromGitHub, fetchpatch2, + gitUpdater, + testers, autoconf, automake, check, @@ -14,23 +16,23 @@ zlib, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "sofia-sip"; version = "1.13.17"; src = fetchFromGitHub { owner = "freeswitch"; repo = "sofia-sip"; - rev = "v${version}"; - sha256 = "sha256-7QmK2UxEO5lC0KBDWB3bwKTy0Nc7WrdTLjoQYzezoaY="; + rev = "v${finalAttrs.version}"; + hash = "sha256-7QmK2UxEO5lC0KBDWB3bwKTy0Nc7WrdTLjoQYzezoaY="; }; patches = [ # Fix build with gcc 14 from https://github.com/freeswitch/sofia-sip/pull/249 (fetchpatch2 { name = "sofia-sip-fix-incompatible-pointer-type.patch"; - url = "https://github.com/freeswitch/sofia-sip/commit/46b02f0655af0a9594e805f09a8ee99278f84777.diff"; - hash = "sha256-4uZVtKnXG+BPW8byjd7tu4uEZo9SYq9EzTEvMwG0Bak="; + url = "https://github.com/freeswitch/sofia-sip/commit/46b02f0655af0a9594e805f09a8ee99278f84777.patch?full_index=1"; + hash = "sha256-bZzjg7GBxR2wSlPH81krZRCK43OirGLWH/lrLRZ0L0k="; }) # Disable some failing tests @@ -85,11 +87,25 @@ stdenv.mkDerivation rec { doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; - meta = with lib; { + passthru = { + tests.pkg-config = testers.hasPkgConfigModules { + package = finalAttrs.finalPackage; + versionCheck = true; + }; + updateScript = gitUpdater { + rev-prefix = "v"; + }; + }; + + meta = { description = "Open-source SIP User-Agent library, compliant with the IETF RFC3261 specification"; homepage = "https://github.com/freeswitch/sofia-sip"; - platforms = platforms.unix; - license = licenses.lgpl2; + platforms = lib.platforms.unix; + license = lib.licenses.lgpl2Plus; teams = [ lib.teams.ngi ]; + pkgConfigModules = [ + "sofia-sip-ua" + "sofia-sip-ua-glib" + ]; }; -} +})