From 1327403cbe97566c648e22879850a5ed631c5a01 Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 11 Jun 2024 20:37:01 -0400 Subject: [PATCH 1/6] libtheora: migrate to by-name --- .../li}/libtheora/mingw-remove-export.patch | 0 .../libtheora/default.nix => by-name/li/libtheora/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 3 files changed, 2 deletions(-) rename pkgs/{development/libraries => by-name/li}/libtheora/mingw-remove-export.patch (100%) rename pkgs/{development/libraries/libtheora/default.nix => by-name/li/libtheora/package.nix} (100%) diff --git a/pkgs/development/libraries/libtheora/mingw-remove-export.patch b/pkgs/by-name/li/libtheora/mingw-remove-export.patch similarity index 100% rename from pkgs/development/libraries/libtheora/mingw-remove-export.patch rename to pkgs/by-name/li/libtheora/mingw-remove-export.patch diff --git a/pkgs/development/libraries/libtheora/default.nix b/pkgs/by-name/li/libtheora/package.nix similarity index 100% rename from pkgs/development/libraries/libtheora/default.nix rename to pkgs/by-name/li/libtheora/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 235ca173d66e..1ff4f5f452dd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22442,8 +22442,6 @@ with pkgs; libthai = callPackage ../development/libraries/libthai { }; - libtheora = callPackage ../development/libraries/libtheora { }; - libthreadar = callPackage ../development/libraries/libthreadar { }; libticables2 = callPackage ../development/libraries/libticables2 { }; From a8a6cb7a0960ceb6599b1a09828402c1fc382336 Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 11 Jun 2024 20:37:17 -0400 Subject: [PATCH 2/6] libtheora: format with nixfmt --- pkgs/by-name/li/libtheora/package.nix | 31 +++++++++++++++++++++------ 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/li/libtheora/package.nix b/pkgs/by-name/li/libtheora/package.nix index d529c22c9f67..baf93bbb9f18 100644 --- a/pkgs/by-name/li/libtheora/package.nix +++ b/pkgs/by-name/li/libtheora/package.nix @@ -1,4 +1,13 @@ -{ lib, stdenv, fetchurl, libogg, libvorbis, pkg-config, autoreconfHook, fetchpatch }: +{ + lib, + stdenv, + fetchurl, + libogg, + libvorbis, + pkg-config, + autoreconfHook, + fetchpatch, +}: stdenv.mkDerivation rec { pname = "libtheora"; @@ -15,17 +24,25 @@ stdenv.mkDerivation rec { url = "https://github.com/xiph/theora/commit/28cc6dbd9b2a141df94f60993256a5fca368fa54.diff"; sha256 = "16jqrq4h1b3krj609vbpzd5845cvkbh3mwmjrcdg35m490p19x9k"; }) - ] ++ lib.optionals stdenv.hostPlatform.isMinGW [ - ./mingw-remove-export.patch - ]; + ] ++ lib.optionals stdenv.hostPlatform.isMinGW [ ./mingw-remove-export.patch ]; configureFlags = [ "--disable-examples" ]; - outputs = [ "out" "dev" "devdoc" ]; + outputs = [ + "out" + "dev" + "devdoc" + ]; outputDoc = "devdoc"; - nativeBuildInputs = [ pkg-config autoreconfHook ]; - propagatedBuildInputs = [ libogg libvorbis ]; + nativeBuildInputs = [ + pkg-config + autoreconfHook + ]; + propagatedBuildInputs = [ + libogg + libvorbis + ]; meta = with lib; { homepage = "https://www.theora.org/"; From b44d3ef41639ac3654207ea29fece05d9740f7bd Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 11 Jun 2024 20:40:05 -0400 Subject: [PATCH 3/6] libtheora: modernize --- pkgs/by-name/li/libtheora/package.nix | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/li/libtheora/package.nix b/pkgs/by-name/li/libtheora/package.nix index baf93bbb9f18..ff36e19605c5 100644 --- a/pkgs/by-name/li/libtheora/package.nix +++ b/pkgs/by-name/li/libtheora/package.nix @@ -2,11 +2,11 @@ lib, stdenv, fetchurl, + fetchpatch, + autoreconfHook, libogg, libvorbis, pkg-config, - autoreconfHook, - fetchpatch, }: stdenv.mkDerivation rec { @@ -14,15 +14,15 @@ stdenv.mkDerivation rec { version = "1.1.1"; src = fetchurl { - url = "https://downloads.xiph.org/releases/theora/${pname}-${version}.tar.gz"; - sha256 = "0swiaj8987n995rc7hw0asvpwhhzpjiws8kr3s6r44bqqib2k5a0"; + url = "https://downloads.xiph.org/releases/theora/libtheora-${version}.tar.gz"; + hash = "sha256-QJUpVsR4EZKNHnkizaO8H0J+t1aAw8NySckelJBUkWs="; }; patches = [ # fix error in autoconf scripts (fetchpatch { url = "https://github.com/xiph/theora/commit/28cc6dbd9b2a141df94f60993256a5fca368fa54.diff"; - sha256 = "16jqrq4h1b3krj609vbpzd5845cvkbh3mwmjrcdg35m490p19x9k"; + hash = "sha256-M/UULkiklvEay7LyOuCamxWCSvt37QSMzHOsAAnOWJo="; }) ] ++ lib.optionals stdenv.hostPlatform.isMinGW [ ./mingw-remove-export.patch ]; @@ -36,19 +36,20 @@ stdenv.mkDerivation rec { outputDoc = "devdoc"; nativeBuildInputs = [ - pkg-config autoreconfHook + pkg-config ]; + propagatedBuildInputs = [ libogg libvorbis ]; - meta = with lib; { - homepage = "https://www.theora.org/"; + meta = { description = "Library for Theora, a free and open video compression format"; - license = licenses.bsd3; + homepage = "https://www.theora.org/"; + license = lib.licenses.bsd3; maintainers = [ ]; - platforms = platforms.unix ++ platforms.windows; + platforms = lib.platforms.unix ++ lib.platforms.windows; }; } From 3a0ea49b6484b4074462ba884f441274942b1445 Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 11 Jun 2024 20:41:49 -0400 Subject: [PATCH 4/6] libtheora: add pkg-config test --- pkgs/by-name/li/libtheora/package.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/li/libtheora/package.nix b/pkgs/by-name/li/libtheora/package.nix index ff36e19605c5..f11dc3dd5d66 100644 --- a/pkgs/by-name/li/libtheora/package.nix +++ b/pkgs/by-name/li/libtheora/package.nix @@ -7,14 +7,15 @@ libogg, libvorbis, pkg-config, + testers, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "libtheora"; version = "1.1.1"; src = fetchurl { - url = "https://downloads.xiph.org/releases/theora/libtheora-${version}.tar.gz"; + url = "https://downloads.xiph.org/releases/theora/libtheora-${finalAttrs.version}.tar.gz"; hash = "sha256-QJUpVsR4EZKNHnkizaO8H0J+t1aAw8NySckelJBUkWs="; }; @@ -45,6 +46,17 @@ stdenv.mkDerivation rec { libvorbis ]; + passthru = { + tests.pkg-config = testers.hasPkgConfigModules { + package = finalAttrs.finalPackage; + moduleNames = [ + "theora" + "theoradec" + "theoraenc" + ]; + }; + }; + meta = { description = "Library for Theora, a free and open video compression format"; homepage = "https://www.theora.org/"; @@ -52,4 +64,4 @@ stdenv.mkDerivation rec { maintainers = [ ]; platforms = lib.platforms.unix ++ lib.platforms.windows; }; -} +}) From a654a5db5119bce50dfae0a77c3e7240dc58b56f Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 11 Jun 2024 20:45:55 -0400 Subject: [PATCH 5/6] libtheora: add getchoo as maintainer --- pkgs/by-name/li/libtheora/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/li/libtheora/package.nix b/pkgs/by-name/li/libtheora/package.nix index f11dc3dd5d66..558797655249 100644 --- a/pkgs/by-name/li/libtheora/package.nix +++ b/pkgs/by-name/li/libtheora/package.nix @@ -61,7 +61,7 @@ stdenv.mkDerivation (finalAttrs: { description = "Library for Theora, a free and open video compression format"; homepage = "https://www.theora.org/"; license = lib.licenses.bsd3; - maintainers = [ ]; + maintainers = with lib.maintainers; [ getchoo ]; platforms = lib.platforms.unix ++ lib.platforms.windows; }; }) From 5e48c4378570b4783b975fa6cb80a87ecf702159 Mon Sep 17 00:00:00 2001 From: seth Date: Wed, 12 Jun 2024 02:51:16 -0400 Subject: [PATCH 6/6] libtheora: add validatePkgConfig hook --- pkgs/by-name/li/libtheora/package.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/by-name/li/libtheora/package.nix b/pkgs/by-name/li/libtheora/package.nix index 558797655249..df49f3988c01 100644 --- a/pkgs/by-name/li/libtheora/package.nix +++ b/pkgs/by-name/li/libtheora/package.nix @@ -8,6 +8,7 @@ libvorbis, pkg-config, testers, + validatePkgConfig, }: stdenv.mkDerivation (finalAttrs: { @@ -39,6 +40,7 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ autoreconfHook pkg-config + validatePkgConfig ]; propagatedBuildInputs = [