From 6a7d676a1b476ebb5af442a641ed8b9e04f28133 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Tue, 15 Aug 2023 22:32:23 +0100 Subject: [PATCH 1/9] opensc: add patch for CVE-2023-2977 (cherry picked from commit a80126137c60faa3cd7f7519a404c2ef1ad0b9b3) --- pkgs/tools/security/opensc/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/tools/security/opensc/default.nix b/pkgs/tools/security/opensc/default.nix index 51e9434f82e8..9b5b6fba8b24 100644 --- a/pkgs/tools/security/opensc/default.nix +++ b/pkgs/tools/security/opensc/default.nix @@ -1,5 +1,6 @@ { lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, zlib, readline, openssl , libiconv, pcsclite, libassuan, libXt +, fetchpatch , docbook_xsl, libxslt, docbook_xml_dtd_412 , Carbon, PCSC, buildPackages , withApplePCSC ? stdenv.isDarwin @@ -16,6 +17,14 @@ stdenv.mkDerivation rec { sha256 = "sha256-Yo8dwk7+d6q+hi7DmJ0GJM6/pmiDOiyEm/tEBSbCU8k="; }; + patches = [ + (fetchpatch { + name = "CVE-2023-2977.patch"; + url = "https://github.com/OpenSC/OpenSC/commit/81944d1529202bd28359bede57c0a15deb65ba8a.patch"; + hash = "sha256-rCeYYKPtv3pii5zgDP5x9Kl2r98p3uxyBSCYlPJZR/s="; + }) + ]; + nativeBuildInputs = [ pkg-config autoreconfHook ]; buildInputs = [ zlib readline openssl libassuan From b6454d181e886d6a0bf258f0e324752bf2237d9e Mon Sep 17 00:00:00 2001 From: Ilan Joselevich Date: Fri, 18 Aug 2023 23:41:24 +0300 Subject: [PATCH 2/9] linux_xanmod: 6.1.45 -> 6.1.46 (cherry picked from commit 0d164bfc22e0c8a5f0e9c56cf96d92c2680bf075) --- pkgs/os-specific/linux/kernel/xanmod-kernels.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/xanmod-kernels.nix b/pkgs/os-specific/linux/kernel/xanmod-kernels.nix index 5f502a3853eb..0f113dd60d36 100644 --- a/pkgs/os-specific/linux/kernel/xanmod-kernels.nix +++ b/pkgs/os-specific/linux/kernel/xanmod-kernels.nix @@ -3,8 +3,8 @@ let # These names are how they are designated in https://xanmod.org. ltsVariant = { - version = "6.1.45"; - hash = "sha256-2UKu0ata48Rs2s+J/pI3qpgmxYRKaD8wwIZ6VulG4dg="; + version = "6.1.46"; + hash = "sha256-E9DEWfhl9hUAQXOvJVYJsKBFIen0xHrmiUdTUvGeKxE="; variant = "lts"; }; @@ -29,9 +29,9 @@ let # AMD P-state driver X86_AMD_PSTATE = lib.mkOverride 60 yes; - # Google's BBRv2 TCP congestion Control - TCP_CONG_BBR2 = yes; - DEFAULT_BBR2 = yes; + # Google's BBRv3 TCP congestion Control + TCP_CONG_BBR = yes; + DEFAULT_BBR = yes; # FQ-PIE Packet Scheduling NET_SCH_DEFAULT = yes; From ce0878fdb3a0b2b966fe40ba5353a8cf4cdab4a4 Mon Sep 17 00:00:00 2001 From: Ilan Joselevich Date: Fri, 18 Aug 2023 23:42:27 +0300 Subject: [PATCH 3/9] linux_xanmod_latest: 6.4.10 -> 6.4.11 (cherry picked from commit ea9af80d5ffdf94ad254ab9d35b96fadeb680149) --- pkgs/os-specific/linux/kernel/xanmod-kernels.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/xanmod-kernels.nix b/pkgs/os-specific/linux/kernel/xanmod-kernels.nix index 0f113dd60d36..30b8f6bba893 100644 --- a/pkgs/os-specific/linux/kernel/xanmod-kernels.nix +++ b/pkgs/os-specific/linux/kernel/xanmod-kernels.nix @@ -9,8 +9,8 @@ let }; mainVariant = { - version = "6.4.10"; - hash = "sha256-iRB2O0Ghh9LknqfxIf7zArS/p3iO2XEg/4R/z0QzxEQ="; + version = "6.4.11"; + hash = "sha256-HZTLuxdlkVRBe8C95vr6Fk9YjlCXZEpK3gfbtzLqwLQ="; variant = "main"; }; From 437258bf3133f2bbb330cc31dee2d96858afa3ff Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Fri, 18 Aug 2023 11:18:09 +0200 Subject: [PATCH 4/9] lbreakout2: fix runtime issues (cherry picked from commit fe8acaa8327e07b9128c8f0af40735c58413bfe8) --- pkgs/games/lgames/lbreakout2/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/games/lgames/lbreakout2/default.nix b/pkgs/games/lgames/lbreakout2/default.nix index 4645baf06244..f554a1683eee 100644 --- a/pkgs/games/lgames/lbreakout2/default.nix +++ b/pkgs/games/lgames/lbreakout2/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchurl +, fetchpatch , SDL , SDL_mixer , libintl @@ -17,6 +18,12 @@ stdenv.mkDerivation rec { sha256 = "0vwdlyvh7c4y80q5vp7fyfpzbqk9lq3w8pvavi139njkalbxc14i"; }; + # Can't exit from pause without this patch + patches = [(fetchpatch { + url = "https://sources.debian.org/data/main/l/lbreakout2/2.6.5-2/debian/patches/sdl_fix_pauses.patch"; + hash = "sha256-ycsuxfokpOblLky42MwtJowdEp7v5dZRMFIR4id4ZBI="; + })]; + buildInputs = [ SDL SDL_mixer @@ -25,6 +32,11 @@ stdenv.mkDerivation rec { zlib ]; + # With fortify it crashes at runtime: + # *** buffer overflow detected ***: terminated + # Aborted (core dumped) + hardeningDisable = [ "fortify" ]; + meta = with lib; { homepage = "http://lgames.sourceforge.net/LBreakout2/"; description = "Breakout clone from the LGames series"; From e4984ba3ac6ce67fd0eb40445639de865d6e98ec Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Thu, 10 Aug 2023 22:47:13 -0300 Subject: [PATCH 5/9] emacs28-macport: rename from emacs-macport Also, move emacsMacport to aliases.nix. (cherry picked from commit ae4e2e8676af606cb5c38f9f51e21f6053e41f10) --- pkgs/applications/editors/emacs/default.nix | 2 +- pkgs/applications/editors/emacs/sources.nix | 2 +- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/editors/emacs/default.nix b/pkgs/applications/editors/emacs/default.nix index b2edc8597013..8e737279f413 100644 --- a/pkgs/applications/editors/emacs/default.nix +++ b/pkgs/applications/editors/emacs/default.nix @@ -54,7 +54,7 @@ lib.makeScope pkgs.newScope (self: withPgtk = true; }; - emacs-macport = callPackage (self.sources.emacs-macport) { + emacs28-macport = callPackage (self.sources.emacs28-macport) { inherit gconf; inherit (pkgs.darwin) sigtool; diff --git a/pkgs/applications/editors/emacs/sources.nix b/pkgs/applications/editors/emacs/sources.nix index 91a60d5145b0..05a5bedec925 100644 --- a/pkgs/applications/editors/emacs/sources.nix +++ b/pkgs/applications/editors/emacs/sources.nix @@ -61,7 +61,7 @@ in meta = mainlineMeta; }; - emacs-macport = import ./generic.nix { + emacs28-macport = import ./generic.nix { pname = "emacs-mac"; version = "28.2"; variant = "macport"; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 8a5eefed0df3..d4a0b16a1372 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -444,6 +444,7 @@ mapAliases ({ emacs28NativeComp = emacs28; # Added 2022-06-08 emacs28Packages = emacs28.pkgs; # Added 2021-10-04 emacs28WithPackages = emacs28.pkgs.withPackages; # Added 2021-10-04 + emacsMacport = emacs-macport; # Added 2023-08-10 emacsNativeComp = emacs28NativeComp; # Added 2022-06-08 emacsPackagesGen = throw "'emacsPackagesGen' has been renamed to/replaced by 'emacsPackagesFor'"; # Converted to throw 2022-02-22 emacsPackagesNg = emacs.pkgs; # Added 2019-08-07 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 209345cabcae..909c538dfaee 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30166,10 +30166,10 @@ with pkgs; emacs29-gtk3 emacs29-nox emacs29-pgtk - emacs-macport + emacs28-macport ; - emacsMacport = emacs-macport; + emacs-macport = emacs28-macport; emacs = emacs28; emacs-gtk = emacs28-gtk3; emacs-nox = emacs28-nox; From 8ff7233964d0cac39998badab0ec068359dc21ee Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Thu, 10 Aug 2023 23:14:00 -0300 Subject: [PATCH 6/9] emacs: factor meta (cherry picked from commit 7e445b6d725fad064012ecf0b76aac68d91186f3) --- pkgs/applications/editors/emacs/sources.nix | 40 ++++++++++++--------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/pkgs/applications/editors/emacs/sources.nix b/pkgs/applications/editors/emacs/sources.nix index 05a5bedec925..0f8d130981ef 100644 --- a/pkgs/applications/editors/emacs/sources.nix +++ b/pkgs/applications/editors/emacs/sources.nix @@ -4,9 +4,13 @@ }: let - mainlineMeta = { - homepage = "https://www.gnu.org/software/emacs/"; - description = "The extensible, customizable GNU text editor"; + metaFor = variant: version: rev: { + homepage = { + "mainline" = "https://www.gnu.org/software/emacs/"; + "macport" = "https://bitbucket.org/mituharu/emacs-mac/"; + }.${variant}; + description = "The extensible, customizable GNU text editor" + + lib.optionalString (variant == "macport") " - macport variant"; longDescription = '' GNU Emacs is an extensible, customizable text editor—and more. At its core is an interpreter for Emacs Lisp, a dialect of the Lisp programming @@ -21,7 +25,15 @@ let functionality, including a project planner, mail and news reader, debugger interface, calendar, and more. Many of these extensions are distributed with GNU Emacs; others are available separately. + '' + lib.optionalString (variant == "macport") '' + + This release is built from Mitsuharu Yamamoto's patched source code + tailored for macOS. ''; + changelog = { + "mainline" = "https://www.gnu.org/savannah-checkouts/gnu/emacs/news/NEWS.${version}"; + "macport" = "https://bitbucket.org/mituharu/emacs-mac/raw/${rev}/NEWS-mac"; + }.${variant}; license = lib.licenses.gpl3Plus; maintainers = with lib.maintainers; [ AndersonTorres @@ -31,7 +43,11 @@ let lovek323 matthewbauer ]; - platforms = lib.platforms.all; + platforms = { + "mainline" = lib.platforms.all; + "macport" = lib.platforms.darwin; + }.${variant}; + mainProgram = "emacs"; }; in { @@ -45,7 +61,7 @@ in hash = "sha256-4oSLcUDR0MOEt53QOiZSVU8kPJ67GwugmBxdX3F15Ag="; }; - meta = mainlineMeta; + meta = metaFor "mainline" "28.2" "28.2"; }; emacs29 = import ./generic.nix { @@ -58,7 +74,7 @@ in hash = "sha256-p0lBSKsHrFwYTqO5UVIF/PgiqwdhYQE4oUVcPtd+gsU="; }; - meta = mainlineMeta; + meta = metaFor "mainline" "29.1-rc1" "29.1-rc1"; }; emacs28-macport = import ./generic.nix { @@ -72,16 +88,6 @@ in hash = "sha256-Ne2jQ2nVLNiQmnkkOXVc5AkLVkTpm8pFC7VNY2gQjPE="; }; - meta = { - homepage = "https://bitbucket.org/mituharu/emacs-mac/"; - description = mainlineMeta.description + " - with macport patches"; - longDescription = mainlineMeta.longDescription + '' - - This release is built from Mitsuharu Yamamoto's patched source code - tailoired for MacOS X. - ''; - inherit (mainlineMeta) license maintainers; - platforms = lib.platforms.darwin; - }; + meta = metaFor "macport" "28.2" "emacs-28.2-mac-9.1"; }; } From d5d6563f40238498562570c3a117802dbc286a4f Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Thu, 10 Aug 2023 23:19:12 -0300 Subject: [PATCH 7/9] emacs29: 29.1-rc1 -> 29.1 (cherry picked from commit 05d277b11e8b32ce8a05387ea4372716b325fcf1) --- pkgs/applications/editors/emacs/sources.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/editors/emacs/sources.nix b/pkgs/applications/editors/emacs/sources.nix index 0f8d130981ef..22ecbe778851 100644 --- a/pkgs/applications/editors/emacs/sources.nix +++ b/pkgs/applications/editors/emacs/sources.nix @@ -66,15 +66,15 @@ in emacs29 = import ./generic.nix { pname = "emacs"; - version = "29.1-rc1"; + version = "29.1"; variant = "mainline"; src = fetchFromSavannah { repo = "emacs"; - rev = "29.1-rc1"; - hash = "sha256-p0lBSKsHrFwYTqO5UVIF/PgiqwdhYQE4oUVcPtd+gsU="; + rev = "29.1"; + hash = "sha256-3HDCwtOKvkXwSULf3W7YgTz4GV8zvYnh2RrL28qzGKg="; }; - meta = metaFor "mainline" "29.1-rc1" "29.1-rc1"; + meta = metaFor "mainline" "29.1" "29.1"; }; emacs28-macport = import ./generic.nix { From 89834226497ce0db1060c59883fc264f7e383aaf Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Thu, 10 Aug 2023 23:24:49 -0300 Subject: [PATCH 8/9] emacs29-macport: init at 29.1 (cherry picked from commit 2160abc3eddbe826b08bcffdb3758763b093f254) --- pkgs/applications/editors/emacs/default.nix | 9 +++++++++ pkgs/applications/editors/emacs/sources.nix | 15 +++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 3 files changed, 25 insertions(+) diff --git a/pkgs/applications/editors/emacs/default.nix b/pkgs/applications/editors/emacs/default.nix index 8e737279f413..fe3c5d9ec512 100644 --- a/pkgs/applications/editors/emacs/default.nix +++ b/pkgs/applications/editors/emacs/default.nix @@ -62,4 +62,13 @@ lib.makeScope pkgs.newScope (self: AppKit Carbon Cocoa GSS ImageCaptureCore ImageIO IOKit OSAKit Quartz QuartzCore WebKit; }; + + emacs29-macport = callPackage (self.sources.emacs29-macport) { + inherit gconf; + + inherit (pkgs.darwin) sigtool; + inherit (pkgs.darwin.apple_sdk.frameworks) + AppKit Carbon Cocoa GSS ImageCaptureCore ImageIO IOKit OSAKit Quartz + QuartzCore WebKit; + }; }) diff --git a/pkgs/applications/editors/emacs/sources.nix b/pkgs/applications/editors/emacs/sources.nix index 22ecbe778851..b9b18a98ac88 100644 --- a/pkgs/applications/editors/emacs/sources.nix +++ b/pkgs/applications/editors/emacs/sources.nix @@ -90,4 +90,19 @@ in meta = metaFor "macport" "28.2" "emacs-28.2-mac-9.1"; }; + + emacs29-macport = import ./generic.nix { + pname = "emacs-mac"; + version = "29.1"; + variant = "macport"; + + src = fetchFromBitbucket { + owner = "mituharu"; + repo = "emacs-mac"; + rev = "emacs-29.1-mac-10.0"; + hash = "sha256-TE829qJdPjeOQ+kD0SfyO8d5YpJjBge/g+nScwj+XVU="; + }; + + meta = metaFor "macport" "29.1" "emacs-29.1-mac-10.0"; + }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 909c538dfaee..9d443d69cfa5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30167,6 +30167,7 @@ with pkgs; emacs29-nox emacs29-pgtk emacs28-macport + emacs29-macport ; emacs-macport = emacs28-macport; From 4cdad15f34e6321a2f789b99d42815b9142ac2ba Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Thu, 17 Aug 2023 23:10:53 -0300 Subject: [PATCH 9/9] emacs: better glib-networking detection Fixes https://github.com/NixOS/nixpkgs/issues/249756 (cherry picked from commit 6415fe87aa3fb20438e55bc865033463054dbab0) --- pkgs/applications/editors/emacs/generic.nix | 29 +++++++++++---------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/editors/emacs/generic.nix b/pkgs/applications/editors/emacs/generic.nix index 1ae3d5c79252..9da821de3f54 100644 --- a/pkgs/applications/editors/emacs/generic.nix +++ b/pkgs/applications/editors/emacs/generic.nix @@ -59,19 +59,6 @@ , webkitgtk , wrapGAppsHook -# macOS dependencies for NS and macPort -, AppKit -, Carbon -, Cocoa -, GSS -, IOKit -, ImageCaptureCore -, ImageIO -, OSAKit -, Quartz -, QuartzCore -, WebKit - # Boolean flags , nativeComp ? null , withNativeCompilation ? @@ -87,6 +74,7 @@ , withGTK2 ? false , withGTK3 ? withPgtk && !noGui , withGconf ? false +, withGlibNetworking ? withPgtk || withGTK3 || (withX && withXwidgets) , withGpm ? stdenv.isLinux , withImageMagick ? lib.versionOlder version "27" && (withX || withNS) , withMotif ? false @@ -109,6 +97,19 @@ else if withMotif then "motif" else if withAthena then "athena" else "lucid") + +# macOS dependencies for NS and macPort +, AppKit +, Carbon +, Cocoa +, GSS +, IOKit +, ImageCaptureCore +, ImageIO +, OSAKit +, Quartz +, QuartzCore +, WebKit }: assert (withGTK2 && !withNS && variant != "macport") -> withX; @@ -244,7 +245,7 @@ mkDerivation (finalAttrs: (lib.optionalAttrs withNativeCompilation { gtk3-x11 ] ++ lib.optionals (withX && withMotif) [ motif - ] ++ lib.optionals (withX && withXwidgets) [ + ] ++ lib.optionals withGlibNetworking [ glib-networking ] ++ lib.optionals withNativeCompilation [ libgccjit