From e759bfedc3576309bbac3ae3245746f02e87a304 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Fri, 10 May 2024 03:36:51 +0200 Subject: [PATCH 1/3] ustr: add sigmanificient to maintainers --- pkgs/development/libraries/ustr/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/ustr/default.nix b/pkgs/development/libraries/ustr/default.nix index 598e5e7c76a1..1d56bed8ec8b 100644 --- a/pkgs/development/libraries/ustr/default.nix +++ b/pkgs/development/libraries/ustr/default.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { description = "Micro String API for C language"; mainProgram = "ustr-import"; license = licenses.bsd2; - maintainers = [ ]; + maintainers = with lib.maintainers; [ sigmanificient ]; platforms = platforms.linux; }; } From 413c50ac7b5bd386b6685045b22f85a4f61f499a Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Fri, 10 May 2024 03:48:45 +0200 Subject: [PATCH 2/3] ustr: use fetchgit instead of fetchurl --- pkgs/development/libraries/ustr/default.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/ustr/default.nix b/pkgs/development/libraries/ustr/default.nix index 1d56bed8ec8b..69d74046d789 100644 --- a/pkgs/development/libraries/ustr/default.nix +++ b/pkgs/development/libraries/ustr/default.nix @@ -1,12 +1,13 @@ -{ lib, stdenv, fetchurl }: +{ lib, stdenv, fetchgit }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "ustr"; version = "1.0.4"; - src = fetchurl { - url = "http://www.and.org/ustr/${version}/${pname}-${version}.tar.bz2"; - sha256 = "1i623ygdj7rkizj7985q9d6vj5amwg686aqb5j3ixpkqkyp6xbrx"; + src = fetchgit { + url = "http://www.and.org/ustr/ustr.git"; + rev = "v${finalAttrs.version}"; + hash = "sha256-pQrQy+S9fVFl8Mop4QmwEAXGiBSheQE4HgAZ4srFz64="; }; # Fixes bogus warnings that failed libsemanage @@ -40,4 +41,4 @@ stdenv.mkDerivation rec { maintainers = with lib.maintainers; [ sigmanificient ]; platforms = platforms.linux; }; -} +}) From 31bfe498e711be77f17df7ab48646c80a7c70d4a Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Fri, 10 May 2024 04:05:39 +0200 Subject: [PATCH 3/3] ustr: migrate to by-name --- .../us/ustr/package.nix} | 24 ++++++++++++------- .../us}/ustr/va_args.patch | 0 pkgs/top-level/all-packages.nix | 2 -- 3 files changed, 16 insertions(+), 10 deletions(-) rename pkgs/{development/libraries/ustr/default.nix => by-name/us/ustr/package.nix} (69%) rename pkgs/{development/libraries => by-name/us}/ustr/va_args.patch (100%) diff --git a/pkgs/development/libraries/ustr/default.nix b/pkgs/by-name/us/ustr/package.nix similarity index 69% rename from pkgs/development/libraries/ustr/default.nix rename to pkgs/by-name/us/ustr/package.nix index 69d74046d789..0da93206752b 100644 --- a/pkgs/development/libraries/ustr/default.nix +++ b/pkgs/by-name/us/ustr/package.nix @@ -1,4 +1,8 @@ -{ lib, stdenv, fetchgit }: +{ + lib, + stdenv, + fetchgit, +}: stdenv.mkDerivation (finalAttrs: { pname = "ustr"; @@ -18,15 +22,19 @@ stdenv.mkDerivation (finalAttrs: { # Fix detection of stdint.h postPatch = '' - sed -i 's,\(have_stdint_h\)=0,\1=1,g' Makefile - sed -i 's,\(USTR_CONF_HAVE_STDINT_H\) 0,\1 1,g' ustr-import.in + substituteInPlace Makefile \ + --replace-fail "have_stdint_h=0" "have_stdint_h=1" + + cat ustr-import.in | grep USTR_CONF + substituteInPlace ustr-import.in \ + --replace-fail "USTR_CONF_HAVE_STDINT_H 0" "USTR_CONF_HAVE_STDINT_H 1" ''; - preBuild = '' - makeFlagsArray+=("prefix=$out") - makeFlagsArray+=("LDCONFIG=echo") - makeFlagsArray+=("HIDE=") - ''; + makeFlags = [ + "prefix=${placeholder "out"}" + "LDCONFIG=echo" + "HIDE=" + ]; # Remove debug libraries postInstall = '' diff --git a/pkgs/development/libraries/ustr/va_args.patch b/pkgs/by-name/us/ustr/va_args.patch similarity index 100% rename from pkgs/development/libraries/ustr/va_args.patch rename to pkgs/by-name/us/ustr/va_args.patch diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a38897c6125b..b9d42b592a6a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24804,8 +24804,6 @@ with pkgs; unixODBCDrivers = recurseIntoAttrs (callPackages ../development/libraries/unixODBCDrivers { }); - ustr = callPackage ../development/libraries/ustr { }; - usrsctp = callPackage ../development/libraries/usrsctp { }; usbredir = callPackage ../development/libraries/usbredir { };