From d43f88e3df1c5f686ec24947571ff29d2a6efbcf Mon Sep 17 00:00:00 2001 From: "Yc.Shen" Date: Tue, 13 Apr 2021 21:54:53 +0900 Subject: [PATCH 01/59] nixos/kubernetes: allow merging multiple definitions of extraOpts --- nixos/modules/services/cluster/kubernetes/apiserver.nix | 2 +- .../modules/services/cluster/kubernetes/controller-manager.nix | 2 +- nixos/modules/services/cluster/kubernetes/kubelet.nix | 2 +- nixos/modules/services/cluster/kubernetes/proxy.nix | 2 +- nixos/modules/services/cluster/kubernetes/scheduler.nix | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nixos/modules/services/cluster/kubernetes/apiserver.nix b/nixos/modules/services/cluster/kubernetes/apiserver.nix index a5b13215476..f1531caa754 100644 --- a/nixos/modules/services/cluster/kubernetes/apiserver.nix +++ b/nixos/modules/services/cluster/kubernetes/apiserver.nix @@ -145,7 +145,7 @@ in extraOpts = mkOption { description = "Kubernetes apiserver extra command line options."; default = ""; - type = str; + type = separatedString " "; }; extraSANs = mkOption { diff --git a/nixos/modules/services/cluster/kubernetes/controller-manager.nix b/nixos/modules/services/cluster/kubernetes/controller-manager.nix index a99ef6640e9..0c81fa9ae49 100644 --- a/nixos/modules/services/cluster/kubernetes/controller-manager.nix +++ b/nixos/modules/services/cluster/kubernetes/controller-manager.nix @@ -38,7 +38,7 @@ in extraOpts = mkOption { description = "Kubernetes controller manager extra command line options."; default = ""; - type = str; + type = separatedString " "; }; featureGates = mkOption { diff --git a/nixos/modules/services/cluster/kubernetes/kubelet.nix b/nixos/modules/services/cluster/kubernetes/kubelet.nix index b5346b1cd44..a428a60800c 100644 --- a/nixos/modules/services/cluster/kubernetes/kubelet.nix +++ b/nixos/modules/services/cluster/kubernetes/kubelet.nix @@ -142,7 +142,7 @@ in extraOpts = mkOption { description = "Kubernetes kubelet extra command line options."; default = ""; - type = str; + type = separatedString " "; }; featureGates = mkOption { diff --git a/nixos/modules/services/cluster/kubernetes/proxy.nix b/nixos/modules/services/cluster/kubernetes/proxy.nix index 86d1dc2439b..7aa449f9aa2 100644 --- a/nixos/modules/services/cluster/kubernetes/proxy.nix +++ b/nixos/modules/services/cluster/kubernetes/proxy.nix @@ -25,7 +25,7 @@ in extraOpts = mkOption { description = "Kubernetes proxy extra command line options."; default = ""; - type = str; + type = separatedString " "; }; featureGates = mkOption { diff --git a/nixos/modules/services/cluster/kubernetes/scheduler.nix b/nixos/modules/services/cluster/kubernetes/scheduler.nix index 5f6113227d9..454c689759d 100644 --- a/nixos/modules/services/cluster/kubernetes/scheduler.nix +++ b/nixos/modules/services/cluster/kubernetes/scheduler.nix @@ -21,7 +21,7 @@ in extraOpts = mkOption { description = "Kubernetes scheduler extra command line options."; default = ""; - type = str; + type = separatedString " "; }; featureGates = mkOption { From db5b547b2542d01661ad602b437d88e3c75a8606 Mon Sep 17 00:00:00 2001 From: Matej Urbas Date: Sun, 18 Apr 2021 10:19:06 +0100 Subject: [PATCH 02/59] nixos/amazon-init: add user-data shell script support --- nixos/modules/virtualisation/amazon-init.nix | 10 +++++ nixos/tests/all-tests.nix | 1 + nixos/tests/amazon-init-shell.nix | 40 ++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 nixos/tests/amazon-init-shell.nix diff --git a/nixos/modules/virtualisation/amazon-init.nix b/nixos/modules/virtualisation/amazon-init.nix index be83607c0af..4f2f8df90eb 100644 --- a/nixos/modules/virtualisation/amazon-init.nix +++ b/nixos/modules/virtualisation/amazon-init.nix @@ -16,6 +16,16 @@ let userData=/etc/ec2-metadata/user-data + # Check if user-data looks like a shell script and execute it with the + # runtime shell if it does. Otherwise treat it as a nixos configuration + # expression + if IFS= LC_ALL=C read -rN2 shebang < $userData && [ "$shebang" = '#!' ]; then + # NB: we cannot chmod the $userData file, this is why we execute it via + # `pkgs.runtimeShell`. This means we have only limited support for shell + # scripts compatible with the `pkgs.runtimeShell`. + exec ${pkgs.runtimeShell} $userData + fi + if [ -s "$userData" ]; then # If the user-data looks like it could be a nix expression, # copy it over. Also, look for a magic three-hash comment and set diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index fb45ec1a310..d4fdc668e76 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -24,6 +24,7 @@ in _3proxy = handleTest ./3proxy.nix {}; acme = handleTest ./acme.nix {}; agda = handleTest ./agda.nix {}; + amazon-init-shell = handleTest ./amazon-init-shell.nix {}; ammonite = handleTest ./ammonite.nix {}; atd = handleTest ./atd.nix {}; avahi = handleTest ./avahi.nix {}; diff --git a/nixos/tests/amazon-init-shell.nix b/nixos/tests/amazon-init-shell.nix new file mode 100644 index 00000000000..f9268b2f3a0 --- /dev/null +++ b/nixos/tests/amazon-init-shell.nix @@ -0,0 +1,40 @@ +# This test verifies that the amazon-init service can treat the `user-data` ec2 +# metadata file as a shell script. If amazon-init detects that `user-data` is a +# script (based on the presence of the shebang #! line) it executes it and +# exits. +# Note that other tests verify that amazon-init can treat user-data as a nixos +# configuration expression. + +{ system ? builtins.currentSystem, + config ? {}, + pkgs ? import ../.. { inherit system config; } +}: + +with import ../lib/testing-python.nix { inherit system pkgs; }; +with pkgs.lib; + +makeTest { + name = "amazon-init"; + meta = with maintainers; { + maintainers = [ urbas ]; + }; + machine = { ... }: + { + imports = [ ../modules/profiles/headless.nix ../modules/virtualisation/amazon-init.nix ]; + services.openssh.enable = true; + networking.hostName = ""; + environment.etc."ec2-metadata/user-data" = { + text = '' + #!/usr/bin/bash + + echo successful > /tmp/evidence + ''; + }; + }; + testScript = '' + # To wait until amazon-init terminates its run + unnamed.wait_for_unit("amazon-init.service") + + unnamed.succeed("grep -q successful /tmp/evidence") + ''; +} From 7ff18cdf3c3b286f57018e6f3aad23c7a2a088f0 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 21 Apr 2021 13:45:13 +0200 Subject: [PATCH 03/59] nixos/xserver: set fs.inotify.max_user_instances too A too low number of inotify user instances causes similar problems as max_user_watches. Without this, my workstation keeps running into things like this: $ sudo systemctl restart display-manager.service Failed to allocate directory watch: Too many open files --- nixos/modules/services/x11/xserver.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index 35bd4dabb67..4dde4476d2c 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -666,6 +666,7 @@ in # The default max inotify watches is 8192. # Nowadays most apps require a good number of inotify watches, # the value below is used by default on several other distros. + boot.kernel.sysctl."fs.inotify.max_user_instances" = mkDefault 524288; boot.kernel.sysctl."fs.inotify.max_user_watches" = mkDefault 524288; systemd.defaultUnit = mkIf cfg.autorun "graphical.target"; From 46445cc334321e8323d1111ae24f079bb07c754c Mon Sep 17 00:00:00 2001 From: Kenny Ballou Date: Fri, 23 Apr 2021 08:08:06 -0600 Subject: [PATCH 04/59] emacs2nix: update to fix gitlab archive URLs Signed-off-by: Kenny Ballou --- pkgs/applications/editors/emacs-modes/emacs2nix.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/emacs-modes/emacs2nix.nix b/pkgs/applications/editors/emacs-modes/emacs2nix.nix index e29a19713bd..cc82646870c 100644 --- a/pkgs/applications/editors/emacs-modes/emacs2nix.nix +++ b/pkgs/applications/editors/emacs-modes/emacs2nix.nix @@ -4,8 +4,8 @@ let src = pkgs.fetchgit { url = "https://github.com/ttuegel/emacs2nix.git"; fetchSubmodules = true; - rev = "b815a9323c1f58f6c163a1f968939c57a8b6cfa0"; - sha256 = "183xlmhjmj4z2zssc0pw990h7bf3bam8zqswnf1zcsyp8z7yrl5g"; + rev = "860da04ca91cbb69c9b881a54248d16bdaaf9923"; + sha256 = "1r3xmyk9rfgx7ln69dk8mgbnh3awcalm3r1c5ia2shlsrymvv1df"; }; in pkgs.mkShell { From 54a540c448baa5b06f64525d57043b41d721343d Mon Sep 17 00:00:00 2001 From: Kenny Ballou Date: Fri, 23 Apr 2021 09:32:44 -0600 Subject: [PATCH 05/59] update-melpa.el: update gitlab fetcher to use API URL GitLab packages were not downloading because the archive URL's used were invalid. Following the [GitLab API Docs][0], use the correct GitLab archive URL. This change is mirrored in ttuegel/emacs2nix#57. Signed-off-by: Kenny Ballou --- pkgs/applications/editors/emacs-modes/update-melpa.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/emacs-modes/update-melpa.el b/pkgs/applications/editors/emacs-modes/update-melpa.el index b315777620e..c8c1bfee566 100644 --- a/pkgs/applications/editors/emacs-modes/update-melpa.el +++ b/pkgs/applications/editors/emacs-modes/update-melpa.el @@ -99,7 +99,10 @@ return Promise to resolve in that process." ("github" (list "nix-prefetch-url" "--unpack" (concat "https://github.com/" repo "/archive/" commit ".tar.gz"))) ("gitlab" (list "nix-prefetch-url" - "--unpack" (concat "https://gitlab.com/" repo "/repository/archive.tar.gz?ref=" commit))) + "--unpack" (concat "https://gitlab.com/api/v4/projects/" + (url-hexify-string repo) + "/repository/archive.tar.gz?ref=" + commit))) ("bitbucket" (list "nix-prefetch-hg" (concat "https://bitbucket.com/" repo) commit)) ("hg" (list "nix-prefetch-hg" From ab91aea5ea15623882861b566d1a0e23e45857e9 Mon Sep 17 00:00:00 2001 From: Aaron Andersen Date: Mon, 26 Apr 2021 08:47:20 -0400 Subject: [PATCH 06/59] openscenegraph: update from ffmpeg_3 to ffmpeg --- pkgs/development/libraries/openscenegraph/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/openscenegraph/default.nix b/pkgs/development/libraries/openscenegraph/default.nix index da7e9c755a0..6b446882ba1 100644 --- a/pkgs/development/libraries/openscenegraph/default.nix +++ b/pkgs/development/libraries/openscenegraph/default.nix @@ -11,7 +11,7 @@ curlSupport ? true, curl, colladaSupport ? false, opencollada, opencascadeSupport ? false, opencascade, - ffmpegSupport ? false, ffmpeg_3, + ffmpegSupport ? false, ffmpeg, nvttSupport ? false, nvidia-texture-tools, freetypeSupport ? true, freetype, svgSupport ? false, librsvg, @@ -50,7 +50,7 @@ stdenv.mkDerivation rec { ++ lib.optional curlSupport curl ++ lib.optional colladaSupport opencollada ++ lib.optional opencascadeSupport opencascade - ++ lib.optional ffmpegSupport ffmpeg_3 + ++ lib.optional ffmpegSupport ffmpeg ++ lib.optional nvttSupport nvidia-texture-tools ++ lib.optional freetypeSupport freetype ++ lib.optional svgSupport librsvg From 8a83d611f578076031c4cd30b0a5f4cf43188129 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Mon, 26 Apr 2021 20:42:19 +0200 Subject: [PATCH 07/59] lib/types: only accept derivations for shellPackage Since shellPackage actually requires the value to be an attribute set (i. e. an derivation in this case), we cannot re-use the package.check type checker since it also allows strings or things that are coercible to strings as long as they look like store paths. --- lib/types.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/types.nix b/lib/types.nix index d0a8e96149d..31ce440bcb4 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -337,7 +337,7 @@ rec { }; shellPackage = package // { - check = x: (package.check x) && (hasAttr "shellPath" x); + check = x: isDerivation x && hasAttr "shellPath" x; }; path = mkOptionType { From 82145d5facad176c9cfb12a0b3971c21b2951f72 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Wed, 28 Apr 2021 03:03:12 +0000 Subject: [PATCH 08/59] cifs-utils: 6.12 -> 6.13 --- pkgs/os-specific/linux/cifs-utils/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/cifs-utils/default.nix b/pkgs/os-specific/linux/cifs-utils/default.nix index 38f958fe9dd..8c587a40196 100644 --- a/pkgs/os-specific/linux/cifs-utils/default.nix +++ b/pkgs/os-specific/linux/cifs-utils/default.nix @@ -3,11 +3,11 @@ stdenv.mkDerivation rec { pname = "cifs-utils"; - version = "6.12"; + version = "6.13"; src = fetchurl { url = "mirror://samba/pub/linux-cifs/cifs-utils/${pname}-${version}.tar.bz2"; - sha256 = "1vw570pvir73kl4y6fhd6ns936ankimkhb1ii43yh8lr0p1xqbcj"; + sha256 = "sha256-Q9h4bIYTysz6hJEwgcHWK8JAlXWFTPiVsFtIrwhj0FY="; }; nativeBuildInputs = [ autoreconfHook docutils pkg-config ]; From e7835da83f14600a8fc713aa00023aeb461f82ca Mon Sep 17 00:00:00 2001 From: Yurii Matsiuk Date: Fri, 30 Apr 2021 15:27:43 +0200 Subject: [PATCH 09/59] zoom-us: 5.6.16775.0418 -> 5.6.16888.0424 --- .../networking/instant-messengers/zoom-us/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/zoom-us/default.nix b/pkgs/applications/networking/instant-messengers/zoom-us/default.nix index fd15e77c8be..6dcf5e11061 100644 --- a/pkgs/applications/networking/instant-messengers/zoom-us/default.nix +++ b/pkgs/applications/networking/instant-messengers/zoom-us/default.nix @@ -29,11 +29,11 @@ assert pulseaudioSupport -> libpulseaudio != null; let - version = "5.6.16775.0418"; + version = "5.6.16888.0424"; srcs = { x86_64-linux = fetchurl { url = "https://zoom.us/client/${version}/zoom_x86_64.pkg.tar.xz"; - sha256 = "twtxzniojgyLTx6Kda8Ej96uyw2JQB/jIhLdTgTqpCo="; + sha256 = "H/G9cSVmxYM0AVfrdpXzm7ohssDbKq2xdvIBc4d+elc="; }; }; From ddf04bd3f10eaf74486c27f620c304391329710a Mon Sep 17 00:00:00 2001 From: Aaron Andersen Date: Fri, 30 Apr 2021 10:50:01 -0400 Subject: [PATCH 10/59] musikcube: update from ffmpeg_3 to ffmpeg --- pkgs/applications/audio/musikcube/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/musikcube/default.nix b/pkgs/applications/audio/musikcube/default.nix index 4a80ea09878..47266981c59 100644 --- a/pkgs/applications/audio/musikcube/default.nix +++ b/pkgs/applications/audio/musikcube/default.nix @@ -4,7 +4,7 @@ , boost , curl , fetchFromGitHub -, ffmpeg_3 +, ffmpeg , lame , libev , libmicrohttpd @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { alsaLib boost curl - ffmpeg_3 + ffmpeg lame libev libmicrohttpd From dd454b37a0ff88f6ae2fcbb19f229f3979415d7b Mon Sep 17 00:00:00 2001 From: Aaron Andersen Date: Fri, 30 Apr 2021 10:56:57 -0400 Subject: [PATCH 11/59] musikcube: 0.96.5 -> 0.96.7 --- pkgs/applications/audio/musikcube/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/musikcube/default.nix b/pkgs/applications/audio/musikcube/default.nix index 47266981c59..c8e18c03c1e 100644 --- a/pkgs/applications/audio/musikcube/default.nix +++ b/pkgs/applications/audio/musikcube/default.nix @@ -17,13 +17,13 @@ stdenv.mkDerivation rec { pname = "musikcube"; - version = "0.96.5"; + version = "0.96.7"; src = fetchFromGitHub { owner = "clangen"; repo = pname; rev = version; - sha256 = "sha256-GxMQPP8i/NWvduf10f+xVyuG666pChj9RsiF4jfygyY="; + sha256 = "1y00vwn1h10cfflxrm5bk271ak9gilhjycgi44hlkkhmf5bdgn35"; }; nativeBuildInputs = [ From 0dc08b41385ef5275dcb76fe479c7730c58035d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Fri, 30 Apr 2021 18:13:31 +0200 Subject: [PATCH 12/59] wireguard module: generatePrivateKeyFile: Fix chmod security race. Fixes #121288 Until now, the `touch + chmod 600 + write` approach made it possible for an unprivileged local user read the private key file, by opening the file after the touch, before the read permissions are restricted. This was only the case if `generatePrivateKeyFile = true` and the parent directory of `privateKeyFile` already existed and was readable. This commit fixes it by using `umask`, which ensures kernel-side that the `touch` creates the file with the correct permissions atomically. This commit also: * Removes `mkdir --mode 0644 -p "${dirOf values.privateKeyFile}"` because setting permissions `drw-r--r--` ("nobody can enter that dir") is awkward. `drwx------` would perhaps make sense, like for `.ssh`. However, setting the permissions on the private key file is enough, and likely better, because `privateKeyFile` is about that file specifically and no docs suggest that there's something special about its parent dir. * Removes the `chmod 0400 "${values.privateKeyFile}"` because there isn't really a point in removing write access from the owner of the private key. --- nixos/modules/services/networking/wireguard.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/nixos/modules/services/networking/wireguard.nix b/nixos/modules/services/networking/wireguard.nix index 34c86934535..043bce16e54 100644 --- a/nixos/modules/services/networking/wireguard.nix +++ b/nixos/modules/services/networking/wireguard.nix @@ -246,12 +246,15 @@ let }; script = '' - mkdir --mode 0644 -p "${dirOf values.privateKeyFile}" + set -e + + # If the parent dir does not already exist, create it. + # Otherwise, does nothing, keeping existing permisions intact. + mkdir -p --mode 0755 "${dirOf values.privateKeyFile}" + if [ ! -f "${values.privateKeyFile}" ]; then - touch "${values.privateKeyFile}" - chmod 0600 "${values.privateKeyFile}" - wg genkey > "${values.privateKeyFile}" - chmod 0400 "${values.privateKeyFile}" + # Write private key file with atomically-correct permissions. + (set -e; umask 077; wg genkey > "${values.privateKeyFile}") fi ''; }; From a874a8a98b5cd197acf9b2a40b71107db3718f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Fri, 30 Apr 2021 19:28:04 +0200 Subject: [PATCH 13/59] release notes: Mention wireguard `generatePrivateKeyFile` permission changes --- nixos/doc/manual/release-notes/rl-2105.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nixos/doc/manual/release-notes/rl-2105.xml b/nixos/doc/manual/release-notes/rl-2105.xml index 6e4a9e7114b..4b7d71147b4 100644 --- a/nixos/doc/manual/release-notes/rl-2105.xml +++ b/nixos/doc/manual/release-notes/rl-2105.xml @@ -333,6 +333,17 @@ vim switched to Python 3, dropping all Python 2 support. + + + networking.wireguard.interfaces.<name>.generatePrivateKeyFile, + which is off by default, had a chmod race condition + fixed. As an aside, the parent directory's permissions were widened, + and the key files were made owner-writable. + This only affects newly created keys. + However, if the exact permissions are important for your setup, read + #121294. + + boot.zfs.forceImportAll From 0123d8c4c29fc807d5c877537d1947da6e57e2bf Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Sat, 16 Jan 2021 10:06:05 -0800 Subject: [PATCH 14/59] matrix-dendrite: init at 0.3.11 --- pkgs/servers/matrix-dendrite/default.nix | 23 +++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 pkgs/servers/matrix-dendrite/default.nix diff --git a/pkgs/servers/matrix-dendrite/default.nix b/pkgs/servers/matrix-dendrite/default.nix new file mode 100644 index 00000000000..708a1e6f65e --- /dev/null +++ b/pkgs/servers/matrix-dendrite/default.nix @@ -0,0 +1,23 @@ +{ lib, buildGoModule, fetchFromGitHub}: + +buildGoModule rec { + pname = "matrix-dendrite"; + version = "0.3.11"; + + src = fetchFromGitHub { + owner = "matrix-org"; + repo = "dendrite"; + rev = "v${version}"; + sha256 = "15xqd4yhsnnpz5n90fbny9i8lp7ki2z3fbpbd8cvsp49347rm483"; + }; + + vendorSha256 = "1l1wydvi0yalas79cvhrqg563cvs57hg9rv6qnkw879r6smb2x1n"; + + meta = with lib; { + homepage = "https://matrix.org"; + description = "Dendrite is a second-generation Matrix homeserver written in Go!"; + license = licenses.asl20; + maintainers = teams.matrix.members; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 80373d50963..e0b35e8d4aa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6097,6 +6097,8 @@ in inherit (darwin.apple_sdk.frameworks) Security; }; + matrix-dendrite = callPackage ../servers/matrix-dendrite { }; + /* Python 3.8 is currently broken with matrix-synapse since `python38Packages.bleach` fails (https://github.com/NixOS/nixpkgs/issues/76093) */ matrix-synapse = callPackage ../servers/matrix-synapse { /*python3 = python38;*/ }; From f03f26bf8f59357e54658cf66a0c1a1049579140 Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Sat, 16 Jan 2021 11:09:00 -0800 Subject: [PATCH 15/59] maintainers: add mjlbach to the matrix team --- maintainers/team-list.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/maintainers/team-list.nix b/maintainers/team-list.nix index 1318ac2a586..66cddb966d7 100644 --- a/maintainers/team-list.nix +++ b/maintainers/team-list.nix @@ -135,6 +135,7 @@ with lib.maintainers; { mguentner ekleog ralith + mjlbach ]; scope = "Maintain the ecosystem around Matrix, a decentralized messenger."; }; From cbdce8300816b5901c8eb850bd18dd82c241cee9 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Sat, 1 May 2021 00:36:41 +0000 Subject: [PATCH 16/59] agi: 1.1.0-dev-20210423 -> 1.1.0-dev-20210430 --- pkgs/tools/graphics/agi/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/graphics/agi/default.nix b/pkgs/tools/graphics/agi/default.nix index 5fb1881eff9..4cab99d69fa 100644 --- a/pkgs/tools/graphics/agi/default.nix +++ b/pkgs/tools/graphics/agi/default.nix @@ -14,11 +14,11 @@ stdenv.mkDerivation rec { pname = "agi"; - version = "1.1.0-dev-20210423"; + version = "1.1.0-dev-20210430"; src = fetchzip { url = "https://github.com/google/agi-dev-releases/releases/download/v${version}/agi-${version}-linux.zip"; - sha256 = "sha256-49ZKqG+CiQkdoBMLdYrN5fMnJH5TtXdUknQLQB2UG04="; + sha256 = "sha256-Sb2N3GPS+A55O39/kqua7M18O1F76zz6sNFghSFRBmk="; }; nativeBuildInputs = [ From e812fd9c0ecca237a35fb2b9534c48ebb2807363 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Sat, 1 May 2021 04:39:10 +0000 Subject: [PATCH 17/59] handlr: 0.6.3 -> 0.6.4 --- pkgs/tools/misc/handlr/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/misc/handlr/default.nix b/pkgs/tools/misc/handlr/default.nix index baa718c1b1f..c8143ea330a 100644 --- a/pkgs/tools/misc/handlr/default.nix +++ b/pkgs/tools/misc/handlr/default.nix @@ -2,16 +2,16 @@ rustPlatform.buildRustPackage rec { pname = "handlr"; - version = "0.6.3"; + version = "0.6.4"; src = fetchFromGitHub { owner = "chmln"; repo = pname; rev = "v${version}"; - sha256 = "sha256-OtU6sL2Bbbec0gHxk3bl5Inn+ZmNYiHgpSF0gjDuRSg="; + sha256 = "sha256-UYcJtBwbUDqDiRoj5PmO+urURfd7S7fSx2XhQRBrKTE="; }; - cargoSha256 = "sha256-bX7QWV1R+pLxvghpaV10LeROv4wBVfZhHyrPCIgqETA="; + cargoSha256 = "sha256-xDQV8wVlzItz0lzR1nVRPVsg7nSf/khUhevDlGgSO3g="; nativeBuildInputs = [ shared-mime-info ]; From 0425a60e5525d8dcdedc7263cf83a92a55a319e2 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sat, 1 May 2021 11:28:24 +0400 Subject: [PATCH 18/59] kotatogram-desktop: 1.4 -> 1.4.1 --- .../telegram/kotatogram-desktop/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/default.nix b/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/default.nix index 2f6594c1765..c88c97705fd 100644 --- a/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/default.nix @@ -2,7 +2,7 @@ , pkg-config, cmake, ninja, python3, wrapGAppsHook, wrapQtAppsHook , qtbase, qtimageformats, gtk3, libsForQt5, lz4, xxHash , ffmpeg, openalSoft, minizip, libopus, alsaLib, libpulseaudio, range-v3 -, tl-expected, hunspell, glibmm +, tl-expected, hunspell, glibmm, webkitgtk # Transitive dependencies: , pcre, xorg, util-linux, libselinux, libsepol, epoxy , at-spi2-core, libXtst, libthai, libdatrie @@ -14,13 +14,13 @@ let tg_owt = callPackage ../tdesktop/tg_owt.nix {}; in mkDerivation rec { pname = "kotatogram-desktop"; - version = "1.4"; + version = "1.4.1"; src = fetchFromGitHub { owner = "kotatogram"; repo = "kotatogram-desktop"; rev = "k${version}"; - sha256 = "0nhyjqxrbqiik4sgzplmpgx8msf8rykjiik0c2zr61rjm4fngkb3"; + sha256 = "07z56gz3sk45n5j0gw9p9mxrbwixxsmp7lvqc6lqnxmglz6knc1d"; fetchSubmodules = true; }; @@ -38,7 +38,7 @@ in mkDerivation rec { buildInputs = [ qtbase qtimageformats gtk3 libsForQt5.kwayland libsForQt5.libdbusmenu lz4 xxHash ffmpeg openalSoft minizip libopus alsaLib libpulseaudio range-v3 - tl-expected hunspell glibmm + tl-expected hunspell glibmm webkitgtk tg_owt # Transitive dependencies: pcre xorg.libXdmcp util-linux libselinux libsepol epoxy From 5a835e6e9275c1b2378765ea2ae286c46fd16edb Mon Sep 17 00:00:00 2001 From: V Date: Sat, 1 May 2021 10:42:02 +0200 Subject: [PATCH 19/59] rink: 0.6.0 -> 0.6.1 --- pkgs/applications/science/misc/rink/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/science/misc/rink/default.nix b/pkgs/applications/science/misc/rink/default.nix index 31ae8678719..232e13218cb 100644 --- a/pkgs/applications/science/misc/rink/default.nix +++ b/pkgs/applications/science/misc/rink/default.nix @@ -1,17 +1,17 @@ { lib, fetchFromGitHub, rustPlatform, openssl, pkg-config, ncurses }: rustPlatform.buildRustPackage rec { - version = "0.6.0"; + version = "0.6.1"; pname = "rink"; src = fetchFromGitHub { owner = "tiffany352"; repo = "rink-rs"; rev = "v${version}"; - sha256 = "sha256-3uhKevuUVh7AObn2GDW2T+5wttX20SbVP+sFaFj3Jmk="; + sha256 = "1h93xlavcjvx588q8wkpbzph88yjjhhvzcfxr5nicdca0jnha5ch"; }; - cargoSha256 = "sha256-luJzIGdcitH+PNgr86AYX6wKEkQlsRhwwylo+hzeovE="; + cargoSha256 = "0x4rvfnw3gl2aj6i006nkk3y1f8skyv8g0ss3z2v6qj9nhs7pyir"; nativeBuildInputs = [ pkg-config ]; buildInputs = [ openssl ncurses ]; From f667c13b66ec4492fe12d8bf5c3b736ea17c72c5 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sat, 1 May 2021 18:03:56 +0000 Subject: [PATCH 20/59] clevis: fix TPM2 encrypt/decrypt This also fixes using the "clevis" entrypoint binary without making sure that all the other tooling is in the PATH. --- pkgs/tools/security/clevis/default.nix | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/security/clevis/default.nix b/pkgs/tools/security/clevis/default.nix index e5415f6d09b..753fd8a6395 100644 --- a/pkgs/tools/security/clevis/default.nix +++ b/pkgs/tools/security/clevis/default.nix @@ -1,5 +1,6 @@ { lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config, asciidoc -, jansson, jose, cryptsetup, curl, libpwquality, luksmeta +, makeWrapper, jansson, jose, cryptsetup, curl, libpwquality, luksmeta +, coreutils, tpm2-tools }: stdenv.mkDerivation rec { @@ -13,8 +14,21 @@ stdenv.mkDerivation rec { sha256 = "sha256-m1UhyjD5ydSgCTBu6sECLlxFx0rnQxFnBA7frbdUqU8="; }; - nativeBuildInputs = [ meson ninja pkg-config asciidoc ]; - buildInputs = [ jansson jose cryptsetup curl libpwquality luksmeta ]; + postPatch = '' + for f in $(find src/ -type f); do + grep -q "/bin/cat" "$f" && substituteInPlace "$f" \ + --replace '/bin/cat' '${coreutils}/bin/cat' || true + done + ''; + + postInstall = '' + # We wrap the main clevis binary entrypoint but not the sub-binaries. + wrapProgram $out/bin/clevis \ + --prefix PATH ':' "${tpm2-tools}/bin:${jose}/bin:${placeholder "out"}/bin" + ''; + + nativeBuildInputs = [ meson ninja pkg-config asciidoc makeWrapper ]; + buildInputs = [ jansson jose cryptsetup curl libpwquality luksmeta tpm2-tools ]; outputs = [ "out" "man" ]; From c6325c8325c597560c0f67915516cd1d49928bcc Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sat, 1 May 2021 20:15:42 +0200 Subject: [PATCH 21/59] nixos/tests: Replace QEMU_OPTS usages with virtualisation.qemu.options See [0]: "QEMU_OPTS is something that should be set by people running VM tests interactively, to do port forwardings etc. We really should not poke with it from the test script - that's what virtualisation.qemu.options is for." [0]: https://github.com/NixOS/nixpkgs/pull/119615#discussion_r624145020 Co-authored-by: Florian Klink --- nixos/tests/cage.nix | 9 ++++----- nixos/tests/os-prober.nix | 8 +++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/nixos/tests/cage.nix b/nixos/tests/cage.nix index 53476c2fbe8..80ce1e0d8b3 100644 --- a/nixos/tests/cage.nix +++ b/nixos/tests/cage.nix @@ -18,6 +18,10 @@ import ./make-test-python.nix ({ pkgs, ...} : }; virtualisation.memorySize = 1024; + # Need to switch to a different VGA card / GPU driver because Cage segfaults with the default one (std): + # machine # [ 14.355893] .cage-wrapped[736]: segfault at 20 ip 00007f035fa0d8c7 sp 00007ffce9e4a2f0 error 4 in libwlroots.so.8[7f035fa07000+5a000] + # machine # [ 14.358108] Code: 4f a8 ff ff eb aa 0f 1f 44 00 00 c3 0f 1f 80 00 00 00 00 41 54 49 89 f4 55 31 ed 53 48 89 fb 48 8d 7f 18 48 8d 83 b8 00 00 00 <80> 7f 08 00 75 0d 48 83 3f 00 0f 85 91 00 00 00 48 89 fd 48 83 c7 + virtualisation.qemu.options = [ "-vga virtio" ]; }; enableOCR = true; @@ -25,11 +29,6 @@ import ./make-test-python.nix ({ pkgs, ...} : testScript = { nodes, ... }: let user = nodes.machine.config.users.users.alice; in '' - # Need to switch to a different VGA card / GPU driver because Cage segfaults with the default one (std): - # machine # [ 14.355893] .cage-wrapped[736]: segfault at 20 ip 00007f035fa0d8c7 sp 00007ffce9e4a2f0 error 4 in libwlroots.so.8[7f035fa07000+5a000] - # machine # [ 14.358108] Code: 4f a8 ff ff eb aa 0f 1f 44 00 00 c3 0f 1f 80 00 00 00 00 41 54 49 89 f4 55 31 ed 53 48 89 fb 48 8d 7f 18 48 8d 83 b8 00 00 00 <80> 7f 08 00 75 0d 48 83 3f 00 0f 85 91 00 00 00 48 89 fd 48 83 c7 - os.environ["QEMU_OPTS"] = "-vga virtio" - with subtest("Wait for cage to boot up"): start_all() machine.wait_for_file("/run/user/${toString user.uid}/wayland-0.lock") diff --git a/nixos/tests/os-prober.nix b/nixos/tests/os-prober.nix index f778d30bdc0..3cc38ebe347 100644 --- a/nixos/tests/os-prober.nix +++ b/nixos/tests/os-prober.nix @@ -69,6 +69,9 @@ in { imports = [ ../modules/profiles/installation-device.nix ../modules/profiles/base.nix ]; virtualisation.memorySize = 1300; + # To add the secondary disk: + virtualisation.qemu.options = [ "-drive index=2,file=${debianImage}/disk-image.qcow2,read-only,if=virtio" ]; + # The test cannot access the network, so any packages # nixos-rebuild needs must be included in the VM. system.extraDependencies = with pkgs; @@ -95,11 +98,6 @@ in { }); testScript = '' - # hack to add the secondary disk - os.environ[ - "QEMU_OPTS" - ] = "-drive index=2,file=${debianImage}/disk-image.qcow2,read-only,if=virtio" - machine.start() machine.succeed("udevadm settle") machine.wait_for_unit("multi-user.target") From 937a47700ca036091105c2818c83448ce145e912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 1 May 2021 22:25:33 +0200 Subject: [PATCH 22/59] ytfzf: 1.1.4 -> 1.1.5 https://github.com/pystardust/ytfzf/releases/tag/v1.1.5 --- pkgs/tools/misc/ytfzf/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/ytfzf/default.nix b/pkgs/tools/misc/ytfzf/default.nix index ba1658f3d1d..8c93d02c359 100644 --- a/pkgs/tools/misc/ytfzf/default.nix +++ b/pkgs/tools/misc/ytfzf/default.nix @@ -16,13 +16,13 @@ stdenv.mkDerivation rec { pname = "ytfzf"; - version = "1.1.4"; + version = "1.1.5"; src = fetchFromGitHub { owner = "pystardust"; repo = "ytfzf"; rev = "v${version}"; - sha256 = "sha256-zRzd+rZxT5IJoFJl9sutTdQC4eMDUCBld5bTGfQWtco="; + sha256 = "sha256-NkJjh/Ys0Ypm8NTy/ZrQ4hIAjP5VGrpU73wjAMsZnAc="; }; patches = [ From e2160c95cdcf4d8f24aeb8573ddb4f83baf7556e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Sat, 1 May 2021 21:43:26 -0300 Subject: [PATCH 23/59] mate.mate-session-manager: 1.24.2 -> 1.24.3 --- pkgs/desktops/mate/mate-session-manager/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/mate/mate-session-manager/default.nix b/pkgs/desktops/mate/mate-session-manager/default.nix index c0cd12bd273..f790b0f65dc 100644 --- a/pkgs/desktops/mate/mate-session-manager/default.nix +++ b/pkgs/desktops/mate/mate-session-manager/default.nix @@ -5,11 +5,11 @@ stdenv.mkDerivation rec { pname = "mate-session-manager"; - version = "1.24.2"; + version = "1.24.3"; src = fetchurl { url = "https://pub.mate-desktop.org/releases/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - sha256 = "1jcb5k2fx2rwwbrslgv1xlzaiwiwjnxjwnp503qf8cg89w69q2vb"; + sha256 = "18mhv8dq18hvx28gi88c9499s3s1nsq55m64sas8fqlvnp2sx84h"; }; patches = [ From e52379118b7fd6b5cae69a918bcce80c689ef868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Sat, 1 May 2021 21:48:03 -0300 Subject: [PATCH 24/59] lxqt.lxqt-powermanagement: 0.17.0 -> 0.17.1 --- pkgs/desktops/lxqt/lxqt-powermanagement/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/lxqt/lxqt-powermanagement/default.nix b/pkgs/desktops/lxqt/lxqt-powermanagement/default.nix index a1b06806740..3713bcf0bb5 100644 --- a/pkgs/desktops/lxqt/lxqt-powermanagement/default.nix +++ b/pkgs/desktops/lxqt/lxqt-powermanagement/default.nix @@ -18,13 +18,13 @@ mkDerivation rec { pname = "lxqt-powermanagement"; - version = "0.17.0"; + version = "0.17.1"; src = fetchFromGitHub { owner = "lxqt"; repo = pname; rev = version; - sha256 = "1ikkksg5k7jwph7060h8wyk7bdsywvhl47zp23j5gcig0nk62ggf"; + sha256 = "04prx15l05kw97mwajc8yi2s7p3n6amzs5jnnmh9payxzp6glzmk"; }; nativeBuildInputs = [ From 966480b59afad608d4d87db39015a1a5ac0e90a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= Date: Sat, 1 May 2021 21:54:51 -0300 Subject: [PATCH 25/59] lxqt.obconf-qt: 0.16.0 -> 0.16.1 --- pkgs/desktops/lxqt/obconf-qt/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/lxqt/obconf-qt/default.nix b/pkgs/desktops/lxqt/obconf-qt/default.nix index 442c4c940b0..18d3f9899b4 100644 --- a/pkgs/desktops/lxqt/obconf-qt/default.nix +++ b/pkgs/desktops/lxqt/obconf-qt/default.nix @@ -15,13 +15,13 @@ mkDerivation rec { pname = "obconf-qt"; - version = "0.16.0"; + version = "0.16.1"; src = fetchFromGitHub { owner = "lxqt"; repo = pname; rev = version; - sha256 = "0kk5scp1j0hqi27q3yl9cg73ybxzm22nj96pa8adhdn4shg9bpac"; + sha256 = "1nw2r3h7ynmygpslnzjn40vvickd988nm31wy2b645xcck89q4rm"; }; nativeBuildInputs = [ From 3266b763eafb61dc5eeec7b5945321b2842e4085 Mon Sep 17 00:00:00 2001 From: Thomas Gerbet Date: Sun, 2 May 2021 10:16:11 +0200 Subject: [PATCH 26/59] mujs: 1.1.1 -> 1.1.2 https://git.ghostscript.com/?p=mujs.git;a=log;h=1.1.2 The fix for the use-after-free included in this release might have a security impact. --- pkgs/development/interpreters/mujs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/mujs/default.nix b/pkgs/development/interpreters/mujs/default.nix index d9b52af9254..46f86f85fc3 100644 --- a/pkgs/development/interpreters/mujs/default.nix +++ b/pkgs/development/interpreters/mujs/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "mujs"; - version = "1.1.1"; + version = "1.1.2"; src = fetchurl { url = "https://mujs.com/downloads/mujs-${version}.tar.xz"; - sha256 = "sha256-meYfyWGfHVULVjVyA7NJ2Ih9CjbffblWc1yijU/3e7A="; + sha256 = "sha256-cZ6IK7fZhkDvoWM4Hpto7xzjXIekIuKqQZDJ5AIlh10="; }; buildInputs = [ readline ]; From dc9e5ac607f4d3b41c07e70bec6830159a415b74 Mon Sep 17 00:00:00 2001 From: George Shammas Date: Sun, 2 May 2021 08:21:07 -0400 Subject: [PATCH 27/59] citrix_workspace: fix build / add mesa dependency --- .../networking/remote/citrix-workspace/generic.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/remote/citrix-workspace/generic.nix b/pkgs/applications/networking/remote/citrix-workspace/generic.nix index 35faeb20b75..8b1ef3c5863 100644 --- a/pkgs/applications/networking/remote/citrix-workspace/generic.nix +++ b/pkgs/applications/networking/remote/citrix-workspace/generic.nix @@ -1,7 +1,7 @@ { lib, stdenv, requireFile, makeWrapper, autoPatchelfHook, wrapGAppsHook, which, more , file, atk, alsaLib, cairo, fontconfig, gdk-pixbuf, glib, gnome3, gtk2-x11, gtk3 , heimdal, krb5, libsoup, libvorbis, speex, openssl, zlib, xorg, pango, gtk2 -, gnome2, nss, nspr, gtk_engines, freetype, dconf, libpng12, libxml2 +, gnome2, mesa, nss, nspr, gtk_engines, freetype, dconf, libpng12, libxml2 , libjpeg, libredirect, tzdata, cacert, systemd, libcxxabi, libcxx, e2fsprogs, symlinkJoin , libpulseaudio, pcsclite @@ -84,6 +84,7 @@ stdenv.mkDerivation rec { libsoup libvorbis libxml2 + mesa nspr nss openssl' From 4b5ab919049fa05a96fdc47d4cb69b4209adcaf9 Mon Sep 17 00:00:00 2001 From: fortuneteller2k Date: Sun, 2 May 2021 23:37:24 +0800 Subject: [PATCH 28/59] xcolor: init at unstable-2021-02-02 --- pkgs/tools/graphics/xcolor/default.nix | 26 ++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 28 insertions(+) create mode 100644 pkgs/tools/graphics/xcolor/default.nix diff --git a/pkgs/tools/graphics/xcolor/default.nix b/pkgs/tools/graphics/xcolor/default.nix new file mode 100644 index 00000000000..f19a80357f3 --- /dev/null +++ b/pkgs/tools/graphics/xcolor/default.nix @@ -0,0 +1,26 @@ +{ lib, rustPlatform, fetchFromGitHub, pkg-config, libX11, libXcursor, libxcb, python3 }: + +rustPlatform.buildRustPackage rec { + pname = "xcolor"; + version = "unstable-2021-02-02"; + + src = fetchFromGitHub { + owner = "Soft"; + repo = pname; + rev = "0e99e67cd37000bf563aa1e89faae796ec25f163"; + sha256 = "sha256-rHqK05dN5lrvDNbRCWGghI7KJwWzNCuRDEThEeMzmio="; + }; + + cargoSha256 = "sha256-lHOT/P1Sh1b53EkPIQM3l9Tozdqh60qlUDdjthj32jM="; + + nativeBuildInputs = [ pkg-config python3 ]; + + buildInputs = [ libX11 libXcursor libxcb ]; + + meta = with lib; { + description = "Lightweight color picker for X11"; + homepage = "https://github.com/Soft/xcolor"; + maintainers = with lib.maintainers; [ fortuneteller2k ]; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9d370bd80f8..a0d0d12d35b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31252,5 +31252,7 @@ in lc3tools = callPackage ../development/tools/lc3tools {}; + xcolor = callPackage ../tools/graphics/xcolor { }; + zktree = callPackage ../applications/misc/zktree {}; } From 7985d9e4ac13831c458efe99f1ca07c7feb7a164 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Thu, 11 Mar 2021 01:20:41 +0000 Subject: [PATCH 29/59] lego: 4.2.0 -> 4.3.1 https://github.com/go-acme/lego/releases/tag/v4.3.0 https://github.com/go-acme/lego/releases/tag/v4.3.1 --- pkgs/tools/admin/lego/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/admin/lego/default.nix b/pkgs/tools/admin/lego/default.nix index a825908484c..4553242d663 100644 --- a/pkgs/tools/admin/lego/default.nix +++ b/pkgs/tools/admin/lego/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "lego"; - version = "4.2.0"; + version = "4.3.1"; src = fetchFromGitHub { owner = "go-acme"; repo = pname; rev = "v${version}"; - sha256 = "sha256-S9I6b9+FngX0/W5t3EHG+H1ULsZKoQw1/S4HnSITYG0="; + sha256 = "0mmr7fcqgbmr0b1fc49p6wjn7axxayyj420fxhhdvkd4nv8fxh1q"; }; - vendorSha256 = "sha256-dVGSMPhAvN/kWgv3XHS+lOZdcbDNL44ELkv7fHAJWlI="; + vendorSha256 = "04d141kjzqcjiwv6sd0sbrgsr7a99dvblm19gwzczljkfgi60q8w"; doCheck = false; From 7b3df912364d5434fc5f2eb1318749042013743e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 2 May 2021 20:22:58 +0200 Subject: [PATCH 30/59] libadwaita: init at unstable-2021-05-01 --- .../libraries/libadwaita/default.nix | 67 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 69 insertions(+) create mode 100644 pkgs/development/libraries/libadwaita/default.nix diff --git a/pkgs/development/libraries/libadwaita/default.nix b/pkgs/development/libraries/libadwaita/default.nix new file mode 100644 index 00000000000..92ea7076821 --- /dev/null +++ b/pkgs/development/libraries/libadwaita/default.nix @@ -0,0 +1,67 @@ +{ lib +, stdenv +, fetchFromGitLab +, docbook_xsl +, gtk-doc +, meson +, ninja +, pkg-config +, sassc +, vala +, gobject-introspection +, gtk4 +, xvfb_run +}: + +stdenv.mkDerivation rec { + pname = "libadwaita"; + version = "unstable-2021-05-01"; + + outputs = [ "out" "dev" "devdoc" ]; + outputBin = [ "dev" ]; + + src = fetchFromGitLab { + domain = "gitlab.gnome.org"; + owner = "GNOME"; + repo = "libadwaita"; + rev = "8d66b987a19979d9d7b85dacc6bad5ce0c8743fe"; + sha256 = "0i3wav6jsyi4w4i2r1rad769m5y5s9djj4zqb7dfyh0bad24ba3q"; + }; + + nativeBuildInputs = [ + docbook_xsl + gtk-doc + meson + ninja + pkg-config + sassc + vala + ]; + + mesonFlags = [ + "-Dgtk_doc=true" + ]; + + buildInputs = [ + gobject-introspection + gtk4 + ]; + + checkInputs = [ + xvfb_run + ]; + + doCheck = true; + + checkPhase = '' + xvfb-run meson test + ''; + + meta = with lib; { + description = "Library to help with developing UI for mobile devices using GTK/GNOME"; + homepage = "https://gitlab.gnome.org/GNOME/libadwaita"; + license = licenses.lgpl21Plus; + maintainers = with maintainers; [ dotlambda ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2d6636416ee..692b02f386f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15239,6 +15239,8 @@ in libacr38u = callPackage ../tools/security/libacr38u { }; + libadwaita = callPackage ../development/libraries/libadwaita { }; + libaec = callPackage ../development/libraries/libaec { }; libagar = callPackage ../development/libraries/libagar { }; From 649672e76e507440259a158d564b7a6185179ef9 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 2 May 2021 21:49:33 +0000 Subject: [PATCH 31/59] nixos/postfix: fix compatibility level Postfix has started outputting an error on startup that it can't parse the compatibility level 9999. Instead, just set the compatibility level to be identical to the current version, which seems to be the (new) intent for the compatibility level. --- nixos/modules/services/mail/postfix.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/mail/postfix.nix b/nixos/modules/services/mail/postfix.nix index 8e5bed5fcb8..35639e1bbc8 100644 --- a/nixos/modules/services/mail/postfix.nix +++ b/nixos/modules/services/mail/postfix.nix @@ -773,7 +773,7 @@ in }; services.postfix.config = (mapAttrs (_: v: mkDefault v) { - compatibility_level = "9999"; + compatibility_level = pkgs.postfix.version; mail_owner = cfg.user; default_privs = "nobody"; From a6fb22a689978e1695d27fc5ebf14ef67786c8f9 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 2 May 2021 21:50:17 +0000 Subject: [PATCH 32/59] nixos/tests/rspamd: increase memory rspamd seems to be consuming more memory now sometimes, causing OOMs in the test. Increase the memory given to these VMs to make the tests pass more reliably. --- nixos/tests/rspamd.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nixos/tests/rspamd.nix b/nixos/tests/rspamd.nix index f0ccfe7ea0e..3fd55444fd8 100644 --- a/nixos/tests/rspamd.nix +++ b/nixos/tests/rspamd.nix @@ -25,6 +25,7 @@ let machine = { services.rspamd.enable = true; networking.enableIPv6 = enableIPv6; + virtualisation.memorySize = 1024; }; testScript = '' start_all() @@ -68,6 +69,7 @@ in group = "rspamd"; }]; }; + virtualisation.memorySize = 1024; }; testScript = '' @@ -116,6 +118,7 @@ in ''; }; }; + virtualisation.memorySize = 1024; }; testScript = '' @@ -221,6 +224,7 @@ in rspamd_logger.infox(rspamd_config, 'Work dammit!!!') ''; }; + virtualisation.memorySize = 1024; }; testScript = '' ${initMachine} @@ -287,6 +291,7 @@ in postfix.enable = true; workers.rspamd_proxy.type = "rspamd_proxy"; }; + virtualisation.memorySize = 1024; }; testScript = '' ${initMachine} From f2a91ec2b7cbb0b24c99d28a8622ecc72a0ad031 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 2 May 2021 21:58:43 +0000 Subject: [PATCH 33/59] nixos/tests/gitdaemon: deflake by using systemd-tmpfiles git-daemon won't start up if its project directory (here /git) doesn't exist. If we try to create it using the test harness, then we're racing whether we manage to connect to the backdoor vs. the startup speed of git-daemon. Instead, use systemd-tmpfiles, which is guaranteed(?) to run before network.target and thus before git-daemon.service starts. --- nixos/tests/gitdaemon.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/tests/gitdaemon.nix b/nixos/tests/gitdaemon.nix index d0156fb9a49..bb07b6e97b7 100644 --- a/nixos/tests/gitdaemon.nix +++ b/nixos/tests/gitdaemon.nix @@ -18,6 +18,11 @@ in { environment.systemPackages = [ pkgs.git ]; + systemd.tmpfiles.rules = [ + # type path mode user group age arg + " d /git 0755 root root - -" + ]; + services.gitDaemon = { enable = true; basePath = "/git"; @@ -35,7 +40,6 @@ in { with subtest("create project.git"): server.succeed( - "mkdir /git", "git init --bare /git/project.git", "touch /git/project.git/git-daemon-export-ok", ) From 27d0a91fd4e57c17417b91344366e6c8210dfeda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 2 May 2021 20:23:40 +0200 Subject: [PATCH 34/59] authenticator: init at 4.0.3 --- .../applications/misc/authenticator/767.patch | 1952 +++++++++++++++++ .../misc/authenticator/default.nix | 98 + pkgs/top-level/all-packages.nix | 2 + 3 files changed, 2052 insertions(+) create mode 100644 pkgs/applications/misc/authenticator/767.patch create mode 100644 pkgs/applications/misc/authenticator/default.nix diff --git a/pkgs/applications/misc/authenticator/767.patch b/pkgs/applications/misc/authenticator/767.patch new file mode 100644 index 00000000000..2c4bf63128b --- /dev/null +++ b/pkgs/applications/misc/authenticator/767.patch @@ -0,0 +1,1952 @@ +From 70588b2f2191bdb8d6859e0a0c50a87e24237bba Mon Sep 17 00:00:00 2001 +From: Rafostar <40623528+Rafostar@users.noreply.github.com> +Date: Wed, 30 Dec 2020 11:24:49 +0100 +Subject: [PATCH 01/10] gtk: port to event controllers + +Prepare for GTK4 support by porting deprecated events +to EventControllers. This also bumps minimal required GTK version to 3.24 +--- + ext/gtk/gtkgstbasewidget.c | 96 +++++++++++++++++++++++++------------- + ext/gtk/gtkgstbasewidget.h | 6 +++ + ext/gtk/meson.build | 2 +- + 3 files changed, 70 insertions(+), 34 deletions(-) + +diff --git a/ext/gtk/gtkgstbasewidget.c b/ext/gtk/gtkgstbasewidget.c +index 4858f2764..5d57b0ee7 100644 +--- a/ext/gtk/gtkgstbasewidget.c ++++ b/ext/gtk/gtkgstbasewidget.c +@@ -235,22 +235,34 @@ _gdk_key_to_navigation_string (guint keyval) + } + } + ++static void ++_gdk_event_free (GdkEvent * event) ++{ ++ if (event) ++ gdk_event_free (event); ++} ++ + static gboolean +-gtk_gst_base_widget_key_event (GtkWidget * widget, GdkEventKey * event) ++gtk_gst_base_widget_key_event (GtkEventControllerKey * key_controller, ++ guint keyval, guint keycode, GdkModifierType state) + { ++ GtkEventController *controller = GTK_EVENT_CONTROLLER (key_controller); ++ GtkWidget *widget = gtk_event_controller_get_widget (controller); + GtkGstBaseWidget *base_widget = GTK_GST_BASE_WIDGET (widget); + GstElement *element; + + if ((element = g_weak_ref_get (&base_widget->element))) { + if (GST_IS_NAVIGATION (element)) { +- const gchar *str = _gdk_key_to_navigation_string (event->keyval); +- const gchar *key_type = +- event->type == GDK_KEY_PRESS ? "key-press" : "key-release"; +- +- if (!str) +- str = event->string; +- +- gst_navigation_send_key_event (GST_NAVIGATION (element), key_type, str); ++ GdkEvent *event = gtk_get_current_event (); ++ const gchar *str = _gdk_key_to_navigation_string (keyval); ++ ++ if (str) { ++ const gchar *key_type = ++ gdk_event_get_event_type (event) == ++ GDK_KEY_PRESS ? "key-press" : "key-release"; ++ gst_navigation_send_key_event (GST_NAVIGATION (element), key_type, str); ++ } ++ _gdk_event_free (event); + } + g_object_unref (element); + } +@@ -325,22 +337,30 @@ _display_size_to_stream_size (GtkGstBaseWidget * base_widget, gdouble x, + } + + static gboolean +-gtk_gst_base_widget_button_event (GtkWidget * widget, GdkEventButton * event) ++gtk_gst_base_widget_button_event (GtkGestureMultiPress * gesture, ++ gint n_press, gdouble x, gdouble y) + { ++ GtkEventController *controller = GTK_EVENT_CONTROLLER (gesture); ++ GtkWidget *widget = gtk_event_controller_get_widget (controller); + GtkGstBaseWidget *base_widget = GTK_GST_BASE_WIDGET (widget); + GstElement *element; + + if ((element = g_weak_ref_get (&base_widget->element))) { + if (GST_IS_NAVIGATION (element)) { ++ GdkEvent *event = gtk_get_current_event (); + const gchar *key_type = +- event->type == +- GDK_BUTTON_PRESS ? "mouse-button-press" : "mouse-button-release"; +- gdouble x, y; ++ gdk_event_get_event_type (event) == GDK_BUTTON_PRESS ++ ? "mouse-button-press" : "mouse-button-release"; ++ gdouble stream_x, stream_y; ++ guint button; ++ gdk_event_get_button (event, &button); + +- _display_size_to_stream_size (base_widget, event->x, event->y, &x, &y); ++ _display_size_to_stream_size (base_widget, x, y, &stream_x, &stream_y); + + gst_navigation_send_mouse_event (GST_NAVIGATION (element), key_type, +- event->button, x, y); ++ button, stream_x, stream_y); ++ ++ _gdk_event_free (event); + } + g_object_unref (element); + } +@@ -349,19 +369,22 @@ gtk_gst_base_widget_button_event (GtkWidget * widget, GdkEventButton * event) + } + + static gboolean +-gtk_gst_base_widget_motion_event (GtkWidget * widget, GdkEventMotion * event) ++gtk_gst_base_widget_motion_event (GtkEventControllerMotion * motion_controller, ++ gdouble x, gdouble y) + { ++ GtkEventController *controller = GTK_EVENT_CONTROLLER (motion_controller); ++ GtkWidget *widget = gtk_event_controller_get_widget (controller); + GtkGstBaseWidget *base_widget = GTK_GST_BASE_WIDGET (widget); + GstElement *element; + + if ((element = g_weak_ref_get (&base_widget->element))) { + if (GST_IS_NAVIGATION (element)) { +- gdouble x, y; ++ gdouble stream_x, stream_y; + +- _display_size_to_stream_size (base_widget, event->x, event->y, &x, &y); ++ _display_size_to_stream_size (base_widget, x, y, &stream_x, &stream_y); + + gst_navigation_send_mouse_event (GST_NAVIGATION (element), "mouse-move", +- 0, x, y); ++ 0, stream_x, stream_y); + } + g_object_unref (element); + } +@@ -397,11 +420,6 @@ gtk_gst_base_widget_class_init (GtkGstBaseWidgetClass * klass) + + widget_klass->get_preferred_width = gtk_gst_base_widget_get_preferred_width; + widget_klass->get_preferred_height = gtk_gst_base_widget_get_preferred_height; +- widget_klass->key_press_event = gtk_gst_base_widget_key_event; +- widget_klass->key_release_event = gtk_gst_base_widget_key_event; +- widget_klass->button_press_event = gtk_gst_base_widget_button_event; +- widget_klass->button_release_event = gtk_gst_base_widget_button_event; +- widget_klass->motion_notify_event = gtk_gst_base_widget_motion_event; + + GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_base_widget, "gtkbasewidget", 0, + "Gtk Video Base Widget"); +@@ -410,8 +428,6 @@ gtk_gst_base_widget_class_init (GtkGstBaseWidgetClass * klass) + void + gtk_gst_base_widget_init (GtkGstBaseWidget * widget) + { +- int event_mask; +- + widget->force_aspect_ratio = DEFAULT_FORCE_ASPECT_RATIO; + widget->par_n = DEFAULT_PAR_N; + widget->par_d = DEFAULT_PAR_D; +@@ -423,14 +439,24 @@ gtk_gst_base_widget_init (GtkGstBaseWidget * widget) + g_weak_ref_init (&widget->element, NULL); + g_mutex_init (&widget->lock); + ++ widget->key_controller = gtk_event_controller_key_new (GTK_WIDGET (widget)); ++ g_signal_connect (widget->key_controller, "key-pressed", ++ G_CALLBACK (gtk_gst_base_widget_key_event), NULL); ++ g_signal_connect (widget->key_controller, "key-released", ++ G_CALLBACK (gtk_gst_base_widget_key_event), NULL); ++ ++ widget->motion_controller = ++ gtk_event_controller_motion_new (GTK_WIDGET (widget)); ++ g_signal_connect (widget->motion_controller, "motion", ++ G_CALLBACK (gtk_gst_base_widget_motion_event), NULL); ++ ++ widget->click_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (widget)); ++ g_signal_connect (widget->click_gesture, "pressed", ++ G_CALLBACK (gtk_gst_base_widget_button_event), NULL); ++ g_signal_connect (widget->click_gesture, "released", ++ G_CALLBACK (gtk_gst_base_widget_button_event), NULL); ++ + gtk_widget_set_can_focus (GTK_WIDGET (widget), TRUE); +- event_mask = gtk_widget_get_events (GTK_WIDGET (widget)); +- event_mask |= GDK_KEY_PRESS_MASK +- | GDK_KEY_RELEASE_MASK +- | GDK_BUTTON_PRESS_MASK +- | GDK_BUTTON_RELEASE_MASK +- | GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK; +- gtk_widget_set_events (GTK_WIDGET (widget), event_mask); + } + + void +@@ -438,6 +464,10 @@ gtk_gst_base_widget_finalize (GObject * object) + { + GtkGstBaseWidget *widget = GTK_GST_BASE_WIDGET (object); + ++ g_object_unref (widget->key_controller); ++ g_object_unref (widget->motion_controller); ++ g_object_unref (widget->click_gesture); ++ + gst_buffer_replace (&widget->pending_buffer, NULL); + gst_buffer_replace (&widget->buffer, NULL); + g_mutex_clear (&widget->lock); +diff --git a/ext/gtk/gtkgstbasewidget.h b/ext/gtk/gtkgstbasewidget.h +index 13737c632..0e31478a0 100644 +--- a/ext/gtk/gtkgstbasewidget.h ++++ b/ext/gtk/gtkgstbasewidget.h +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + #define GTK_GST_BASE_WIDGET(w) ((GtkGstBaseWidget *)(w)) + #define GTK_GST_BASE_WIDGET_CLASS(k) ((GtkGstBaseWidgetClass *)(k)) +@@ -67,6 +68,11 @@ struct _GtkGstBaseWidget + GMutex lock; + GWeakRef element; + ++ /* event controllers */ ++ GtkEventController *key_controller; ++ GtkEventController *motion_controller; ++ GtkGesture *click_gesture; ++ + /* Pending draw idles callback */ + guint draw_id; + }; +diff --git a/ext/gtk/meson.build b/ext/gtk/meson.build +index 3a30017e7..722775e08 100644 +--- a/ext/gtk/meson.build ++++ b/ext/gtk/meson.build +@@ -13,7 +13,7 @@ optional_deps = [] + gtk_dep = dependency('gtk+-3.0', required : get_option('gtk3')) + if gtk_dep.found() + # FIXME: automagic +- if have_gstgl and gtk_dep.version().version_compare('>=3.15.0') ++ if have_gstgl and gtk_dep.version().version_compare('>=3.24.0') + have_gtk3_gl_windowing = false + + if gst_gl_have_window_x11 and gst_gl_have_platform_glx +-- +GitLab + + +From 29774cbcd256b86f074bd50b40f4a57607758bf3 Mon Sep 17 00:00:00 2001 +From: Rafostar <40623528+Rafostar@users.noreply.github.com> +Date: Fri, 1 Jan 2021 17:30:23 +0100 +Subject: [PATCH 02/10] gtk: do not connect the same signals on each start + +Each time the sink start is called the same signals +were reconnected without disconnecting them earlier. + +We should still observe widget destruction even when +stopped, so lets just prevent connecting it multiple +times and disconnect only size-allocate signal on stop. +--- + ext/gtk/gstgtkglsink.c | 32 +++++++++++++++++++++++--------- + 1 file changed, 23 insertions(+), 9 deletions(-) + +diff --git a/ext/gtk/gstgtkglsink.c b/ext/gtk/gstgtkglsink.c +index 1102d47c9..3024bef95 100644 +--- a/ext/gtk/gstgtkglsink.c ++++ b/ext/gtk/gstgtkglsink.c +@@ -172,13 +172,17 @@ gst_gtk_gl_sink_start (GstBaseSink * bsink) + gst_widget = GTK_GST_GL_WIDGET (base_sink->widget); + + /* Track the allocation size */ +- gtk_sink->size_allocate_sig_handler = +- g_signal_connect (gst_widget, "size-allocate", +- G_CALLBACK (_size_changed_cb), gtk_sink); ++ if (!gtk_sink->size_allocate_sig_handler) { ++ gtk_sink->size_allocate_sig_handler = ++ g_signal_connect (gst_widget, "size-allocate", ++ G_CALLBACK (_size_changed_cb), gtk_sink); ++ } + +- gtk_sink->widget_destroy_sig_handler = +- g_signal_connect (gst_widget, "destroy", G_CALLBACK (destroy_cb), +- gtk_sink); ++ if (!gtk_sink->widget_destroy_sig_handler) { ++ gtk_sink->widget_destroy_sig_handler = ++ g_signal_connect (gst_widget, "destroy", G_CALLBACK (destroy_cb), ++ gtk_sink); ++ } + + _size_changed_cb (GTK_WIDGET (gst_widget), NULL, gtk_sink); + +@@ -188,9 +192,12 @@ gst_gtk_gl_sink_start (GstBaseSink * bsink) + return FALSE; + } + +- gtk_sink->display = gtk_gst_gl_widget_get_display (gst_widget); +- gtk_sink->context = gtk_gst_gl_widget_get_context (gst_widget); +- gtk_sink->gtk_context = gtk_gst_gl_widget_get_gtk_context (gst_widget); ++ if (!gtk_sink->display) ++ gtk_sink->display = gtk_gst_gl_widget_get_display (gst_widget); ++ if (!gtk_sink->context) ++ gtk_sink->context = gtk_gst_gl_widget_get_context (gst_widget); ++ if (!gtk_sink->gtk_context) ++ gtk_sink->gtk_context = gtk_gst_gl_widget_get_gtk_context (gst_widget); + + if (!gtk_sink->display || !gtk_sink->context || !gtk_sink->gtk_context) { + GST_ELEMENT_ERROR (bsink, RESOURCE, NOT_FOUND, ("%s", +@@ -208,6 +215,13 @@ static gboolean + gst_gtk_gl_sink_stop (GstBaseSink * bsink) + { + GstGtkGLSink *gtk_sink = GST_GTK_GL_SINK (bsink); ++ GstGtkBaseSink *base_sink = GST_GTK_BASE_SINK (bsink); ++ ++ if (gtk_sink->size_allocate_sig_handler) { ++ g_signal_handler_disconnect (base_sink->widget, ++ gtk_sink->size_allocate_sig_handler); ++ gtk_sink->size_allocate_sig_handler = 0; ++ } + + if (gtk_sink->display) { + gst_object_unref (gtk_sink->display); +-- +GitLab + + +From 754b6b50d2d266c07c360ca72a62f368be664eef Mon Sep 17 00:00:00 2001 +From: Rafostar <40623528+Rafostar@users.noreply.github.com> +Date: Wed, 14 Oct 2020 16:25:53 +0200 +Subject: [PATCH 03/10] gtkglsink: add GTK4 support + +This commit adds required changes to compile the "gtk" plugin +against GTK4 from the same source code. + +The output "gtk4" plugin includes new "gtk4glsink". +--- + ext/gtk/gstgtkbasesink.c | 70 ++++++++++++++++++++++++----- + ext/gtk/gstgtkglsink.c | 29 ++++++++---- + ext/gtk/gstplugin.c | 19 +++++--- + ext/gtk/gtkconfig.h | 29 ++++++++++++ + ext/gtk/gtkgstbasewidget.c | 91 ++++++++++++++++++++++++++++++++++---- + ext/gtk/gtkgstbasewidget.h | 12 +++-- + ext/gtk/gtkgstglwidget.c | 15 ++++++- + ext/gtk/meson.build | 84 ++++++++++++++++++++++++----------- + meson_options.txt | 1 + + 9 files changed, 284 insertions(+), 66 deletions(-) + create mode 100644 ext/gtk/gtkconfig.h + +diff --git a/ext/gtk/gstgtkbasesink.c b/ext/gtk/gstgtkbasesink.c +index 0c48f54d6..1f5319089 100644 +--- a/ext/gtk/gstgtkbasesink.c ++++ b/ext/gtk/gstgtkbasesink.c +@@ -1,6 +1,7 @@ + /* + * GStreamer + * Copyright (C) 2015 Matthew Waters ++ * Copyright (C) 2020 Rafał Dzięgiel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public +@@ -77,7 +78,7 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstGtkBaseSink, gst_gtk_base_sink, + G_IMPLEMENT_INTERFACE (GST_TYPE_NAVIGATION, + gst_gtk_base_sink_navigation_interface_init); + GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_base_sink, +- "gtkbasesink", 0, "Gtk Video Sink base class")); ++ "gtkbasesink", 0, "GTK Video Sink base class")); + + + static void +@@ -97,7 +98,7 @@ gst_gtk_base_sink_class_init (GstGtkBaseSinkClass * klass) + gobject_class->get_property = gst_gtk_base_sink_get_property; + + g_object_class_install_property (gobject_class, PROP_WIDGET, +- g_param_spec_object ("widget", "Gtk Widget", ++ g_param_spec_object ("widget", "GTK Widget", + "The GtkWidget to place in the widget hierarchy " + "(must only be get from the GTK main thread)", + GTK_TYPE_WIDGET, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); +@@ -114,10 +115,13 @@ gst_gtk_base_sink_class_init (GstGtkBaseSinkClass * klass) + "The pixel aspect ratio of the device", DEFAULT_PAR_N, DEFAULT_PAR_D, + G_MAXINT, 1, 1, 1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + ++ /* Disabling alpha was removed in GTK4 */ ++#if !defined(BUILD_FOR_GTK4) + g_object_class_install_property (gobject_class, PROP_IGNORE_ALPHA, + g_param_spec_boolean ("ignore-alpha", "Ignore Alpha", + "When enabled, alpha will be ignored and converted to black", + DEFAULT_IGNORE_ALPHA, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); ++#endif + + gobject_class->finalize = gst_gtk_base_sink_finalize; + +@@ -182,7 +186,11 @@ gst_gtk_base_sink_get_widget (GstGtkBaseSink * gtk_sink) + + /* Ensure GTK is initialized, this has no side effect if it was already + * initialized. Also, we do that lazily, so the application can be first */ +- if (!gtk_init_check (NULL, NULL)) { ++ if (!gtk_init_check ( ++#if !defined(BUILD_FOR_GTK4) ++ NULL, NULL ++#endif ++ )) { + GST_ERROR_OBJECT (gtk_sink, "Could not ensure GTK initialization."); + return NULL; + } +@@ -197,9 +205,11 @@ gst_gtk_base_sink_get_widget (GstGtkBaseSink * gtk_sink) + gtk_sink->bind_pixel_aspect_ratio = + g_object_bind_property (gtk_sink, "pixel-aspect-ratio", gtk_sink->widget, + "pixel-aspect-ratio", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); ++#if !defined(BUILD_FOR_GTK4) + gtk_sink->bind_ignore_alpha = + g_object_bind_property (gtk_sink, "ignore-alpha", gtk_sink->widget, + "ignore-alpha", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); ++#endif + + /* Take the floating ref, other wise the destruction of the container will + * make this widget disappear possibly before we are done. */ +@@ -313,25 +323,55 @@ gst_gtk_base_sink_start_on_main (GstBaseSink * bsink) + GstGtkBaseSink *gst_sink = GST_GTK_BASE_SINK (bsink); + GstGtkBaseSinkClass *klass = GST_GTK_BASE_SINK_GET_CLASS (bsink); + GtkWidget *toplevel; ++#if defined(BUILD_FOR_GTK4) ++ GtkRoot *root; ++#endif + + if (gst_gtk_base_sink_get_widget (gst_sink) == NULL) + return FALSE; + + /* After this point, gtk_sink->widget will always be set */ + ++#if defined(BUILD_FOR_GTK4) ++ root = gtk_widget_get_root (GTK_WIDGET (gst_sink->widget)); ++ if (!GTK_IS_ROOT (root)) { ++ GtkWidget *parent = gtk_widget_get_parent (GTK_WIDGET (gst_sink->widget)); ++ if (parent) { ++ GtkWidget *temp_parent; ++ while ((temp_parent = gtk_widget_get_parent (parent))) ++ parent = temp_parent; ++ } ++ toplevel = (parent) ? parent : GTK_WIDGET (gst_sink->widget); ++#else + toplevel = gtk_widget_get_toplevel (GTK_WIDGET (gst_sink->widget)); + if (!gtk_widget_is_toplevel (toplevel)) { ++#endif + /* sanity check */ + g_assert (klass->window_title); + + /* User did not add widget its own UI, let's popup a new GtkWindow to + * make gst-launch-1.0 work. */ +- gst_sink->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); ++ gst_sink->window = gtk_window_new ( ++#if !defined(BUILD_FOR_GTK4) ++ GTK_WINDOW_TOPLEVEL ++#endif ++ ); + gtk_window_set_default_size (GTK_WINDOW (gst_sink->window), 640, 480); + gtk_window_set_title (GTK_WINDOW (gst_sink->window), klass->window_title); +- gtk_container_add (GTK_CONTAINER (gst_sink->window), toplevel); +- gst_sink->window_destroy_id = g_signal_connect (gst_sink->window, "destroy", +- G_CALLBACK (window_destroy_cb), gst_sink); ++#if defined(BUILD_FOR_GTK4) ++ gtk_window_set_child (GTK_WINDOW ( ++#else ++ gtk_container_add (GTK_CONTAINER ( ++#endif ++ gst_sink->window), toplevel); ++ ++ gst_sink->window_destroy_id = g_signal_connect ( ++#if defined(BUILD_FOR_GTK4) ++ GTK_WINDOW (gst_sink->window), ++#else ++ gst_sink->window, ++#endif ++ "destroy", G_CALLBACK (window_destroy_cb), gst_sink); + } + + return TRUE; +@@ -350,7 +390,11 @@ gst_gtk_base_sink_stop_on_main (GstBaseSink * bsink) + GstGtkBaseSink *gst_sink = GST_GTK_BASE_SINK (bsink); + + if (gst_sink->window) { ++#if defined(BUILD_FOR_GTK4) ++ gtk_window_destroy (GTK_WINDOW (gst_sink->window)); ++#else + gtk_widget_destroy (gst_sink->window); ++#endif + gst_sink->window = NULL; + gst_sink->widget = NULL; + } +@@ -371,10 +415,14 @@ gst_gtk_base_sink_stop (GstBaseSink * bsink) + } + + static void +-gst_gtk_widget_show_all_and_unref (GtkWidget * widget) ++gst_gtk_window_show_all_and_unref (GtkWidget * window) + { +- gtk_widget_show_all (widget); +- g_object_unref (widget); ++#if defined(BUILD_FOR_GTK4) ++ gtk_window_present (GTK_WINDOW (window)); ++#else ++ gtk_widget_show_all (window); ++#endif ++ g_object_unref (window); + } + + static GstStateChangeReturn +@@ -402,7 +450,7 @@ gst_gtk_base_sink_change_state (GstElement * element, GstStateChange transition) + GST_OBJECT_UNLOCK (gtk_sink); + + if (window) +- gst_gtk_invoke_on_main ((GThreadFunc) gst_gtk_widget_show_all_and_unref, ++ gst_gtk_invoke_on_main ((GThreadFunc) gst_gtk_window_show_all_and_unref, + window); + + break; +diff --git a/ext/gtk/gstgtkglsink.c b/ext/gtk/gstgtkglsink.c +index 3024bef95..daaf0eb3f 100644 +--- a/ext/gtk/gstgtkglsink.c ++++ b/ext/gtk/gstgtkglsink.c +@@ -1,6 +1,7 @@ + /* + * GStreamer + * Copyright (C) 2015 Matthew Waters ++ * Copyright (C) 2020 Rafał Dzięgiel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public +@@ -23,12 +24,18 @@ + * @title: gtkglsink + */ + ++/** ++ * SECTION:element-gtk4glsink ++ * @title: gtk4glsink ++ */ ++ + #ifdef HAVE_CONFIG_H + #include "config.h" + #endif + + #include + ++#include "gtkconfig.h" + #include "gstgtkglsink.h" + #include "gtkgstglwidget.h" + +@@ -58,7 +65,7 @@ static GstStaticPadTemplate gst_gtk_gl_sink_template = + #define gst_gtk_gl_sink_parent_class parent_class + G_DEFINE_TYPE_WITH_CODE (GstGtkGLSink, gst_gtk_gl_sink, + GST_TYPE_GTK_BASE_SINK, GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_gl_sink, +- "gtkglsink", 0, "Gtk GL Video Sink")); ++ GTKCONFIG_GLSINK, 0, GTKCONFIG_NAME " GL Video Sink")); + + static void + gst_gtk_gl_sink_class_init (GstGtkGLSinkClass * klass) +@@ -82,11 +89,13 @@ gst_gtk_gl_sink_class_init (GstGtkGLSinkClass * klass) + gstbasesink_class->get_caps = gst_gtk_gl_sink_get_caps; + + gstgtkbasesink_class->create_widget = gtk_gst_gl_widget_new; +- gstgtkbasesink_class->window_title = "Gtk+ GL renderer"; ++ gstgtkbasesink_class->window_title = GTKCONFIG_NAME " GL Renderer"; + +- gst_element_class_set_metadata (gstelement_class, "Gtk GL Video Sink", ++ gst_element_class_set_metadata (gstelement_class, ++ GTKCONFIG_NAME " GL Video Sink", + "Sink/Video", "A video sink that renders to a GtkWidget using OpenGL", +- "Matthew Waters "); ++ "Matthew Waters , " ++ "Rafał Dzięgiel "); + + gst_element_class_add_static_pad_template (gstelement_class, + &gst_gtk_gl_sink_template); +@@ -119,6 +128,7 @@ gst_gtk_gl_sink_query (GstBaseSink * bsink, GstQuery * query) + return res; + } + ++#if !defined(BUILD_FOR_GTK4) + static void + _size_changed_cb (GtkWidget * widget, GdkRectangle * rectangle, + GstGtkGLSink * gtk_sink) +@@ -138,11 +148,12 @@ _size_changed_cb (GtkWidget * widget, GdkRectangle * rectangle, + GST_OBJECT_UNLOCK (gtk_sink); + + if (reconfigure) { +- GST_DEBUG_OBJECT (gtk_sink, "Sending reconfigure event on sinkpad."); ++ GST_DEBUG_OBJECT (gtk_sink, "Sending reconfigure event on sinkpad"); + gst_pad_push_event (GST_BASE_SINK (gtk_sink)->sinkpad, + gst_event_new_reconfigure ()); + } + } ++#endif + + static void + destroy_cb (GtkWidget * widget, GstGtkGLSink * gtk_sink) +@@ -171,12 +182,14 @@ gst_gtk_gl_sink_start (GstBaseSink * bsink) + /* After this point, gtk_sink->widget will always be set */ + gst_widget = GTK_GST_GL_WIDGET (base_sink->widget); + ++#if !defined(BUILD_FOR_GTK4) + /* Track the allocation size */ + if (!gtk_sink->size_allocate_sig_handler) { + gtk_sink->size_allocate_sig_handler = + g_signal_connect (gst_widget, "size-allocate", + G_CALLBACK (_size_changed_cb), gtk_sink); + } ++#endif + + if (!gtk_sink->widget_destroy_sig_handler) { + gtk_sink->widget_destroy_sig_handler = +@@ -184,11 +197,9 @@ gst_gtk_gl_sink_start (GstBaseSink * bsink) + gtk_sink); + } + +- _size_changed_cb (GTK_WIDGET (gst_widget), NULL, gtk_sink); +- + if (!gtk_gst_gl_widget_init_winsys (gst_widget)) { + GST_ELEMENT_ERROR (bsink, RESOURCE, NOT_FOUND, ("%s", +- "Failed to initialize OpenGL with Gtk"), (NULL)); ++ "Failed to initialize OpenGL with GTK"), (NULL)); + return FALSE; + } + +@@ -201,7 +212,7 @@ gst_gtk_gl_sink_start (GstBaseSink * bsink) + + if (!gtk_sink->display || !gtk_sink->context || !gtk_sink->gtk_context) { + GST_ELEMENT_ERROR (bsink, RESOURCE, NOT_FOUND, ("%s", +- "Failed to retrieve OpenGL context from Gtk"), (NULL)); ++ "Failed to retrieve OpenGL context from GTK"), (NULL)); + return FALSE; + } + +diff --git a/ext/gtk/gstplugin.c b/ext/gtk/gstplugin.c +index ed275785b..788f4f9dd 100644 +--- a/ext/gtk/gstplugin.c ++++ b/ext/gtk/gstplugin.c +@@ -1,6 +1,7 @@ + /* + * GStreamer + * Copyright (C) 2015 Matthew Waters ++ * Copyright (C) 2020 Rafał Dzięgiel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public +@@ -22,31 +23,37 @@ + #include "config.h" + #endif + ++#include "gtkconfig.h" ++ ++#if !defined(BUILD_FOR_GTK4) + #include "gstgtksink.h" +-#if defined(HAVE_GTK3_GL) ++#endif ++ ++#if defined(HAVE_GTK_GL) + #include "gstgtkglsink.h" + #endif + + static gboolean + plugin_init (GstPlugin * plugin) + { ++#if !defined(BUILD_FOR_GTK4) + if (!gst_element_register (plugin, "gtksink", + GST_RANK_NONE, GST_TYPE_GTK_SINK)) { + return FALSE; + } +-#if defined(HAVE_GTK3_GL) +- if (!gst_element_register (plugin, "gtkglsink", ++#endif ++ ++#if defined(HAVE_GTK_GL) ++ if (!gst_element_register (plugin, GTKCONFIG_GLSINK, + GST_RANK_NONE, GST_TYPE_GTK_GL_SINK)) { + return FALSE; + } + #endif +- + return TRUE; + } + + GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, +- gtk, +- "Gtk+ sink", ++ GTKCONFIG_PLUGIN, GTKCONFIG_NAME " sink", + plugin_init, PACKAGE_VERSION, GST_LICENSE, GST_PACKAGE_NAME, + GST_PACKAGE_ORIGIN) +diff --git a/ext/gtk/gtkconfig.h b/ext/gtk/gtkconfig.h +new file mode 100644 +index 000000000..8dd28dc00 +--- /dev/null ++++ b/ext/gtk/gtkconfig.h +@@ -0,0 +1,29 @@ ++/* ++ * GStreamer ++ * Copyright (C) 2020 Rafał Dzięgiel ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public ++ * License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#if defined(BUILD_FOR_GTK4) ++#define GTKCONFIG_PLUGIN gtk4 ++#define GTKCONFIG_NAME "GTK4" ++#define GTKCONFIG_GLSINK "gtk4glsink" ++#else ++#define GTKCONFIG_PLUGIN gtk ++#define GTKCONFIG_NAME "GTK" ++#define GTKCONFIG_GLSINK "gtkglsink" ++#endif +diff --git a/ext/gtk/gtkgstbasewidget.c b/ext/gtk/gtkgstbasewidget.c +index 5d57b0ee7..bd0794f2f 100644 +--- a/ext/gtk/gtkgstbasewidget.c ++++ b/ext/gtk/gtkgstbasewidget.c +@@ -1,6 +1,7 @@ + /* + * GStreamer + * Copyright (C) 2015 Matthew Waters ++ * Copyright (C) 2020 Rafał Dzięgiel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public +@@ -74,6 +75,22 @@ gtk_gst_base_widget_get_preferred_height (GtkWidget * widget, gint * min, + *natural = video_height; + } + ++#if defined(BUILD_FOR_GTK4) ++static void ++gtk_gst_base_widget_measure (GtkWidget * widget, GtkOrientation orientation, ++ gint for_size, gint * min, gint * natural, ++ gint * minimum_baseline, gint * natural_baseline) ++{ ++ if (orientation == GTK_ORIENTATION_HORIZONTAL) ++ gtk_gst_base_widget_get_preferred_width (widget, min, natural); ++ else ++ gtk_gst_base_widget_get_preferred_height (widget, min, natural); ++ ++ *minimum_baseline = -1; ++ *natural_baseline = -1; ++} ++#endif ++ + static void + gtk_gst_base_widget_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +@@ -235,11 +252,23 @@ _gdk_key_to_navigation_string (guint keyval) + } + } + ++static GdkEvent * ++_get_current_event (GtkEventController * controller) ++{ ++#if defined(BUILD_FOR_GTK4) ++ return gtk_event_controller_get_current_event (controller); ++#else ++ return gtk_get_current_event (); ++#endif ++} ++ + static void + _gdk_event_free (GdkEvent * event) + { ++#if !defined(BUILD_FOR_GTK4) + if (event) + gdk_event_free (event); ++#endif + } + + static gboolean +@@ -253,7 +282,7 @@ gtk_gst_base_widget_key_event (GtkEventControllerKey * key_controller, + + if ((element = g_weak_ref_get (&base_widget->element))) { + if (GST_IS_NAVIGATION (element)) { +- GdkEvent *event = gtk_get_current_event (); ++ GdkEvent *event = _get_current_event (controller); + const gchar *str = _gdk_key_to_navigation_string (keyval); + + if (str) { +@@ -337,7 +366,12 @@ _display_size_to_stream_size (GtkGstBaseWidget * base_widget, gdouble x, + } + + static gboolean +-gtk_gst_base_widget_button_event (GtkGestureMultiPress * gesture, ++gtk_gst_base_widget_button_event ( ++#if defined(BUILD_FOR_GTK4) ++ GtkGestureClick * gesture, ++#else ++ GtkGestureMultiPress * gesture, ++#endif + gint n_press, gdouble x, gdouble y) + { + GtkEventController *controller = GTK_EVENT_CONTROLLER (gesture); +@@ -347,18 +381,26 @@ gtk_gst_base_widget_button_event (GtkGestureMultiPress * gesture, + + if ((element = g_weak_ref_get (&base_widget->element))) { + if (GST_IS_NAVIGATION (element)) { +- GdkEvent *event = gtk_get_current_event (); ++ GdkEvent *event = _get_current_event (controller); + const gchar *key_type = + gdk_event_get_event_type (event) == GDK_BUTTON_PRESS + ? "mouse-button-press" : "mouse-button-release"; + gdouble stream_x, stream_y; ++#if !defined(BUILD_FOR_GTK4) + guint button; + gdk_event_get_button (event, &button); ++#endif + + _display_size_to_stream_size (base_widget, x, y, &stream_x, &stream_y); + + gst_navigation_send_mouse_event (GST_NAVIGATION (element), key_type, +- button, stream_x, stream_y); ++#if defined(BUILD_FOR_GTK4) ++ /* Gesture is set to ignore other buttons so we do not have to check */ ++ GDK_BUTTON_PRIMARY, ++#else ++ button, ++#endif ++ stream_x, stream_y); + + _gdk_event_free (event); + } +@@ -418,11 +460,15 @@ gtk_gst_base_widget_class_init (GtkGstBaseWidgetClass * klass) + "When enabled, alpha will be ignored and converted to black", + DEFAULT_IGNORE_ALPHA, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + ++#if defined(BUILD_FOR_GTK4) ++ widget_klass->measure = gtk_gst_base_widget_measure; ++#else + widget_klass->get_preferred_width = gtk_gst_base_widget_get_preferred_width; + widget_klass->get_preferred_height = gtk_gst_base_widget_get_preferred_height; ++#endif + + GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_base_widget, "gtkbasewidget", 0, +- "Gtk Video Base Widget"); ++ "GTK Video Base Widget"); + } + + void +@@ -439,23 +485,46 @@ gtk_gst_base_widget_init (GtkGstBaseWidget * widget) + g_weak_ref_init (&widget->element, NULL); + g_mutex_init (&widget->lock); + +- widget->key_controller = gtk_event_controller_key_new (GTK_WIDGET (widget)); ++ widget->key_controller = gtk_event_controller_key_new ( ++#if !defined(BUILD_FOR_GTK4) ++ GTK_WIDGET (widget) ++#endif ++ ); + g_signal_connect (widget->key_controller, "key-pressed", + G_CALLBACK (gtk_gst_base_widget_key_event), NULL); + g_signal_connect (widget->key_controller, "key-released", + G_CALLBACK (gtk_gst_base_widget_key_event), NULL); + +- widget->motion_controller = +- gtk_event_controller_motion_new (GTK_WIDGET (widget)); ++ widget->motion_controller = gtk_event_controller_motion_new ( ++#if !defined(BUILD_FOR_GTK4) ++ GTK_WIDGET (widget) ++#endif ++ ); + g_signal_connect (widget->motion_controller, "motion", + G_CALLBACK (gtk_gst_base_widget_motion_event), NULL); + +- widget->click_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (widget)); ++ widget->click_gesture = ++#if defined(BUILD_FOR_GTK4) ++ gtk_gesture_click_new (); ++#else ++ gtk_gesture_multi_press_new (GTK_WIDGET (widget)); ++#endif + g_signal_connect (widget->click_gesture, "pressed", + G_CALLBACK (gtk_gst_base_widget_button_event), NULL); + g_signal_connect (widget->click_gesture, "released", + G_CALLBACK (gtk_gst_base_widget_button_event), NULL); + ++#if defined(BUILD_FOR_GTK4) ++ gtk_widget_set_focusable (GTK_WIDGET (widget), TRUE); ++ gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (widget->click_gesture), ++ GDK_BUTTON_PRIMARY); ++ ++ gtk_widget_add_controller (GTK_WIDGET (widget), widget->key_controller); ++ gtk_widget_add_controller (GTK_WIDGET (widget), widget->motion_controller); ++ gtk_widget_add_controller (GTK_WIDGET (widget), ++ GTK_EVENT_CONTROLLER (widget->click_gesture)); ++#endif ++ + gtk_widget_set_can_focus (GTK_WIDGET (widget), TRUE); + } + +@@ -464,9 +533,13 @@ gtk_gst_base_widget_finalize (GObject * object) + { + GtkGstBaseWidget *widget = GTK_GST_BASE_WIDGET (object); + ++ /* GTK4 takes ownership of EventControllers ++ * while GTK3 still needs manual unref */ ++#if !defined(BUILD_FOR_GTK4) + g_object_unref (widget->key_controller); + g_object_unref (widget->motion_controller); + g_object_unref (widget->click_gesture); ++#endif + + gst_buffer_replace (&widget->pending_buffer, NULL); + gst_buffer_replace (&widget->buffer, NULL); +diff --git a/ext/gtk/gtkgstbasewidget.h b/ext/gtk/gtkgstbasewidget.h +index 0e31478a0..0b0fe9e55 100644 +--- a/ext/gtk/gtkgstbasewidget.h ++++ b/ext/gtk/gtkgstbasewidget.h +@@ -1,6 +1,7 @@ + /* + * GStreamer + * Copyright (C) 2015 Matthew Waters ++ * Copyright (C) 2020 Rafał Dzięgiel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public +@@ -24,7 +25,10 @@ + #include + #include + #include ++ ++#if !defined(BUILD_FOR_GTK4) + #include ++#endif + + #define GTK_GST_BASE_WIDGET(w) ((GtkGstBaseWidget *)(w)) + #define GTK_GST_BASE_WIDGET_CLASS(k) ((GtkGstBaseWidgetClass *)(k)) +@@ -39,10 +43,10 @@ typedef struct _GtkGstBaseWidgetClass GtkGstBaseWidgetClass; + struct _GtkGstBaseWidget + { + union { ++#if !defined(BUILD_FOR_GTK4) + GtkDrawingArea drawing_area; +-#if GTK_CHECK_VERSION(3, 15, 0) +- GtkGLArea gl_area; + #endif ++ GtkGLArea gl_area; + } parent; + + /* properties */ +@@ -80,10 +84,10 @@ struct _GtkGstBaseWidget + struct _GtkGstBaseWidgetClass + { + union { ++#if !defined(BUILD_FOR_GTK4) + GtkDrawingAreaClass drawing_area_class; +-#if GTK_CHECK_VERSION(3, 15, 0) +- GtkGLAreaClass gl_area_class; + #endif ++ GtkGLAreaClass gl_area_class; + } parent_class; + }; + +diff --git a/ext/gtk/gtkgstglwidget.c b/ext/gtk/gtkgstglwidget.c +index 6c423ad89..186144a1c 100644 +--- a/ext/gtk/gtkgstglwidget.c ++++ b/ext/gtk/gtkgstglwidget.c +@@ -1,6 +1,7 @@ + /* + * GStreamer + * Copyright (C) 2015 Matthew Waters ++ * Copyright (C) 2020 Rafał Dzięgiel + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public +@@ -30,12 +31,20 @@ + #include + + #if GST_GL_HAVE_WINDOW_X11 && defined (GDK_WINDOWING_X11) ++#if defined(BUILD_FOR_GTK4) ++#include ++#else + #include ++#endif + #include + #endif + + #if GST_GL_HAVE_WINDOW_WAYLAND && defined (GDK_WINDOWING_WAYLAND) ++#if defined(BUILD_FOR_GTK4) ++#include ++#else + #include ++#endif + #include + #endif + +@@ -78,8 +87,7 @@ static const GLfloat vertices[] = { + G_DEFINE_TYPE_WITH_CODE (GtkGstGLWidget, gtk_gst_gl_widget, GTK_TYPE_GL_AREA, + G_ADD_PRIVATE (GtkGstGLWidget) + GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "gtkgstglwidget", 0, +- "Gtk Gst GL Widget"); +- ); ++ "GTK Gst GL Widget")); + + static void + gtk_gst_gl_widget_bind_buffer (GtkGstGLWidget * gst_widget) +@@ -407,8 +415,11 @@ gtk_gst_gl_widget_init (GtkGstGLWidget * gst_widget) + + GST_INFO ("Created %" GST_PTR_FORMAT, priv->display); + ++ /* GTK4 always has alpha */ ++#if !defined(BUILD_FOR_GTK4) + gtk_gl_area_set_has_alpha (GTK_GL_AREA (gst_widget), + !base_widget->ignore_alpha); ++#endif + } + + static void +diff --git a/ext/gtk/meson.build b/ext/gtk/meson.build +index 722775e08..466e9221e 100644 +--- a/ext/gtk/meson.build ++++ b/ext/gtk/meson.build +@@ -1,59 +1,93 @@ ++gtk_versions = [3, 4] + gtk_sources = [ + 'gstgtkbasesink.c', +- 'gstgtksink.c', + 'gstgtkutils.c', + 'gstplugin.c', + 'gtkgstbasewidget.c', +- 'gtkgstwidget.c', + ] ++gtk_dep = dependency('gtk+-3.0', required : get_option('gtk3')) ++gtk4_dep = dependency('gtk4', required : get_option('gtk4')) + +-gtk_defines = [] +-optional_deps = [] ++foreach gtk_ver : gtk_versions ++ gtkv = 'gtk' + gtk_ver.to_string() + +-gtk_dep = dependency('gtk+-3.0', required : get_option('gtk3')) +-if gtk_dep.found() +- # FIXME: automagic +- if have_gstgl and gtk_dep.version().version_compare('>=3.24.0') +- have_gtk3_gl_windowing = false ++ gtk_state = get_option(gtkv) ++ if gtk_state.disabled() ++ continue ++ endif ++ ++ min_ver = gtk_ver >= 4 ? '3.99.2' : '3.24.0' ++ x11_dep = gtk_ver >= 4 ? gtkv + '-x11' : 'gtk+-x11-3.0' ++ way_dep = gtk_ver >= 4 ? gtkv + '-wayland' : 'gtk+-wayland-3.0' ++ lib_dep = gtk_ver >= 4 ? gtk4_dep : gtk_dep + ++ if not lib_dep.found() or not lib_dep.version().version_compare('>=' + min_ver) ++ continue ++ endif ++ ++ lib_sources = [] ++ gtk_defines = [] ++ optional_deps = [] ++ have_gtk_gl_windowing = false ++ ++ lib_sources += gtk_sources ++ if gtk_ver == 3 ++ lib_sources += [ ++ 'gstgtksink.c', ++ 'gtkgstwidget.c', ++ ] ++ endif ++ ++ if have_gstgl + if gst_gl_have_window_x11 and gst_gl_have_platform_glx + # FIXME: automagic +- gtk_x11_dep = dependency('gtk+-x11-3.0', required : false) ++ gtk_x11_dep = dependency(x11_dep, required : false) + if gtk_x11_dep.found() + optional_deps += [gtk_x11_dep, gstglx11_dep] +- have_gtk3_gl_windowing = true ++ have_gtk_gl_windowing = true + endif + endif + + if gst_gl_have_window_wayland and gst_gl_have_platform_egl + # FIXME: automagic +- gtk_wayland_dep = dependency('gtk+-wayland-3.0', required : false) ++ gtk_wayland_dep = dependency(way_dep, required : false) + if gtk_wayland_dep.found() + optional_deps += [gtk_wayland_dep, gstglegl_dep, gstglwayland_dep] +- have_gtk3_gl_windowing = true ++ have_gtk_gl_windowing = true + endif + endif ++ endif ++ ++ if gtk_ver > 3 and not have_gtk_gl_windowing ++ continue ++ endif + +- if have_gtk3_gl_windowing +- gtk_sources += [ +- 'gstgtkglsink.c', +- 'gtkgstglwidget.c', +- ] +- optional_deps += [gstgl_dep, gstglproto_dep] +- gtk_defines += ['-DGST_USE_UNSTABLE_API', '-DHAVE_GTK3_GL'] ++ if have_gtk_gl_windowing ++ lib_sources += [ ++ 'gstgtkglsink.c', ++ 'gtkgstglwidget.c', ++ ] ++ optional_deps += [gstgl_dep, gstglproto_dep] ++ gtk_defines += ['-DGST_USE_UNSTABLE_API', '-DHAVE_GTK_GL'] ++ if gtk_ver == 4 ++ gtk_defines += '-DBUILD_FOR_GTK4' + endif + endif + +- gstgtk = library('gstgtk', +- gtk_sources, ++ lib_name = 'gstgtk' ++ if gtk_ver > 3 ++ lib_name += gtk_ver.to_string() ++ endif ++ ++ gstgtk = library(lib_name, ++ lib_sources, + c_args : gst_plugins_good_args + gtk_defines, + link_args : noseh_link_args, + include_directories : [configinc], +- dependencies : [gtk_dep, gstvideo_dep, gstbase_dep, libm] + optional_deps, ++ dependencies : [lib_dep, gstvideo_dep, gstbase_dep, libm] + optional_deps, + install : true, + install_dir : plugins_install_dir, + ) + pkgconfig.generate(gstgtk, install_dir : plugins_pkgconfig_install_dir) + plugins += [gstgtk] +-endif +- ++endforeach +diff --git a/meson_options.txt b/meson_options.txt +index 3dafe1fda..ca2b5d8d7 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -53,6 +53,7 @@ option('dv1394', type : 'feature', value : 'auto', description : 'Digital IEEE13 + option('flac', type : 'feature', value : 'auto', description : 'FLAC audio codec plugin') + option('gdk-pixbuf', type : 'feature', value : 'auto', description : 'gdk-pixbuf image decoder, overlay, and sink plugin') + option('gtk3', type : 'feature', value : 'auto', description : 'GTK+ video sink plugin') ++option('gtk4', type : 'feature', value : 'disabled', description : 'GTK4 video sink plugin') + option('jack', type : 'feature', value : 'auto', description : 'JACK audio source/sink plugin') + option('jpeg', type : 'feature', value : 'auto', description : 'JPEG image codec plugin') + option('lame', type : 'feature', value : 'auto', description : 'LAME mp3 audio encoder plugin') +-- +GitLab + + +From dca6efe22a665339307a3c6f2ecd9f7b72cd6a31 Mon Sep 17 00:00:00 2001 +From: Rafostar <40623528+Rafostar@users.noreply.github.com> +Date: Thu, 12 Nov 2020 14:46:15 +0100 +Subject: [PATCH 04/10] gtk(4): separate gtk and gtk4 meson dependencies + +This fixes building tests against the correct gtk version +--- + ext/gtk/meson.build | 17 +++++++++++++---- + tests/examples/gtk/meson.build | 2 +- + 2 files changed, 14 insertions(+), 5 deletions(-) + +diff --git a/ext/gtk/meson.build b/ext/gtk/meson.build +index 466e9221e..82765b6c8 100644 +--- a/ext/gtk/meson.build ++++ b/ext/gtk/meson.build +@@ -6,7 +6,10 @@ gtk_sources = [ + 'gtkgstbasewidget.c', + ] + gtk_dep = dependency('gtk+-3.0', required : get_option('gtk3')) ++gtk_optional_deps = [] ++ + gtk4_dep = dependency('gtk4', required : get_option('gtk4')) ++gtk4_optional_deps = [] + + foreach gtk_ver : gtk_versions + gtkv = 'gtk' + gtk_ver.to_string() +@@ -17,8 +20,8 @@ foreach gtk_ver : gtk_versions + endif + + min_ver = gtk_ver >= 4 ? '3.99.2' : '3.24.0' +- x11_dep = gtk_ver >= 4 ? gtkv + '-x11' : 'gtk+-x11-3.0' +- way_dep = gtk_ver >= 4 ? gtkv + '-wayland' : 'gtk+-wayland-3.0' ++ x11_str = gtk_ver >= 4 ? gtkv + '-x11' : 'gtk+-x11-3.0' ++ way_str = gtk_ver >= 4 ? gtkv + '-wayland' : 'gtk+-wayland-3.0' + lib_dep = gtk_ver >= 4 ? gtk4_dep : gtk_dep + + if not lib_dep.found() or not lib_dep.version().version_compare('>=' + min_ver) +@@ -41,7 +44,7 @@ foreach gtk_ver : gtk_versions + if have_gstgl + if gst_gl_have_window_x11 and gst_gl_have_platform_glx + # FIXME: automagic +- gtk_x11_dep = dependency(x11_dep, required : false) ++ gtk_x11_dep = dependency(x11_str, required : false) + if gtk_x11_dep.found() + optional_deps += [gtk_x11_dep, gstglx11_dep] + have_gtk_gl_windowing = true +@@ -50,7 +53,7 @@ foreach gtk_ver : gtk_versions + + if gst_gl_have_window_wayland and gst_gl_have_platform_egl + # FIXME: automagic +- gtk_wayland_dep = dependency(way_dep, required : false) ++ gtk_wayland_dep = dependency(way_str, required : false) + if gtk_wayland_dep.found() + optional_deps += [gtk_wayland_dep, gstglegl_dep, gstglwayland_dep] + have_gtk_gl_windowing = true +@@ -74,6 +77,12 @@ foreach gtk_ver : gtk_versions + endif + endif + ++ if gtk_ver == 3 ++ gtk_optional_deps = optional_deps ++ elif gtk_ver == 4 ++ gtk4_optional_deps = optional_deps ++ endif ++ + lib_name = 'gstgtk' + if gtk_ver > 3 + lib_name += gtk_ver.to_string() +diff --git a/tests/examples/gtk/meson.build b/tests/examples/gtk/meson.build +index 76e9f4f8e..4de2075e6 100644 +--- a/tests/examples/gtk/meson.build ++++ b/tests/examples/gtk/meson.build +@@ -1,5 +1,5 @@ + executable('gtksink', 'gtksink.c', +- dependencies: [gst_dep, gtk_dep, optional_deps], ++ dependencies: [gst_dep, gtk_dep, gtk_optional_deps], + c_args: gst_plugins_good_args, + include_directories: [configinc], + install: false) +-- +GitLab + + +From 905e86bca45af1d706c9e7fc1a22d0f4cf962faf Mon Sep 17 00:00:00 2001 +From: Rafostar <40623528+Rafostar@users.noreply.github.com> +Date: Thu, 12 Nov 2020 18:16:23 +0100 +Subject: [PATCH 05/10] gtk(4): clear widget during our window destruction + +In GTK4 the "destroy" signal will not be emitted +as long as someone is holding a ref on an object. +We cannot use it to do the unref anymore. Cleanup +on our window "destroy" signal instead. This is +only used to make gst-launch-1.0 close properly. +--- + ext/gtk/gstgtkbasesink.c | 11 +++++++++++ + ext/gtk/gstgtkbasesink.h | 10 +++++----- + 2 files changed, 16 insertions(+), 5 deletions(-) + +diff --git a/ext/gtk/gstgtkbasesink.c b/ext/gtk/gstgtkbasesink.c +index 1f5319089..d176d3ee8 100644 +--- a/ext/gtk/gstgtkbasesink.c ++++ b/ext/gtk/gstgtkbasesink.c +@@ -150,6 +150,8 @@ gst_gtk_base_sink_finalize (GObject * object) + { + GstGtkBaseSink *gtk_sink = GST_GTK_BASE_SINK (object); + ++ GST_DEBUG ("finalizing base sink"); ++ + GST_OBJECT_LOCK (gtk_sink); + if (gtk_sink->window && gtk_sink->window_destroy_id) + g_signal_handler_disconnect (gtk_sink->window, gtk_sink->window_destroy_id); +@@ -174,6 +176,14 @@ static void + window_destroy_cb (GtkWidget * widget, GstGtkBaseSink * gtk_sink) + { + GST_OBJECT_LOCK (gtk_sink); ++ if (gtk_sink->widget) { ++ if (gtk_sink->widget_destroy_id) { ++ g_signal_handler_disconnect (gtk_sink->widget, ++ gtk_sink->widget_destroy_id); ++ gtk_sink->widget_destroy_id = 0; ++ } ++ g_clear_object (>k_sink->widget); ++ } + gtk_sink->window = NULL; + GST_OBJECT_UNLOCK (gtk_sink); + } +@@ -214,6 +224,7 @@ gst_gtk_base_sink_get_widget (GstGtkBaseSink * gtk_sink) + /* Take the floating ref, other wise the destruction of the container will + * make this widget disappear possibly before we are done. */ + gst_object_ref_sink (gtk_sink->widget); ++ + gtk_sink->widget_destroy_id = g_signal_connect (gtk_sink->widget, "destroy", + G_CALLBACK (widget_destroy_cb), gtk_sink); + +diff --git a/ext/gtk/gstgtkbasesink.h b/ext/gtk/gstgtkbasesink.h +index 650175036..db0acb2c0 100644 +--- a/ext/gtk/gstgtkbasesink.h ++++ b/ext/gtk/gstgtkbasesink.h +@@ -51,14 +51,14 @@ GType gst_gtk_base_sink_get_type (void); + struct _GstGtkBaseSink + { + /* */ +- GstVideoSink parent; ++ GstVideoSink parent; + +- GstVideoInfo v_info; ++ GstVideoInfo v_info; + + GtkGstBaseWidget *widget; + + /* properties */ +- gboolean force_aspect_ratio; ++ gboolean force_aspect_ratio; + GBinding *bind_aspect_ratio; + + gint par_n; +@@ -69,8 +69,8 @@ struct _GstGtkBaseSink + GBinding *bind_ignore_alpha; + + GtkWidget *window; +- gulong widget_destroy_id; +- gulong window_destroy_id; ++ gulong widget_destroy_id; ++ gulong window_destroy_id; + }; + + /** +-- +GitLab + + +From a91cd51babbe8cbe2e086a9f51efd6e526310d9a Mon Sep 17 00:00:00 2001 +From: Rafostar <40623528+Rafostar@users.noreply.github.com> +Date: Tue, 29 Dec 2020 15:03:08 +0100 +Subject: [PATCH 06/10] gtk(4): replace "size-allocate" signal with "resize" + +In GTK4 the "size-allocate" signal was removed. +Recommended replacement is "resize" signal which was +also available in GTK3, so use it instead. +--- + ext/gtk/gstgtkglsink.c | 42 ++++++++++++++++++++---------------------- + ext/gtk/gstgtkglsink.h | 2 +- + 2 files changed, 21 insertions(+), 23 deletions(-) + +diff --git a/ext/gtk/gstgtkglsink.c b/ext/gtk/gstgtkglsink.c +index daaf0eb3f..e680c5a0f 100644 +--- a/ext/gtk/gstgtkglsink.c ++++ b/ext/gtk/gstgtkglsink.c +@@ -128,17 +128,18 @@ gst_gtk_gl_sink_query (GstBaseSink * bsink, GstQuery * query) + return res; + } + +-#if !defined(BUILD_FOR_GTK4) + static void +-_size_changed_cb (GtkWidget * widget, GdkRectangle * rectangle, +- GstGtkGLSink * gtk_sink) ++_size_changed_cb (GtkWidget * widget, gint width, ++ gint height, GstGtkGLSink * gtk_sink) + { +- gint scale_factor, width, height; + gboolean reconfigure; + +- scale_factor = gtk_widget_get_scale_factor (widget); +- width = scale_factor * gtk_widget_get_allocated_width (widget); +- height = scale_factor * gtk_widget_get_allocated_height (widget); ++ GtkGstBaseWidget *base_widget = GTK_GST_BASE_WIDGET (widget); ++ ++ /* Ignore size changes before widget is negotiated ++ * we are going to queue a resize after negotiation */ ++ if (!base_widget->negotiated) ++ return; + + GST_OBJECT_LOCK (gtk_sink); + reconfigure = +@@ -153,14 +154,13 @@ _size_changed_cb (GtkWidget * widget, GdkRectangle * rectangle, + gst_event_new_reconfigure ()); + } + } +-#endif + + static void + destroy_cb (GtkWidget * widget, GstGtkGLSink * gtk_sink) + { +- if (gtk_sink->size_allocate_sig_handler) { +- g_signal_handler_disconnect (widget, gtk_sink->size_allocate_sig_handler); +- gtk_sink->size_allocate_sig_handler = 0; ++ if (gtk_sink->widget_resize_sig_handler) { ++ g_signal_handler_disconnect (widget, gtk_sink->widget_resize_sig_handler); ++ gtk_sink->widget_resize_sig_handler = 0; + } + + if (gtk_sink->widget_destroy_sig_handler) { +@@ -182,14 +182,12 @@ gst_gtk_gl_sink_start (GstBaseSink * bsink) + /* After this point, gtk_sink->widget will always be set */ + gst_widget = GTK_GST_GL_WIDGET (base_sink->widget); + +-#if !defined(BUILD_FOR_GTK4) + /* Track the allocation size */ +- if (!gtk_sink->size_allocate_sig_handler) { +- gtk_sink->size_allocate_sig_handler = +- g_signal_connect (gst_widget, "size-allocate", ++ if (!gtk_sink->widget_resize_sig_handler) { ++ gtk_sink->widget_resize_sig_handler = ++ g_signal_connect (gst_widget, "resize", + G_CALLBACK (_size_changed_cb), gtk_sink); + } +-#endif + + if (!gtk_sink->widget_destroy_sig_handler) { + gtk_sink->widget_destroy_sig_handler = +@@ -228,10 +226,10 @@ gst_gtk_gl_sink_stop (GstBaseSink * bsink) + GstGtkGLSink *gtk_sink = GST_GTK_GL_SINK (bsink); + GstGtkBaseSink *base_sink = GST_GTK_BASE_SINK (bsink); + +- if (gtk_sink->size_allocate_sig_handler) { ++ if (gtk_sink->widget_resize_sig_handler) { + g_signal_handler_disconnect (base_sink->widget, +- gtk_sink->size_allocate_sig_handler); +- gtk_sink->size_allocate_sig_handler = 0; ++ gtk_sink->widget_resize_sig_handler); ++ gtk_sink->widget_resize_sig_handler = 0; + } + + if (gtk_sink->display) { +@@ -373,10 +371,10 @@ gst_gtk_gl_sink_finalize (GObject * object) + GstGtkGLSink *gtk_sink = GST_GTK_GL_SINK (object); + GstGtkBaseSink *base_sink = GST_GTK_BASE_SINK (object); + +- if (gtk_sink->size_allocate_sig_handler) { ++ if (gtk_sink->widget_resize_sig_handler) { + g_signal_handler_disconnect (base_sink->widget, +- gtk_sink->size_allocate_sig_handler); +- gtk_sink->size_allocate_sig_handler = 0; ++ gtk_sink->widget_resize_sig_handler); ++ gtk_sink->widget_resize_sig_handler = 0; + } + + if (gtk_sink->widget_destroy_sig_handler) { +diff --git a/ext/gtk/gstgtkglsink.h b/ext/gtk/gstgtkglsink.h +index 8ff935948..57450c8ac 100644 +--- a/ext/gtk/gstgtkglsink.h ++++ b/ext/gtk/gstgtkglsink.h +@@ -57,7 +57,7 @@ struct _GstGtkGLSink + gint display_width; + gint display_height; + +- gulong size_allocate_sig_handler; ++ gulong widget_resize_sig_handler; + gulong widget_destroy_sig_handler; + }; + +-- +GitLab + + +From 8798dffb7f1f5b6ba281334789bdf4336faa005c Mon Sep 17 00:00:00 2001 +From: Rafostar <40623528+Rafostar@users.noreply.github.com> +Date: Sat, 2 Jan 2021 22:56:36 +0100 +Subject: [PATCH 07/10] gtk: fix wrong element name in docs + +In docs "gtksink" was named "gtkgstsink" which caused +the doc generation to not detect and describe it properly. +--- + ext/gtk/gstgtksink.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ext/gtk/gstgtksink.c b/ext/gtk/gstgtksink.c +index ba8ea33ca..c330a82b4 100644 +--- a/ext/gtk/gstgtksink.c ++++ b/ext/gtk/gstgtksink.c +@@ -19,8 +19,8 @@ + */ + + /** +- * SECTION:element-gtkgstsink +- * @title: gtkgstsink ++ * SECTION:element-gtksink ++ * @title: gtksink + * + */ + +-- +GitLab + + +From 53802970c1a5182f85468552cecbabda0bb0e98d Mon Sep 17 00:00:00 2001 +From: Rafostar <40623528+Rafostar@users.noreply.github.com> +Date: Thu, 31 Dec 2020 12:44:23 +0100 +Subject: [PATCH 08/10] gtksink: add GTK4 support + +Add GTK4 compatibility for Cairo renderer based plugin. +The new sink plugin is named "gtk4sink". +--- + ext/gtk/gstgtksink.c | 16 ++++++++++++---- + ext/gtk/gstplugin.c | 8 +------- + ext/gtk/gtkconfig.h | 2 ++ + ext/gtk/gtkgstbasewidget.h | 4 ---- + ext/gtk/gtkgstwidget.c | 35 ++++++++++++++++++++++++++++------- + ext/gtk/meson.build | 16 +++------------- + 6 files changed, 46 insertions(+), 35 deletions(-) + +diff --git a/ext/gtk/gstgtksink.c b/ext/gtk/gstgtksink.c +index c330a82b4..d64859ff6 100644 +--- a/ext/gtk/gstgtksink.c ++++ b/ext/gtk/gstgtksink.c +@@ -24,10 +24,17 @@ + * + */ + ++/** ++ * SECTION:element-gtk4sink ++ * @title: gtk4sink ++ * ++ */ ++ + #ifdef HAVE_CONFIG_H + #include "config.h" + #endif + ++#include "gtkconfig.h" + #include "gtkgstwidget.h" + #include "gstgtksink.h" + +@@ -49,8 +56,8 @@ GST_STATIC_PAD_TEMPLATE ("sink", + + #define gst_gtk_sink_parent_class parent_class + G_DEFINE_TYPE_WITH_CODE (GstGtkSink, gst_gtk_sink, GST_TYPE_GTK_BASE_SINK, +- GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_sink, "gtksink", 0, +- "Gtk Video Sink")); ++ GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_sink, GTKCONFIG_SINK, 0, ++ GTKCONFIG_NAME " Video Sink")); + + static void + gst_gtk_sink_class_init (GstGtkSinkClass * klass) +@@ -62,9 +69,10 @@ gst_gtk_sink_class_init (GstGtkSinkClass * klass) + base_class = (GstGtkBaseSinkClass *) klass; + + base_class->create_widget = gtk_gst_widget_new; +- base_class->window_title = "Gtk+ Cairo renderer"; ++ base_class->window_title = GTKCONFIG_NAME " Cairo Renderer"; + +- gst_element_class_set_metadata (gstelement_class, "Gtk Video Sink", ++ gst_element_class_set_metadata (gstelement_class, ++ GTKCONFIG_NAME " Video Sink", + "Sink/Video", "A video sink that renders to a GtkWidget", + "Matthew Waters "); + +diff --git a/ext/gtk/gstplugin.c b/ext/gtk/gstplugin.c +index 788f4f9dd..5fb2d99f4 100644 +--- a/ext/gtk/gstplugin.c ++++ b/ext/gtk/gstplugin.c +@@ -24,10 +24,7 @@ + #endif + + #include "gtkconfig.h" +- +-#if !defined(BUILD_FOR_GTK4) + #include "gstgtksink.h" +-#endif + + #if defined(HAVE_GTK_GL) + #include "gstgtkglsink.h" +@@ -36,13 +33,10 @@ + static gboolean + plugin_init (GstPlugin * plugin) + { +-#if !defined(BUILD_FOR_GTK4) +- if (!gst_element_register (plugin, "gtksink", ++ if (!gst_element_register (plugin, GTKCONFIG_SINK, + GST_RANK_NONE, GST_TYPE_GTK_SINK)) { + return FALSE; + } +-#endif +- + #if defined(HAVE_GTK_GL) + if (!gst_element_register (plugin, GTKCONFIG_GLSINK, + GST_RANK_NONE, GST_TYPE_GTK_GL_SINK)) { +diff --git a/ext/gtk/gtkconfig.h b/ext/gtk/gtkconfig.h +index 8dd28dc00..ecbf95582 100644 +--- a/ext/gtk/gtkconfig.h ++++ b/ext/gtk/gtkconfig.h +@@ -21,9 +21,11 @@ + #if defined(BUILD_FOR_GTK4) + #define GTKCONFIG_PLUGIN gtk4 + #define GTKCONFIG_NAME "GTK4" ++#define GTKCONFIG_SINK "gtk4sink" + #define GTKCONFIG_GLSINK "gtk4glsink" + #else + #define GTKCONFIG_PLUGIN gtk + #define GTKCONFIG_NAME "GTK" ++#define GTKCONFIG_SINK "gtksink" + #define GTKCONFIG_GLSINK "gtkglsink" + #endif +diff --git a/ext/gtk/gtkgstbasewidget.h b/ext/gtk/gtkgstbasewidget.h +index 0b0fe9e55..bc0b805df 100644 +--- a/ext/gtk/gtkgstbasewidget.h ++++ b/ext/gtk/gtkgstbasewidget.h +@@ -43,9 +43,7 @@ typedef struct _GtkGstBaseWidgetClass GtkGstBaseWidgetClass; + struct _GtkGstBaseWidget + { + union { +-#if !defined(BUILD_FOR_GTK4) + GtkDrawingArea drawing_area; +-#endif + GtkGLArea gl_area; + } parent; + +@@ -84,9 +82,7 @@ struct _GtkGstBaseWidget + struct _GtkGstBaseWidgetClass + { + union { +-#if !defined(BUILD_FOR_GTK4) + GtkDrawingAreaClass drawing_area_class; +-#endif + GtkGLAreaClass gl_area_class; + } parent_class; + }; +diff --git a/ext/gtk/gtkgstwidget.c b/ext/gtk/gtkgstwidget.c +index a936210ba..eb8db8f7e 100644 +--- a/ext/gtk/gtkgstwidget.c ++++ b/ext/gtk/gtkgstwidget.c +@@ -38,17 +38,15 @@ + + G_DEFINE_TYPE (GtkGstWidget, gtk_gst_widget, GTK_TYPE_DRAWING_AREA); + +-static gboolean +-gtk_gst_widget_draw (GtkWidget * widget, cairo_t * cr) ++static void ++_drawing_area_draw (GtkDrawingArea * da, cairo_t * cr, ++ gint widget_width, gint widget_height, gpointer data) + { ++ GtkWidget *widget = GTK_WIDGET (da); + GtkGstBaseWidget *gst_widget = (GtkGstBaseWidget *) widget; +- guint widget_width, widget_height; + cairo_surface_t *surface; + GstVideoFrame frame; + +- widget_width = gtk_widget_get_allocated_width (widget); +- widget_height = gtk_widget_get_allocated_height (widget); +- + GTK_GST_BASE_WIDGET_LOCK (gst_widget); + + /* There is not much to optimize in term of redisplay, so simply swap the +@@ -148,7 +146,10 @@ gtk_gst_widget_draw (GtkWidget * widget, cairo_t * cr) + color.alpha = 1.0; + } else { + gtk_style_context_get_color (gtk_widget_get_style_context (widget), +- GTK_STATE_FLAG_NORMAL, &color); ++#if !defined(BUILD_FOR_GTK4) ++ GTK_STATE_FLAG_NORMAL, ++#endif ++ &color); + } + gdk_cairo_set_source_rgba (cr, &color); + cairo_rectangle (cr, 0, 0, widget_width, widget_height); +@@ -156,8 +157,20 @@ gtk_gst_widget_draw (GtkWidget * widget, cairo_t * cr) + } + + GTK_GST_BASE_WIDGET_UNLOCK (gst_widget); ++} ++ ++#if !defined(BUILD_FOR_GTK4) ++static gboolean ++gtk_gst_widget_draw (GtkWidget * widget, cairo_t * cr) ++{ ++ gint width = gtk_widget_get_allocated_width (widget); ++ gint height = gtk_widget_get_allocated_height (widget); ++ ++ _drawing_area_draw (GTK_DRAWING_AREA (widget), cr, width, height, NULL); ++ + return FALSE; + } ++#endif + + static void + gtk_gst_widget_finalize (GObject * object) +@@ -171,17 +184,25 @@ static void + gtk_gst_widget_class_init (GtkGstWidgetClass * klass) + { + GObjectClass *gobject_klass = (GObjectClass *) klass; ++#if !defined(BUILD_FOR_GTK4) + GtkWidgetClass *widget_klass = (GtkWidgetClass *) klass; ++#endif + + gtk_gst_base_widget_class_init (GTK_GST_BASE_WIDGET_CLASS (klass)); + gobject_klass->finalize = gtk_gst_widget_finalize; ++#if !defined(BUILD_FOR_GTK4) + widget_klass->draw = gtk_gst_widget_draw; ++#endif + } + + static void + gtk_gst_widget_init (GtkGstWidget * widget) + { + gtk_gst_base_widget_init (GTK_GST_BASE_WIDGET (widget)); ++#if defined(BUILD_FOR_GTK4) ++ gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (widget), ++ _drawing_area_draw, NULL, NULL); ++#endif + } + + GtkWidget * +diff --git a/ext/gtk/meson.build b/ext/gtk/meson.build +index 82765b6c8..c157cf8cd 100644 +--- a/ext/gtk/meson.build ++++ b/ext/gtk/meson.build +@@ -1,9 +1,11 @@ + gtk_versions = [3, 4] + gtk_sources = [ + 'gstgtkbasesink.c', ++ 'gstgtksink.c', + 'gstgtkutils.c', + 'gstplugin.c', + 'gtkgstbasewidget.c', ++ 'gtkgstwidget.c', + ] + gtk_dep = dependency('gtk+-3.0', required : get_option('gtk3')) + gtk_optional_deps = [] +@@ -34,12 +36,6 @@ foreach gtk_ver : gtk_versions + have_gtk_gl_windowing = false + + lib_sources += gtk_sources +- if gtk_ver == 3 +- lib_sources += [ +- 'gstgtksink.c', +- 'gtkgstwidget.c', +- ] +- endif + + if have_gstgl + if gst_gl_have_window_x11 and gst_gl_have_platform_glx +@@ -61,10 +57,6 @@ foreach gtk_ver : gtk_versions + endif + endif + +- if gtk_ver > 3 and not have_gtk_gl_windowing +- continue +- endif +- + if have_gtk_gl_windowing + lib_sources += [ + 'gstgtkglsink.c', +@@ -72,15 +64,13 @@ foreach gtk_ver : gtk_versions + ] + optional_deps += [gstgl_dep, gstglproto_dep] + gtk_defines += ['-DGST_USE_UNSTABLE_API', '-DHAVE_GTK_GL'] +- if gtk_ver == 4 +- gtk_defines += '-DBUILD_FOR_GTK4' +- endif + endif + + if gtk_ver == 3 + gtk_optional_deps = optional_deps + elif gtk_ver == 4 + gtk4_optional_deps = optional_deps ++ gtk_defines += '-DBUILD_FOR_GTK4' + endif + + lib_name = 'gstgtk' +-- +GitLab + + +From db5a3373c0281ae2923f411375c919583489c5ab Mon Sep 17 00:00:00 2001 +From: Rafostar <40623528+Rafostar@users.noreply.github.com> +Date: Fri, 1 Jan 2021 20:10:38 +0100 +Subject: [PATCH 09/10] gtk4: expand widget by default + +In GTK4, (v/h)expand is disabled by default which +causes widget placed in grid to appear as a 1x1px +video and might be unnoticeable, confusing users +into thinking that something does not work. +--- + ext/gtk/gtkgstbasewidget.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/ext/gtk/gtkgstbasewidget.c b/ext/gtk/gtkgstbasewidget.c +index bd0794f2f..374eb7f97 100644 +--- a/ext/gtk/gtkgstbasewidget.c ++++ b/ext/gtk/gtkgstbasewidget.c +@@ -515,6 +515,11 @@ gtk_gst_base_widget_init (GtkGstBaseWidget * widget) + G_CALLBACK (gtk_gst_base_widget_button_event), NULL); + + #if defined(BUILD_FOR_GTK4) ++ /* Otherwise widget in grid will appear as a 1x1px ++ * video which might be misleading for users */ ++ gtk_widget_set_hexpand (GTK_WIDGET (widget), TRUE); ++ gtk_widget_set_vexpand (GTK_WIDGET (widget), TRUE); ++ + gtk_widget_set_focusable (GTK_WIDGET (widget), TRUE); + gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (widget->click_gesture), + GDK_BUTTON_PRIMARY); +-- +GitLab + + +From f17f29ed5cef270a50d5f72116953109c3cc8c86 Mon Sep 17 00:00:00 2001 +From: Rafostar <40623528+Rafostar@users.noreply.github.com> +Date: Sun, 3 Jan 2021 11:24:15 +0100 +Subject: [PATCH 10/10] docs: update plugin cache + +Update gtk plugin and add gtk4 plugin +--- + docs/gst_plugins_cache.json | 129 ++++++++++++++++++++++++++++++++++-- + 1 file changed, 125 insertions(+), 4 deletions(-) + +diff --git a/docs/gst_plugins_cache.json b/docs/gst_plugins_cache.json +index f8ac35e37..5afd41a99 100644 +--- a/docs/gst_plugins_cache.json ++++ b/docs/gst_plugins_cache.json +@@ -7075,10 +7075,10 @@ + "url": "Unknown package origin" + }, + "gtk": { +- "description": "Gtk+ sink", ++ "description": "GTK sink", + "elements": { + "gtkglsink": { +- "author": "Matthew Waters ", ++ "author": "Matthew Waters , Rafał Dzięgiel ", + "description": "A video sink that renders to a GtkWidget using OpenGL", + "hierarchy": [ + "GstGtkGLSink", +@@ -7094,7 +7094,7 @@ + "GstNavigation" + ], + "klass": "Sink/Video", +- "long-name": "Gtk GL Video Sink", ++ "long-name": "GTK GL Video Sink", + "pad-templates": { + "sink": { + "caps": "video/x-raw(memory:GLMemory):\n format: RGBA\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n\nvideo/x-raw(memory:GLMemory, meta:GstVideoOverlayComposition):\n format: RGBA\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", +@@ -7122,7 +7122,7 @@ + "GstNavigation" + ], + "klass": "Sink/Video", +- "long-name": "Gtk Video Sink", ++ "long-name": "GTK Video Sink", + "pad-templates": { + "sink": { + "caps": "video/x-raw:\n format: { BGRx, BGRA }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", +@@ -7209,6 +7209,127 @@ + "tracers": {}, + "url": "Unknown package origin" + }, ++ "gtk4": { ++ "description": "GTK4 sink", ++ "elements": { ++ "gtk4glsink": { ++ "author": "Matthew Waters , Rafał Dzięgiel ", ++ "description": "A video sink that renders to a GtkWidget using OpenGL", ++ "hierarchy": [ ++ "GstGtkGLSink", ++ "GstGtkBaseSink", ++ "GstVideoSink", ++ "GstBaseSink", ++ "GstElement", ++ "GstObject", ++ "GInitiallyUnowned", ++ "GObject" ++ ], ++ "interfaces": [ ++ "GstNavigation" ++ ], ++ "klass": "Sink/Video", ++ "long-name": "GTK4 GL Video Sink", ++ "pad-templates": { ++ "sink": { ++ "caps": "video/x-raw(memory:GLMemory):\n format: RGBA\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n\nvideo/x-raw(memory:GLMemory, meta:GstVideoOverlayComposition):\n format: RGBA\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", ++ "direction": "sink", ++ "presence": "always" ++ } ++ }, ++ "rank": "none" ++ }, ++ "gtk4sink": { ++ "author": "Matthew Waters ", ++ "description": "A video sink that renders to a GtkWidget", ++ "hierarchy": [ ++ "GstGtkSink", ++ "GstGtkBaseSink", ++ "GstVideoSink", ++ "GstBaseSink", ++ "GstElement", ++ "GstObject", ++ "GInitiallyUnowned", ++ "GObject" ++ ], ++ "interfaces": [ ++ "GstNavigation" ++ ], ++ "klass": "Sink/Video", ++ "long-name": "GTK4 Video Sink", ++ "pad-templates": { ++ "sink": { ++ "caps": "video/x-raw:\n format: { BGRx, BGRA }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", ++ "direction": "sink", ++ "presence": "always" ++ } ++ }, ++ "rank": "none" ++ } ++ }, ++ "filename": "gstgtk4", ++ "license": "LGPL", ++ "other-types": { ++ "GstGtkBaseSink": { ++ "hierarchy": [ ++ "GstGtkBaseSink", ++ "GstVideoSink", ++ "GstBaseSink", ++ "GstElement", ++ "GstObject", ++ "GInitiallyUnowned", ++ "GObject" ++ ], ++ "interfaces": [ ++ "GstNavigation" ++ ], ++ "kind": "object", ++ "properties": { ++ "force-aspect-ratio": { ++ "blurb": "When enabled, scaling will respect original aspect ratio", ++ "conditionally-available": false, ++ "construct": false, ++ "construct-only": false, ++ "controllable": false, ++ "default": "true", ++ "mutable": "null", ++ "readable": true, ++ "type": "gboolean", ++ "writable": true ++ }, ++ "pixel-aspect-ratio": { ++ "blurb": "The pixel aspect ratio of the device", ++ "conditionally-available": false, ++ "construct": false, ++ "construct-only": false, ++ "controllable": false, ++ "default": "0/1", ++ "max": "2147483647/1", ++ "min": "0/1", ++ "mutable": "null", ++ "readable": true, ++ "type": "GstFraction", ++ "writable": true ++ }, ++ "widget": { ++ "blurb": "The GtkWidget to place in the widget hierarchy (must only be get from the GTK main thread)", ++ "conditionally-available": false, ++ "construct": false, ++ "construct-only": false, ++ "controllable": false, ++ "mutable": "null", ++ "readable": true, ++ "type": "GtkWidget", ++ "writable": false ++ } ++ } ++ } ++ }, ++ "package": "GStreamer Good Plug-ins", ++ "source": "gst-plugins-good", ++ "tracers": {}, ++ "url": "Unknown package origin" ++ }, + "icydemux": { + "description": "Demux ICY tags from a stream", + "elements": { +-- +GitLab + diff --git a/pkgs/applications/misc/authenticator/default.nix b/pkgs/applications/misc/authenticator/default.nix new file mode 100644 index 00000000000..89ea3dae229 --- /dev/null +++ b/pkgs/applications/misc/authenticator/default.nix @@ -0,0 +1,98 @@ +{ lib +, stdenv +, fetchFromGitLab +, fetchpatch +, appstream-glib +, desktop-file-utils +, meson +, ninja +, pkg-config +, python3 +, rustPlatform +, wrapGAppsHook +, gdk-pixbuf +, glib +, gst_all_1 +, gtk4 +, libadwaita +, openssl +, sqlite +, wayland +, zbar +}: + +stdenv.mkDerivation rec { + pname = "authenticator"; + version = "4.0.3"; + + src = fetchFromGitLab { + domain = "gitlab.gnome.org"; + owner = "World"; + repo = "Authenticator"; + rev = version; + sha256 = "0fvs76f3fm5pxn7wg6sjbqpgip5w2j7xrh4siasdcl2bx6vsld8b"; + }; + + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + name = "${pname}-${version}"; + sha256 = "1s97jyszxf24rs3ni11phiyvmp1wm8sicb0rh1jgwz4bn1cnakx4"; + }; + + postPatch = '' + patchShebangs build-aux + ''; + + nativeBuildInputs = [ + appstream-glib + desktop-file-utils + meson + ninja + pkg-config + python3 + wrapGAppsHook + ] ++ (with rustPlatform; [ + cargoSetupHook + rust.cargo + rust.rustc + ]); + + buildInputs = [ + gdk-pixbuf + glib + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + # See https://gitlab.gnome.org/World/Authenticator/-/blob/master/build-aux/com.belmoussaoui.Authenticator.Devel.json + (gst_all_1.gst-plugins-good.overrideAttrs (old: { + patches = [ + #(fetchpatch { + # url = "https://gitlab.gnome.org/World/Authenticator/-/raw/master/build-aux/767.patch"; + # sha256 = "1g3zkfs248p8wvrvplwrl38vylqsafv6vapfr1nj5kg7ndfrgilf"; + #}) + ./767.patch + ]; + mesonFlags = old.mesonFlags ++ [ + "-Dgtk3=disabled" + "-Dgtk4=enabled" + "-Dgtk4-experiments=true" + ]; + buildInputs = old.buildInputs ++ [ + gtk4 + ]; + })) + gst_all_1.gst-plugins-bad + gtk4 + libadwaita + openssl + sqlite + wayland + zbar + ]; + + meta = with lib; { + description = "Two-factor authentication code generator for GNOME"; + homepage = "https://gitlab.gnome.org/World/Authenticator"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 692b02f386f..28ee47f51ba 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1077,6 +1077,8 @@ in audiowaveform = callPackage ../tools/audio/audiowaveform { }; + authenticator = callPackage ../applications/misc/authenticator { }; + autoflake = callPackage ../development/tools/analysis/autoflake { }; autospotting = callPackage ../applications/misc/autospotting { }; From b942e0f6508432b034042371cd5a53f74a63af50 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Mon, 3 May 2021 01:44:52 +0000 Subject: [PATCH 35/59] nixos/tests/installer: don't break under i686 Currently, the installer tests just hang after the initial install phase on i686 because qemu just quits because of the gic parameter. Fix this by doing x86 things for both x86-64 and i686. --- nixos/tests/installer.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix index 24c55081f9a..48f0f593425 100644 --- a/nixos/tests/installer.nix +++ b/nixos/tests/installer.nix @@ -75,7 +75,7 @@ let else '' def assemble_qemu_flags(): flags = "-cpu max" - ${if system == "x86_64-linux" + ${if (system == "x86_64-linux" || system == "i686-linux") then ''flags += " -m 1024"'' else ''flags += " -m 768 -enable-kvm -machine virt,gic-version=host"'' } From 9fb7b6dc1d2b5521535d02eb4da3ef09fa74f644 Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Mon, 3 May 2021 13:51:47 +0800 Subject: [PATCH 36/59] mautrix-signal: Fix incorrect escaping in wrapper --- pkgs/servers/mautrix-signal/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/mautrix-signal/default.nix b/pkgs/servers/mautrix-signal/default.nix index 2bf69a63061..c39394879fb 100644 --- a/pkgs/servers/mautrix-signal/default.nix +++ b/pkgs/servers/mautrix-signal/default.nix @@ -37,7 +37,7 @@ python3Packages.buildPythonPackage rec { # Make a little wrapper for running mautrix-signal with its dependencies echo "$mautrixSignalScript" > $out/bin/mautrix-signal echo "#!/bin/sh - exec python -m mautrix_signal \"$@\" + exec python -m mautrix_signal \"\$@\" " > $out/bin/mautrix-signal chmod +x $out/bin/mautrix-signal wrapProgram $out/bin/mautrix-signal \ From 935db0c11b26506d9e6293c78d99a19d4c73cfb1 Mon Sep 17 00:00:00 2001 From: oxalica Date: Mon, 3 May 2021 15:18:12 +0800 Subject: [PATCH 37/59] osu-lazer: 2021.410.0 -> 2021.502.0 --- pkgs/games/osu-lazer/default.nix | 4 +- pkgs/games/osu-lazer/deps.nix | 286 +++++++++++++++++-------------- 2 files changed, 160 insertions(+), 130 deletions(-) diff --git a/pkgs/games/osu-lazer/default.nix b/pkgs/games/osu-lazer/default.nix index 81f50e96822..7dd9235b69d 100644 --- a/pkgs/games/osu-lazer/default.nix +++ b/pkgs/games/osu-lazer/default.nix @@ -16,13 +16,13 @@ let in stdenv.mkDerivation rec { pname = "osu-lazer"; - version = "2021.410.0"; + version = "2021.502.0"; src = fetchFromGitHub { owner = "ppy"; repo = "osu"; rev = version; - sha256 = "twKg9iZdY+zgwEQeHMOlRZKXxAHic7GnoqH0jOdW7fw="; + sha256 = "IOneihYQry0pRXYaxZuVLIj2Ydei//khvpqwiJoakZ8="; }; patches = [ ./bypass-tamper-detection.patch ]; diff --git a/pkgs/games/osu-lazer/deps.nix b/pkgs/games/osu-lazer/deps.nix index f30ac9b13f4..9c839ec376e 100644 --- a/pkgs/games/osu-lazer/deps.nix +++ b/pkgs/games/osu-lazer/deps.nix @@ -26,8 +26,8 @@ }) (fetchNuGet { name = "Humanizer"; - version = "2.8.26"; - sha256 = "11kddzyzqpq9gkz0hmrblq494nh86va6wxx6z89xi6w1f4vj15ak"; + version = "2.9.9"; + sha256 = "07ql79qz4m7cdr6g0f0dxjywrv70xzpzz45gch73x1ad4vwc5n4m"; }) (fetchNuGet { name = "Humanizer.Core"; @@ -36,228 +36,243 @@ }) (fetchNuGet { name = "Humanizer.Core"; - version = "2.8.26"; - sha256 = "1v8xd12yms4qq1md4vh6faxicmqrvahqdd7sdkyzrphab9v44nsm"; + version = "2.9.9"; + sha256 = "05sn5l0qg5bi8qxqxlch88zlk79z9pbh6jwln7b3yxnp4hkj4kvm"; }) (fetchNuGet { name = "Humanizer.Core.af"; - version = "2.8.26"; - sha256 = "0znrq4frlkq1qi20301hlzxa6mdc275fa1i1a1i8ldgk9cjq94k9"; + version = "2.9.9"; + sha256 = "0l51ll73gjjarpyknj81v8f64mg0f0zlc7q3sgcz4fkmj6n0wxb3"; }) (fetchNuGet { name = "Humanizer.Core.ar"; - version = "2.8.26"; - sha256 = "1hi7mln48p1nmxlgdq725s4cvla9nlkvbmrsql1rfjjlsy8hn6n7"; + version = "2.9.9"; + sha256 = "1akrcrxl01phzp1cyhknwcmghhmr808dzv9aj8vzjmyq67p8mnja"; }) (fetchNuGet { name = "Humanizer.Core.az"; - version = "2.8.26"; - sha256 = "0av7ycrqwvmikqia3z3qkp9967zilrhayny17zkm0d0mnjq62vs6"; + version = "2.9.9"; + sha256 = "0jsxjvhmgwngx5b1yki5g6ns7yhzn3m5invzlnl79dh09krx9pg4"; }) (fetchNuGet { name = "Humanizer.Core.bg"; - version = "2.8.26"; - sha256 = "13j6zk2cmk7a119azxlpjhfwykrzk0vkf5a799fb2fzkvhnj4hkg"; + version = "2.9.9"; + sha256 = "0l32vi52qkvx267qnykid5965199h6rcy5r04gmkv3lg2ydds0ig"; }) (fetchNuGet { name = "Humanizer.Core.bn-BD"; - version = "2.8.26"; - sha256 = "0h619sksggfi7dnaycz6bj9aiqdgn0d8dpgjgdl73crw52lr70p9"; + version = "2.9.9"; + sha256 = "1yivbxcxh15jgy8j5fzrd40c9k75wmcd9wdy1333zwcyrwqzpx7v"; }) (fetchNuGet { name = "Humanizer.Core.cs"; - version = "2.8.26"; - sha256 = "11bh3k15388bi5wizaihnwqk7wb4n7q636fqjllwdhjggqrsc3f6"; + version = "2.9.9"; + sha256 = "05ysribnj8b2q2fcm33lcgz7mcdgx5q53w6vihyjc5s6zmlfqqfr"; }) (fetchNuGet { name = "Humanizer.Core.da"; - version = "2.8.26"; - sha256 = "09b3x3bw3cgby9qvaccnqz2y6d8gl3497dh7q0dk1iznsxbk4x4m"; + version = "2.9.9"; + sha256 = "0d6swwliw0cbb03vjv2i1n8vcclwzragi1ik3m6ysbwm1m0sip5v"; }) (fetchNuGet { name = "Humanizer.Core.de"; - version = "2.8.26"; - sha256 = "1pyp2a9my20wlwjjzv563kshl9fpjb2kd4cw41l4wvsz1bsq3l22"; + version = "2.9.9"; + sha256 = "085ijfkbz4q6q90z0qc4k5hsv2acdlhli8whiikil9mlrjsjrqhi"; }) (fetchNuGet { name = "Humanizer.Core.el"; - version = "2.8.26"; - sha256 = "0v3sdcxca4dam1y5yjh9n6v711ys0zdv38hr4kij35s6277ls6lb"; + version = "2.9.9"; + sha256 = "1f5fr6l8f4brva1jxx6migv9yhp98svwkzly1b2b6n43ngppn4jd"; }) (fetchNuGet { name = "Humanizer.Core.es"; - version = "2.8.26"; - sha256 = "0wh9qvqf80cngwsz2jnrsjpmaax4xa2xp8bbk5xs480kp071z37q"; + version = "2.9.9"; + sha256 = "0nwwxhp2wgq424fy2mjrgsjsm86y818zl64k6zibkcnfldm8als6"; }) (fetchNuGet { name = "Humanizer.Core.fa"; - version = "2.8.26"; - sha256 = "00v56ddjfv6sr6w5246gn5z0padwswvnngp8mdl7gjfg5ycmbkl1"; + version = "2.9.9"; + sha256 = "1268lf9lxxnnax0ivyghh707fy50z09qds2jlh53dw1q0lxqgp50"; }) (fetchNuGet { name = "Humanizer.Core.fi-FI"; - version = "2.8.26"; - sha256 = "1pgs0j5ri50a6vhljplhrlc8jj1hrd9ggxkj60d9v5kk9xibzzyd"; + version = "2.9.9"; + sha256 = "1cjs78z1lc7a42b1wvcpxpydyv65rvyfvfic8k0d2flwcv98i7z2"; }) (fetchNuGet { name = "Humanizer.Core.fr"; - version = "2.8.26"; - sha256 = "0kkhgy3yn8vfqlx3dhb9m3cazkgfxarknam4macng9y17l7wj83m"; + version = "2.9.9"; + sha256 = "1al0xbg6p0287v60a4s6k7vgsng6k4m0scwlshmqsqxmvfsa1wk3"; }) (fetchNuGet { name = "Humanizer.Core.fr-BE"; - version = "2.8.26"; - sha256 = "13spcx07hph366qk073pz63s56nadaac7l4mr4a66gbpqd3814kb"; + version = "2.9.9"; + sha256 = "0jvi063lsrzds52zvq4w4qx6khkjcn5k8mp4014pzlphfhvlfbcl"; }) (fetchNuGet { name = "Humanizer.Core.he"; - version = "2.8.26"; - sha256 = "1ccn82aj3rhrhsa3kvkrmjw0p687icxlfja8ngbh7sby4cszx9bk"; + version = "2.9.9"; + sha256 = "1azymmsf79dyl8ihx8kn19mymx98sjknaqrqf043fy8qwirll1wm"; }) (fetchNuGet { name = "Humanizer.Core.hr"; - version = "2.8.26"; - sha256 = "12ii79bhai3kv7zr3k9k9dh569r6p3m4l4gj25cln2isr4wdi5r9"; + version = "2.9.9"; + sha256 = "1ygi02nxssn1wrdzammr5km7ak5h8yxghfvbcmy559npg0gy2gya"; }) (fetchNuGet { name = "Humanizer.Core.hu"; - version = "2.8.26"; - sha256 = "0cibbdxiqhwrjmxlr805mg3l9v0fl2ydx4m50608rkysjq6vxx7y"; + version = "2.9.9"; + sha256 = "0nimza5dngvl6yyigavr1rk5068yf2fmq3w3nm128plbnc8ynxfr"; }) (fetchNuGet { name = "Humanizer.Core.hy"; - version = "2.8.26"; - sha256 = "15aikm04f74abm4ak8rvnnkrlcz155gibn1y81pbgsyn7yrh84v3"; + version = "2.9.9"; + sha256 = "0v11hfh39mzm27dshmakhdnbpgzg660mskn1pkmmfdprka970cfj"; }) (fetchNuGet { name = "Humanizer.Core.id"; - version = "2.8.26"; - sha256 = "1i9gpzdfhmbvrqg858kqz5461sp3sh60g16dmcmyi1ik0qlspijn"; + version = "2.9.9"; + sha256 = "012bhisp75s4wv37ra692bfsvibnqgbfyipb2hw0743dqcy2mah2"; }) (fetchNuGet { name = "Humanizer.Core.it"; - version = "2.8.26"; - sha256 = "01j7qskmqcxsakbx3bkxcjyzrh6nxi2v6kfzsfb0vf980qqq331l"; + version = "2.9.9"; + sha256 = "1jj7qbia4b09hsyll524mpz67vy4z25zazwc1g10yi1sjsyah92f"; }) (fetchNuGet { name = "Humanizer.Core.ja"; - version = "2.8.26"; - sha256 = "07d19ns4a4pa2k4vdc1af7wj10gaflq1ny4mx6y574afkdi8v6d5"; + version = "2.9.9"; + sha256 = "1wqxw815287jlg6a6x3ffjhxvpa5al94jh3qkai2rw5kggcqzws4"; + }) + (fetchNuGet { + name = "Humanizer.Core.ko-KR"; + version = "2.9.9"; + sha256 = "1azggn1i8gnvc89kh7mv165bd2c7fwp1m1h9k6fcdk36kl4xxb97"; + }) + (fetchNuGet { + name = "Humanizer.Core.ku"; + version = "2.9.9"; + sha256 = "1qpwancwa6hgafrcdpbdb00vq08hrk77wjl64dvcjsx010n4c0fc"; }) (fetchNuGet { name = "Humanizer.Core.lv"; - version = "2.8.26"; - sha256 = "1pm64sj65nmngyfa3hjcw67icfmlzr232hmgpnw7306sb7dxmnfv"; + version = "2.9.9"; + sha256 = "1k6gxlzkpfmp8khn0dl0bfw878qpdff6zjqbirgpvlc57d00bws4"; }) (fetchNuGet { name = "Humanizer.Core.ms-MY"; - version = "2.8.26"; - sha256 = "1yx4cc023kc4k14abk2ycmjy6y2xaknaz4zria7xsadf0fabd1jc"; + version = "2.9.9"; + sha256 = "0p0lc3qkq5f8354g77xgy8qc9wyc509rca8xrzgc2lpzbvb4v008"; }) (fetchNuGet { name = "Humanizer.Core.mt"; - version = "2.8.26"; - sha256 = "0iai35pzka9g6c3sgswki06fk6gdnq8kc88wyb4pcciivazz31px"; + version = "2.9.9"; + sha256 = "0qn2c583lbc5qg0i1inqjb7zn8vcmvmjy8k70ngb6qyl1navmvcm"; }) (fetchNuGet { name = "Humanizer.Core.nb"; - version = "2.8.26"; - sha256 = "0xprhiyjyq6mpha2lrav59n1f48508ddvm9nmdk5sm5k26ff3l90"; + version = "2.9.9"; + sha256 = "12b7dx6jp5fcwsn54i7w1qz8y3cwbl8n8hia75iy9acd9l328shk"; }) (fetchNuGet { name = "Humanizer.Core.nb-NO"; - version = "2.8.26"; - sha256 = "160c98wfh7d2xlvlra4x5rdj4klgcjwcy3gkb4ipg655byn2m1j2"; + version = "2.9.9"; + sha256 = "04f47z9klpj6dq1gqlbcgyrli2s3rjci75i8lrng63vjjqi7jpqh"; }) (fetchNuGet { name = "Humanizer.Core.nl"; - version = "2.8.26"; - sha256 = "067pqm4i1mk83fqqr0bvzrchrvxwdnff18z3djgagclh1i4xqlvk"; + version = "2.9.9"; + sha256 = "19l4ik73500k2nxpcpylawy1aimb0awd82521abry3az4kc1lf29"; }) (fetchNuGet { name = "Humanizer.Core.pl"; - version = "2.8.26"; - sha256 = "1r1bbqb990war1hiag5f88yxw0k9jiid1ihb4s5bc1lzs3vfsb6x"; + version = "2.9.9"; + sha256 = "0hdh6gvz00xbrfyypwlbaw14409p75wqxraih2ckw23g8ci404l3"; }) (fetchNuGet { name = "Humanizer.Core.pt"; - version = "2.8.26"; - sha256 = "1bik0vjjdzw51yl11ng9gsi3ihz50ibwh1gdhh2vd13jxjzb512p"; + version = "2.9.9"; + sha256 = "03xplyqms9hpkl2bzhnqij3il78adi8a4azrs658rslpl8fl7ksd"; }) (fetchNuGet { name = "Humanizer.Core.ro"; - version = "2.8.26"; - sha256 = "12f2hry6x1p1mgx6g4kpig2jpybx52ibghvhdhjbbfhy32gv8dr0"; + version = "2.9.9"; + sha256 = "0x8qjkp8w32bhwr6509zpxlkvxb9izkgzq411hmh2sx4hrr90pzc"; }) (fetchNuGet { name = "Humanizer.Core.ru"; - version = "2.8.26"; - sha256 = "1hri12kwymzvdqcr66l8yiqiw3pmf9fk492z10yqljm576kyshgg"; + version = "2.9.9"; + sha256 = "0s2f9wxqwy281zw7aiswvfk8dg0i278g4z2l3bqn9iyijqm47zxx"; }) (fetchNuGet { name = "Humanizer.Core.sk"; - version = "2.8.26"; - sha256 = "07jfgk67axw97b85dn4bwpjwf3swd74j9hdd870qps12xfp98i9j"; + version = "2.9.9"; + sha256 = "0nq27nx6xq81d5avriphm7s926xm34306v7l7c88n71kn097jzl9"; }) (fetchNuGet { name = "Humanizer.Core.sl"; - version = "2.8.26"; - sha256 = "060xbzwb7p9ypbqfklih2zal2rh6h55gq4hv3i6alvlbd3vsx29n"; + version = "2.9.9"; + sha256 = "0dwszkm2xd4ysh3rrjx1zran09hl532hjrppfckqyy6n65b4axyf"; }) (fetchNuGet { name = "Humanizer.Core.sr"; - version = "2.8.26"; - sha256 = "0i2c24qmqnhp85b088qlbagxd48hcl0v1ly4m7hfbvx5s7fg8riv"; + version = "2.9.9"; + sha256 = "1vmfs9jp8ljlh6965pmb4afbcc9c4zlg5dn1pgbjc4miiwj6vc73"; }) (fetchNuGet { name = "Humanizer.Core.sr-Latn"; - version = "2.8.26"; - sha256 = "1911a69sqssh9f007vmxbgyj4ym2ym4423xvw6cmbfhjcrhkfpbi"; + version = "2.9.9"; + sha256 = "1dakb2zcaxmm9qw8fnsz5z12mmbjgx7jm9plxbm7jidjn7z271yl"; }) (fetchNuGet { name = "Humanizer.Core.sv"; - version = "2.8.26"; - sha256 = "056h8n9i18yl78f9ppzn2kkrz2cs46aqv0j5y8xq360zarggh0nm"; + version = "2.9.9"; + sha256 = "0jys46lz25yxx70w7y2623iabv3clf3lix8jzl8r68rj0lw6pxdz"; + }) + (fetchNuGet { + name = "Humanizer.Core.th-TH"; + version = "2.9.9"; + sha256 = "0r37ckvh68xvlyszgx94a8xxmya5cqiqnvdg5syw04lj0rshc3jb"; }) (fetchNuGet { name = "Humanizer.Core.tr"; - version = "2.8.26"; - sha256 = "0dk8ga3fpxifxxkz0n68654h65cvrx00hy7q00m5vgvmcp70gxxn"; + version = "2.9.9"; + sha256 = "1dnba6wbf6r5a1gmf7a7136qhy1w8izbh6wimmmwqsch2sk4ng4f"; }) (fetchNuGet { name = "Humanizer.Core.uk"; - version = "2.8.26"; - sha256 = "0bnj5xqlcqp4n8i04ra78dax4854zbf2jsygvb4lpiayyyaj2bxw"; + version = "2.9.9"; + sha256 = "1z0kdp2qkiyb4dhy22rqfik2b2c899nzkfh10907gp9827rdz3b9"; }) (fetchNuGet { name = "Humanizer.Core.uz-Cyrl-UZ"; - version = "2.8.26"; - sha256 = "1bbf6mxas6brjw7rjljq5saz6v3ic6zbvm1b3c1jbk0hc0qkd7c8"; + version = "2.9.9"; + sha256 = "1rnqa7w8s44fnqpw4g2drcwyajd5zhmwkqipi5zfhh0bcdnj9hxx"; }) (fetchNuGet { name = "Humanizer.Core.uz-Latn-UZ"; - version = "2.8.26"; - sha256 = "1bfgfihpynax30g9kq8kra7c4jxps2ccxsxrs9gls47xbs35cw2f"; + version = "2.9.9"; + sha256 = "1i1c6dy4bdglgyhv8g13lwqlis1snl7zcpdrvidw40f74ch0zq0g"; }) (fetchNuGet { name = "Humanizer.Core.vi"; - version = "2.8.26"; - sha256 = "1vm765nvkp6wyfwlcgppimjrk04lkg8lscch3n1i1i5hlqxrs9ch"; + version = "2.9.9"; + sha256 = "0ji0lmcm073x9fyigrw3b500drz268jarv6vfxpwxbzxd3mvnrys"; }) (fetchNuGet { name = "Humanizer.Core.zh-CN"; - version = "2.8.26"; - sha256 = "1qyl12rdh4iv1k1qcivcmxxnh8y93ainf22pmch8vvw9yjhs1y7s"; + version = "2.9.9"; + sha256 = "10iyrahi7rdp8lq4rxb2k9pny7da2aw9xfy2la8jdjrjgmqwffsi"; }) (fetchNuGet { name = "Humanizer.Core.zh-Hans"; - version = "2.8.26"; - sha256 = "1gqv3dyk236wlp5wb7kd4qnyrmp3cy36ycykl7zr91s25cdls5vy"; + version = "2.9.9"; + sha256 = "0f92fvzgcifaf2b64x8v52xckp1qxg88djlb9vlj083f6x29ick5"; }) (fetchNuGet { name = "Humanizer.Core.zh-Hant"; - version = "2.8.26"; - sha256 = "1rhzbiqbx04l3kvzjklix90fxyc6vvmmw0p564ajdiximivs0pbh"; + version = "2.9.9"; + sha256 = "0v9vqn6h467q7fy3xwabnqw48p48ilwkfg62b65j0q76ppnvsnvj"; }) (fetchNuGet { name = "JetBrains.Annotations"; @@ -301,53 +316,53 @@ }) (fetchNuGet { name = "Microsoft.AspNetCore.Connections.Abstractions"; - version = "5.0.4"; - sha256 = "002a3cvarwvvyic65khwavjxqsqjlnbgqc11sdyj3li15fxflk5g"; + version = "5.0.5"; + sha256 = "0qi4q54v7qiyc7xjbby88vmg1zcnb39sg8g1s7h0dnvapa436jv5"; }) (fetchNuGet { name = "Microsoft.AspNetCore.Http.Connections.Client"; - version = "5.0.4"; - sha256 = "1s19hx083c0r98wi6a8gqb3j3xjlrp9rkmvbpdxikzw8z4bnrjpn"; + version = "5.0.5"; + sha256 = "1lpsjv6475p2vdvwv9wwmpzxc0r9bfya15nc5xqiv8m9z8d4sxlh"; }) (fetchNuGet { name = "Microsoft.AspNetCore.Http.Connections.Common"; - version = "5.0.4"; - sha256 = "132ahfq7m369iss4ka402fj24rjdnhia41b94l3l135zplzlsl5n"; + version = "5.0.5"; + sha256 = "1knfn9d1wsczaic3vlnracmj5frpaxwx15x7j06kgi2kl6j2hbc7"; }) (fetchNuGet { name = "Microsoft.AspNetCore.Http.Features"; - version = "5.0.4"; - sha256 = "064n12ydyngh5q3y597x5cmciib74mpnhkvxicqp0kmgqsixkc7b"; + version = "5.0.5"; + sha256 = "011xdkqna8q0r2h9i1f646rkfjbl9qbaq56a487zagp8plwxvaxl"; }) (fetchNuGet { name = "Microsoft.AspNetCore.SignalR.Client"; - version = "5.0.4"; - sha256 = "0rpafasicnqng7ylx29hyslwp6g2j1l92szs0n9j98siscap17qg"; + version = "5.0.5"; + sha256 = "0r16n5c4im7gkfrhx2miiz9w58j0z87wjysbi4rsdav94hmkvgj4"; }) (fetchNuGet { name = "Microsoft.AspNetCore.SignalR.Client.Core"; - version = "5.0.4"; - sha256 = "1fwy2akhgphx72hc3rlax08aiaabvm9fi6jfj2r1dyzb2plcgig3"; + version = "5.0.5"; + sha256 = "11phwns2sn44vfd3vn6c0lh3aiiysfpav7rmv4cmjkxp3jmpay8r"; }) (fetchNuGet { name = "Microsoft.AspNetCore.SignalR.Common"; - version = "5.0.4"; - sha256 = "1dy00sf695sz842rlvgbyj2krgiqprx8qcdci8lz388rwp17drk2"; + version = "5.0.5"; + sha256 = "0am84ckim30djh4inv7mqph50axik79dwbfyrzlnaxcd3jr73c8c"; }) (fetchNuGet { name = "Microsoft.AspNetCore.SignalR.Protocols.Json"; - version = "5.0.4"; - sha256 = "0xp6ihjq835iqiiaxjl501pfplkqhd40kqxkazfj1icryls8hzhq"; + version = "5.0.5"; + sha256 = "1z8d2dsgj9bh9a2xcz5xlrw4iijgmrm1midkdqni9b4nypbyraf6"; }) (fetchNuGet { name = "Microsoft.AspNetCore.SignalR.Protocols.MessagePack"; - version = "5.0.4"; - sha256 = "1bvy4pvp3kxl75mbgy7saapjcnczylrqhf8ry0s66r12f7bzjki8"; + version = "5.0.5"; + sha256 = "0p52j1mrihvm4y4yp2rnimp4vdypn0hbba0p79vp617jj17vs45l"; }) (fetchNuGet { name = "Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson"; - version = "5.0.4"; - sha256 = "1gbkgc3cqv7q10k9hrjfj1ixpwx7b4n0x2f7sn9snsh977w7209j"; + version = "5.0.5"; + sha256 = "0jllzr9sba5m9ccdslr4dysmxzrfzy9zvianmqhmj4is6dg2krfs"; }) (fetchNuGet { name = "Microsoft.Bcl.AsyncInterfaces"; @@ -574,6 +589,11 @@ version = "5.0.0"; sha256 = "0swqcknyh87ns82w539z1mvy804pfwhgzs97cr3nwqk6g5s42gd6"; }) + (fetchNuGet { + name = "Microsoft.Extensions.Primitives"; + version = "5.0.1"; + sha256 = "01ar5ba2sal9wnpa1xnnikhgb37vzhg2cspz45wf760jflpai2vv"; + }) (fetchNuGet { name = "Microsoft.NETCore.App.Runtime.linux-x64"; version = "5.0.5"; @@ -629,6 +649,11 @@ version = "0.9.6.1"; sha256 = "1fr7969h5q611l5227xw6nvv5rzap76vbpk0wg9hxbcxk3hn7szf"; }) + (fetchNuGet { + name = "Mono.Posix.NETStandard"; + version = "1.0.0"; + sha256 = "0xlja36hwpjm837haq15mjh2prcf68lyrmn72nvgpz8qnf9vappw"; + }) (fetchNuGet { name = "NETStandard.Library"; version = "1.6.0"; @@ -706,23 +731,23 @@ }) (fetchNuGet { name = "NUnit"; - version = "3.13.1"; - sha256 = "07156gr0yl9rqhyj44cp1xz9jpngbl5kb7ci3qfy9fcp01dczmm9"; + version = "3.13.2"; + sha256 = "00bkjgarkwbj497da9d7lajala1ns67h1kx53w4bapwkf32jlcvn"; }) (fetchNuGet { name = "OpenTabletDriver"; - version = "0.5.2.3"; - sha256 = "1qz5vmdwmfw8glkm6r7n06srcvrz5c3cwld1wv6xw4sagvwf0b6g"; + version = "0.5.3.1"; + sha256 = "16xw8w943x9gvnnpbryahff5azzy8n26j2igyqgv88m352jd9rb8"; }) (fetchNuGet { name = "OpenTabletDriver.Plugin"; - version = "0.5.2.3"; - sha256 = "0i03n5aydn0rv1v2y9c1cm9a2ss9y7p7l92k1x2yb6mwbx6vkpda"; + version = "0.5.3.1"; + sha256 = "17dxsvcz9g8kzydk5xlfz9kfxl62x9wi20609rh76wjd881bg1br"; }) (fetchNuGet { name = "ppy.osu.Framework"; - version = "2021.410.0"; - sha256 = "1vwdrspdpal44hyspv3rsax8mkszvbnc2xl1xswczx9mzj6qs4by"; + version = "2021.427.0"; + sha256 = "18n9g21y7asgr51fskfk3m0sx07y1mwrsdq4s065i8yk8d412mh7"; }) (fetchNuGet { name = "ppy.osu.Framework.NativeLibs"; @@ -731,8 +756,8 @@ }) (fetchNuGet { name = "ppy.osu.Game.Resources"; - version = "2021.410.0"; - sha256 = "1a5qia4595n0b21dj63sl71ar56m9x1glqwky7a9bb0dqpvfivya"; + version = "2021.422.0"; + sha256 = "1zw0197k6wmmjqjh022q3302mrwn59msx06y66378pahmhrr0sjc"; }) (fetchNuGet { name = "ppy.osuTK.NS20"; @@ -856,8 +881,8 @@ }) (fetchNuGet { name = "Sentry"; - version = "3.2.0"; - sha256 = "1hhgc4sqd7nampqydpdwfrc04hhqlkbv4p4w8cq6dswp5rf5k89b"; + version = "3.3.4"; + sha256 = "188rlyg6xfmgk6ypyg1mmbvm8d64q3wfjn3h0ays73b9wlypk8x6"; }) (fetchNuGet { name = "SharpCompress"; @@ -866,8 +891,8 @@ }) (fetchNuGet { name = "SharpCompress"; - version = "0.28.1"; - sha256 = "1h7gx7apafdd0jnv12fppca9b6cpq205kjkcipclxp1lli0i7qvw"; + version = "0.28.2"; + sha256 = "0pj30qm48m9vpq3i8wx9x11ficv36ki1973dk0873vqgvw8fwjj4"; }) (fetchNuGet { name = "SharpFNT"; @@ -1604,6 +1629,11 @@ version = "5.0.0"; sha256 = "144pgy65jc3bkar7d4fg1c0rq6qmkx68gj9k1ldk97558w22v1r1"; }) + (fetchNuGet { + name = "System.Text.Encodings.Web"; + version = "5.0.1"; + sha256 = "00yg63qnp94q2qryxxggzigi276bibb8b3b96gcvsyrxy7b703n9"; + }) (fetchNuGet { name = "System.Text.Json"; version = "5.0.0"; @@ -1611,8 +1641,8 @@ }) (fetchNuGet { name = "System.Text.Json"; - version = "5.0.1"; - sha256 = "1j7via4spxy73ipng754wdz1nb882gsb9qh26jqlql66vzbbm3j3"; + version = "5.0.2"; + sha256 = "0vd0wd29cdhgcjngl9sw391sn2s8xm974y15zvym0whsdgjwiqfx"; }) (fetchNuGet { name = "System.Text.RegularExpressions"; From c98e84c00d48000461ba97e0026ff3fadf79ec54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Gr=C3=A4fenstein?= Date: Mon, 3 May 2021 09:42:48 +0200 Subject: [PATCH 38/59] nodejs*: add meta.mainProgram --- pkgs/development/web/nodejs/nodejs.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix index 09d15901ada..0e52dd5f804 100644 --- a/pkgs/development/web/nodejs/nodejs.nix +++ b/pkgs/development/web/nodejs/nodejs.nix @@ -142,6 +142,7 @@ in license = licenses.mit; maintainers = with maintainers; [ goibhniu gilligan cko marsam ]; platforms = platforms.linux ++ platforms.darwin; + mainProgram = "node"; }; passthru.python = python; # to ensure nodeEnv uses the same version From ecbef6fb515863bc3016e7f51503e3f23d550747 Mon Sep 17 00:00:00 2001 From: TredwellGit Date: Mon, 3 May 2021 09:28:26 +0000 Subject: [PATCH 39/59] electron_11: 11.4.3 -> 11.4.4 https://github.com/electron/electron/releases/tag/v11.4.4 --- pkgs/development/tools/electron/default.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/development/tools/electron/default.nix b/pkgs/development/tools/electron/default.nix index 077d6c74c8b..3f2d3dfac3d 100644 --- a/pkgs/development/tools/electron/default.nix +++ b/pkgs/development/tools/electron/default.nix @@ -95,13 +95,13 @@ rec { headers = "0phv08myxq226blrqzg3fza3mh3ivgfmcja98b7377pc3x7bv76g"; }; - electron_11 = mkElectron "11.4.3" { - x86_64-linux = "222e7aa51d5516796d532f784c574f07315bad4bf29efb0ce687014f93ba5fa5"; - x86_64-darwin = "6cccbaf8dca7eb3819b0ac3044686f6705c5d51c88ee1361d8573c2b83c8dc0a"; - i686-linux = "1910729fd6088e9c914db9fdd6c42ce6747fcb048947dd83fa2cdf564c786353"; - armv7l-linux = "e0e1375bdb79a6917467490683e49bb59da9260b73d7b710a5e4e4535c1c5e80"; - aarch64-linux = "9fb287ed8bcc7782775bd615fe1c31db4a8b6d548209fd15ef5312ac72a04d07"; - headers = "00gln9jlb621gvxx1z7s212wakjbdigdqv02vx1pjvkg62aazg8j"; + electron_11 = mkElectron "11.4.4" { + x86_64-linux = "154ae71e674b37b6cb5ec56e0f569435cb9303a5b0c0608bd2e1d026803be1a5"; + x86_64-darwin = "783962e25433178a1e41b895dbbebc7b82efbe819dbd08c9314d2f4547c73e05"; + i686-linux = "fcfeba63e490648156f01bbe51f27123f93762713f6ab5e4433dc9c232708a25"; + armv7l-linux = "3b98dabbce5a5a8ba66d2f909174b792eeccddd95fd4396a596130f6817ec0d3"; + aarch64-linux = "cf886b382f4e3815487ee1403d4bb6ff434ecd9625e61c9ecf082f482c88617e"; + headers = "1wjcygxy6lvmf1lw857rcd499jk8103nvld0q3jj4r90gwbdhfi3"; }; electron_12 = mkElectron "12.0.5" { From e1c4eed3dbec38c1efa5cc74b71ef015929b7d63 Mon Sep 17 00:00:00 2001 From: TredwellGit Date: Mon, 3 May 2021 09:29:03 +0000 Subject: [PATCH 40/59] electron_10: 10.4.3 -> 10.4.4 https://github.com/electron/electron/releases/tag/v10.4.4 --- pkgs/development/tools/electron/default.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/development/tools/electron/default.nix b/pkgs/development/tools/electron/default.nix index 3f2d3dfac3d..a3f58ae827e 100644 --- a/pkgs/development/tools/electron/default.nix +++ b/pkgs/development/tools/electron/default.nix @@ -86,13 +86,13 @@ rec { headers = "0yx8mkrm15ha977hzh7g2sc5fab9sdvlk1bk3yxignhxrqqbw885"; }; - electron_10 = mkElectron "10.4.3" { - x86_64-linux = "48793fc6c6d3bfb8df81cd29f6c52e68c8c6b901693c6ba4ed505799fa673e9f"; - x86_64-darwin = "28cbacf51e0528e0d4ba30a2c56efd6a8e7f836104786733aae0c5fc99dc2615"; - i686-linux = "b9b7fd9b91630350dafe97a31c918f941ab15b044f0b4e9b2a705482447fe78f"; - armv7l-linux = "b1e1b4d0620eae647915c95d21656d21c00efe89f44198938d9fd9fba045e39c"; - aarch64-linux = "aa9177becf787920cef4cde27a6ed08e2e23976678162a3cd6b77615b1582c05"; - headers = "0phv08myxq226blrqzg3fza3mh3ivgfmcja98b7377pc3x7bv76g"; + electron_10 = mkElectron "10.4.4" { + x86_64-linux = "e82d347ff4753fd4296550e403390c7a9c448d150ea6bb05bd245fd43ac5a708"; + x86_64-darwin = "b8f01dedbd81c58e1dc0fafd316e4c1be07681f7e6d42d3f6f3947cf78d9a8fa"; + i686-linux = "2e7847c902e174496e152030932a921ca1cfb2ffcb556e2a01b08d8235eb333d"; + armv7l-linux = "303c246816bff2dc7aeb26d37d99fe82e4bbe484e3e96f42731f6350498b1af2"; + aarch64-linux = "21ba3370b01870fc498d7e180d034a3e3b59a84af231d2dcd82984d6d09fd5da"; + headers = "0qxzsycpdq1g8a2yaw7g43da1f8ijpbhj97vvxza8nnvxiay5apf"; }; electron_11 = mkElectron "11.4.4" { From 310a52ad8947be0afea7fc27d84b59c3bec50308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 3 May 2021 12:15:08 +0200 Subject: [PATCH 41/59] authenticator: unvendor patch --- .../applications/misc/authenticator/767.patch | 1952 ----------------- .../misc/authenticator/default.nix | 15 +- 2 files changed, 8 insertions(+), 1959 deletions(-) delete mode 100644 pkgs/applications/misc/authenticator/767.patch diff --git a/pkgs/applications/misc/authenticator/767.patch b/pkgs/applications/misc/authenticator/767.patch deleted file mode 100644 index 2c4bf63128b..00000000000 --- a/pkgs/applications/misc/authenticator/767.patch +++ /dev/null @@ -1,1952 +0,0 @@ -From 70588b2f2191bdb8d6859e0a0c50a87e24237bba Mon Sep 17 00:00:00 2001 -From: Rafostar <40623528+Rafostar@users.noreply.github.com> -Date: Wed, 30 Dec 2020 11:24:49 +0100 -Subject: [PATCH 01/10] gtk: port to event controllers - -Prepare for GTK4 support by porting deprecated events -to EventControllers. This also bumps minimal required GTK version to 3.24 ---- - ext/gtk/gtkgstbasewidget.c | 96 +++++++++++++++++++++++++------------- - ext/gtk/gtkgstbasewidget.h | 6 +++ - ext/gtk/meson.build | 2 +- - 3 files changed, 70 insertions(+), 34 deletions(-) - -diff --git a/ext/gtk/gtkgstbasewidget.c b/ext/gtk/gtkgstbasewidget.c -index 4858f2764..5d57b0ee7 100644 ---- a/ext/gtk/gtkgstbasewidget.c -+++ b/ext/gtk/gtkgstbasewidget.c -@@ -235,22 +235,34 @@ _gdk_key_to_navigation_string (guint keyval) - } - } - -+static void -+_gdk_event_free (GdkEvent * event) -+{ -+ if (event) -+ gdk_event_free (event); -+} -+ - static gboolean --gtk_gst_base_widget_key_event (GtkWidget * widget, GdkEventKey * event) -+gtk_gst_base_widget_key_event (GtkEventControllerKey * key_controller, -+ guint keyval, guint keycode, GdkModifierType state) - { -+ GtkEventController *controller = GTK_EVENT_CONTROLLER (key_controller); -+ GtkWidget *widget = gtk_event_controller_get_widget (controller); - GtkGstBaseWidget *base_widget = GTK_GST_BASE_WIDGET (widget); - GstElement *element; - - if ((element = g_weak_ref_get (&base_widget->element))) { - if (GST_IS_NAVIGATION (element)) { -- const gchar *str = _gdk_key_to_navigation_string (event->keyval); -- const gchar *key_type = -- event->type == GDK_KEY_PRESS ? "key-press" : "key-release"; -- -- if (!str) -- str = event->string; -- -- gst_navigation_send_key_event (GST_NAVIGATION (element), key_type, str); -+ GdkEvent *event = gtk_get_current_event (); -+ const gchar *str = _gdk_key_to_navigation_string (keyval); -+ -+ if (str) { -+ const gchar *key_type = -+ gdk_event_get_event_type (event) == -+ GDK_KEY_PRESS ? "key-press" : "key-release"; -+ gst_navigation_send_key_event (GST_NAVIGATION (element), key_type, str); -+ } -+ _gdk_event_free (event); - } - g_object_unref (element); - } -@@ -325,22 +337,30 @@ _display_size_to_stream_size (GtkGstBaseWidget * base_widget, gdouble x, - } - - static gboolean --gtk_gst_base_widget_button_event (GtkWidget * widget, GdkEventButton * event) -+gtk_gst_base_widget_button_event (GtkGestureMultiPress * gesture, -+ gint n_press, gdouble x, gdouble y) - { -+ GtkEventController *controller = GTK_EVENT_CONTROLLER (gesture); -+ GtkWidget *widget = gtk_event_controller_get_widget (controller); - GtkGstBaseWidget *base_widget = GTK_GST_BASE_WIDGET (widget); - GstElement *element; - - if ((element = g_weak_ref_get (&base_widget->element))) { - if (GST_IS_NAVIGATION (element)) { -+ GdkEvent *event = gtk_get_current_event (); - const gchar *key_type = -- event->type == -- GDK_BUTTON_PRESS ? "mouse-button-press" : "mouse-button-release"; -- gdouble x, y; -+ gdk_event_get_event_type (event) == GDK_BUTTON_PRESS -+ ? "mouse-button-press" : "mouse-button-release"; -+ gdouble stream_x, stream_y; -+ guint button; -+ gdk_event_get_button (event, &button); - -- _display_size_to_stream_size (base_widget, event->x, event->y, &x, &y); -+ _display_size_to_stream_size (base_widget, x, y, &stream_x, &stream_y); - - gst_navigation_send_mouse_event (GST_NAVIGATION (element), key_type, -- event->button, x, y); -+ button, stream_x, stream_y); -+ -+ _gdk_event_free (event); - } - g_object_unref (element); - } -@@ -349,19 +369,22 @@ gtk_gst_base_widget_button_event (GtkWidget * widget, GdkEventButton * event) - } - - static gboolean --gtk_gst_base_widget_motion_event (GtkWidget * widget, GdkEventMotion * event) -+gtk_gst_base_widget_motion_event (GtkEventControllerMotion * motion_controller, -+ gdouble x, gdouble y) - { -+ GtkEventController *controller = GTK_EVENT_CONTROLLER (motion_controller); -+ GtkWidget *widget = gtk_event_controller_get_widget (controller); - GtkGstBaseWidget *base_widget = GTK_GST_BASE_WIDGET (widget); - GstElement *element; - - if ((element = g_weak_ref_get (&base_widget->element))) { - if (GST_IS_NAVIGATION (element)) { -- gdouble x, y; -+ gdouble stream_x, stream_y; - -- _display_size_to_stream_size (base_widget, event->x, event->y, &x, &y); -+ _display_size_to_stream_size (base_widget, x, y, &stream_x, &stream_y); - - gst_navigation_send_mouse_event (GST_NAVIGATION (element), "mouse-move", -- 0, x, y); -+ 0, stream_x, stream_y); - } - g_object_unref (element); - } -@@ -397,11 +420,6 @@ gtk_gst_base_widget_class_init (GtkGstBaseWidgetClass * klass) - - widget_klass->get_preferred_width = gtk_gst_base_widget_get_preferred_width; - widget_klass->get_preferred_height = gtk_gst_base_widget_get_preferred_height; -- widget_klass->key_press_event = gtk_gst_base_widget_key_event; -- widget_klass->key_release_event = gtk_gst_base_widget_key_event; -- widget_klass->button_press_event = gtk_gst_base_widget_button_event; -- widget_klass->button_release_event = gtk_gst_base_widget_button_event; -- widget_klass->motion_notify_event = gtk_gst_base_widget_motion_event; - - GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_base_widget, "gtkbasewidget", 0, - "Gtk Video Base Widget"); -@@ -410,8 +428,6 @@ gtk_gst_base_widget_class_init (GtkGstBaseWidgetClass * klass) - void - gtk_gst_base_widget_init (GtkGstBaseWidget * widget) - { -- int event_mask; -- - widget->force_aspect_ratio = DEFAULT_FORCE_ASPECT_RATIO; - widget->par_n = DEFAULT_PAR_N; - widget->par_d = DEFAULT_PAR_D; -@@ -423,14 +439,24 @@ gtk_gst_base_widget_init (GtkGstBaseWidget * widget) - g_weak_ref_init (&widget->element, NULL); - g_mutex_init (&widget->lock); - -+ widget->key_controller = gtk_event_controller_key_new (GTK_WIDGET (widget)); -+ g_signal_connect (widget->key_controller, "key-pressed", -+ G_CALLBACK (gtk_gst_base_widget_key_event), NULL); -+ g_signal_connect (widget->key_controller, "key-released", -+ G_CALLBACK (gtk_gst_base_widget_key_event), NULL); -+ -+ widget->motion_controller = -+ gtk_event_controller_motion_new (GTK_WIDGET (widget)); -+ g_signal_connect (widget->motion_controller, "motion", -+ G_CALLBACK (gtk_gst_base_widget_motion_event), NULL); -+ -+ widget->click_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (widget)); -+ g_signal_connect (widget->click_gesture, "pressed", -+ G_CALLBACK (gtk_gst_base_widget_button_event), NULL); -+ g_signal_connect (widget->click_gesture, "released", -+ G_CALLBACK (gtk_gst_base_widget_button_event), NULL); -+ - gtk_widget_set_can_focus (GTK_WIDGET (widget), TRUE); -- event_mask = gtk_widget_get_events (GTK_WIDGET (widget)); -- event_mask |= GDK_KEY_PRESS_MASK -- | GDK_KEY_RELEASE_MASK -- | GDK_BUTTON_PRESS_MASK -- | GDK_BUTTON_RELEASE_MASK -- | GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK; -- gtk_widget_set_events (GTK_WIDGET (widget), event_mask); - } - - void -@@ -438,6 +464,10 @@ gtk_gst_base_widget_finalize (GObject * object) - { - GtkGstBaseWidget *widget = GTK_GST_BASE_WIDGET (object); - -+ g_object_unref (widget->key_controller); -+ g_object_unref (widget->motion_controller); -+ g_object_unref (widget->click_gesture); -+ - gst_buffer_replace (&widget->pending_buffer, NULL); - gst_buffer_replace (&widget->buffer, NULL); - g_mutex_clear (&widget->lock); -diff --git a/ext/gtk/gtkgstbasewidget.h b/ext/gtk/gtkgstbasewidget.h -index 13737c632..0e31478a0 100644 ---- a/ext/gtk/gtkgstbasewidget.h -+++ b/ext/gtk/gtkgstbasewidget.h -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - - #define GTK_GST_BASE_WIDGET(w) ((GtkGstBaseWidget *)(w)) - #define GTK_GST_BASE_WIDGET_CLASS(k) ((GtkGstBaseWidgetClass *)(k)) -@@ -67,6 +68,11 @@ struct _GtkGstBaseWidget - GMutex lock; - GWeakRef element; - -+ /* event controllers */ -+ GtkEventController *key_controller; -+ GtkEventController *motion_controller; -+ GtkGesture *click_gesture; -+ - /* Pending draw idles callback */ - guint draw_id; - }; -diff --git a/ext/gtk/meson.build b/ext/gtk/meson.build -index 3a30017e7..722775e08 100644 ---- a/ext/gtk/meson.build -+++ b/ext/gtk/meson.build -@@ -13,7 +13,7 @@ optional_deps = [] - gtk_dep = dependency('gtk+-3.0', required : get_option('gtk3')) - if gtk_dep.found() - # FIXME: automagic -- if have_gstgl and gtk_dep.version().version_compare('>=3.15.0') -+ if have_gstgl and gtk_dep.version().version_compare('>=3.24.0') - have_gtk3_gl_windowing = false - - if gst_gl_have_window_x11 and gst_gl_have_platform_glx --- -GitLab - - -From 29774cbcd256b86f074bd50b40f4a57607758bf3 Mon Sep 17 00:00:00 2001 -From: Rafostar <40623528+Rafostar@users.noreply.github.com> -Date: Fri, 1 Jan 2021 17:30:23 +0100 -Subject: [PATCH 02/10] gtk: do not connect the same signals on each start - -Each time the sink start is called the same signals -were reconnected without disconnecting them earlier. - -We should still observe widget destruction even when -stopped, so lets just prevent connecting it multiple -times and disconnect only size-allocate signal on stop. ---- - ext/gtk/gstgtkglsink.c | 32 +++++++++++++++++++++++--------- - 1 file changed, 23 insertions(+), 9 deletions(-) - -diff --git a/ext/gtk/gstgtkglsink.c b/ext/gtk/gstgtkglsink.c -index 1102d47c9..3024bef95 100644 ---- a/ext/gtk/gstgtkglsink.c -+++ b/ext/gtk/gstgtkglsink.c -@@ -172,13 +172,17 @@ gst_gtk_gl_sink_start (GstBaseSink * bsink) - gst_widget = GTK_GST_GL_WIDGET (base_sink->widget); - - /* Track the allocation size */ -- gtk_sink->size_allocate_sig_handler = -- g_signal_connect (gst_widget, "size-allocate", -- G_CALLBACK (_size_changed_cb), gtk_sink); -+ if (!gtk_sink->size_allocate_sig_handler) { -+ gtk_sink->size_allocate_sig_handler = -+ g_signal_connect (gst_widget, "size-allocate", -+ G_CALLBACK (_size_changed_cb), gtk_sink); -+ } - -- gtk_sink->widget_destroy_sig_handler = -- g_signal_connect (gst_widget, "destroy", G_CALLBACK (destroy_cb), -- gtk_sink); -+ if (!gtk_sink->widget_destroy_sig_handler) { -+ gtk_sink->widget_destroy_sig_handler = -+ g_signal_connect (gst_widget, "destroy", G_CALLBACK (destroy_cb), -+ gtk_sink); -+ } - - _size_changed_cb (GTK_WIDGET (gst_widget), NULL, gtk_sink); - -@@ -188,9 +192,12 @@ gst_gtk_gl_sink_start (GstBaseSink * bsink) - return FALSE; - } - -- gtk_sink->display = gtk_gst_gl_widget_get_display (gst_widget); -- gtk_sink->context = gtk_gst_gl_widget_get_context (gst_widget); -- gtk_sink->gtk_context = gtk_gst_gl_widget_get_gtk_context (gst_widget); -+ if (!gtk_sink->display) -+ gtk_sink->display = gtk_gst_gl_widget_get_display (gst_widget); -+ if (!gtk_sink->context) -+ gtk_sink->context = gtk_gst_gl_widget_get_context (gst_widget); -+ if (!gtk_sink->gtk_context) -+ gtk_sink->gtk_context = gtk_gst_gl_widget_get_gtk_context (gst_widget); - - if (!gtk_sink->display || !gtk_sink->context || !gtk_sink->gtk_context) { - GST_ELEMENT_ERROR (bsink, RESOURCE, NOT_FOUND, ("%s", -@@ -208,6 +215,13 @@ static gboolean - gst_gtk_gl_sink_stop (GstBaseSink * bsink) - { - GstGtkGLSink *gtk_sink = GST_GTK_GL_SINK (bsink); -+ GstGtkBaseSink *base_sink = GST_GTK_BASE_SINK (bsink); -+ -+ if (gtk_sink->size_allocate_sig_handler) { -+ g_signal_handler_disconnect (base_sink->widget, -+ gtk_sink->size_allocate_sig_handler); -+ gtk_sink->size_allocate_sig_handler = 0; -+ } - - if (gtk_sink->display) { - gst_object_unref (gtk_sink->display); --- -GitLab - - -From 754b6b50d2d266c07c360ca72a62f368be664eef Mon Sep 17 00:00:00 2001 -From: Rafostar <40623528+Rafostar@users.noreply.github.com> -Date: Wed, 14 Oct 2020 16:25:53 +0200 -Subject: [PATCH 03/10] gtkglsink: add GTK4 support - -This commit adds required changes to compile the "gtk" plugin -against GTK4 from the same source code. - -The output "gtk4" plugin includes new "gtk4glsink". ---- - ext/gtk/gstgtkbasesink.c | 70 ++++++++++++++++++++++++----- - ext/gtk/gstgtkglsink.c | 29 ++++++++---- - ext/gtk/gstplugin.c | 19 +++++--- - ext/gtk/gtkconfig.h | 29 ++++++++++++ - ext/gtk/gtkgstbasewidget.c | 91 ++++++++++++++++++++++++++++++++++---- - ext/gtk/gtkgstbasewidget.h | 12 +++-- - ext/gtk/gtkgstglwidget.c | 15 ++++++- - ext/gtk/meson.build | 84 ++++++++++++++++++++++++----------- - meson_options.txt | 1 + - 9 files changed, 284 insertions(+), 66 deletions(-) - create mode 100644 ext/gtk/gtkconfig.h - -diff --git a/ext/gtk/gstgtkbasesink.c b/ext/gtk/gstgtkbasesink.c -index 0c48f54d6..1f5319089 100644 ---- a/ext/gtk/gstgtkbasesink.c -+++ b/ext/gtk/gstgtkbasesink.c -@@ -1,6 +1,7 @@ - /* - * GStreamer - * Copyright (C) 2015 Matthew Waters -+ * Copyright (C) 2020 Rafał Dzięgiel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public -@@ -77,7 +78,7 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstGtkBaseSink, gst_gtk_base_sink, - G_IMPLEMENT_INTERFACE (GST_TYPE_NAVIGATION, - gst_gtk_base_sink_navigation_interface_init); - GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_base_sink, -- "gtkbasesink", 0, "Gtk Video Sink base class")); -+ "gtkbasesink", 0, "GTK Video Sink base class")); - - - static void -@@ -97,7 +98,7 @@ gst_gtk_base_sink_class_init (GstGtkBaseSinkClass * klass) - gobject_class->get_property = gst_gtk_base_sink_get_property; - - g_object_class_install_property (gobject_class, PROP_WIDGET, -- g_param_spec_object ("widget", "Gtk Widget", -+ g_param_spec_object ("widget", "GTK Widget", - "The GtkWidget to place in the widget hierarchy " - "(must only be get from the GTK main thread)", - GTK_TYPE_WIDGET, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); -@@ -114,10 +115,13 @@ gst_gtk_base_sink_class_init (GstGtkBaseSinkClass * klass) - "The pixel aspect ratio of the device", DEFAULT_PAR_N, DEFAULT_PAR_D, - G_MAXINT, 1, 1, 1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - -+ /* Disabling alpha was removed in GTK4 */ -+#if !defined(BUILD_FOR_GTK4) - g_object_class_install_property (gobject_class, PROP_IGNORE_ALPHA, - g_param_spec_boolean ("ignore-alpha", "Ignore Alpha", - "When enabled, alpha will be ignored and converted to black", - DEFAULT_IGNORE_ALPHA, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); -+#endif - - gobject_class->finalize = gst_gtk_base_sink_finalize; - -@@ -182,7 +186,11 @@ gst_gtk_base_sink_get_widget (GstGtkBaseSink * gtk_sink) - - /* Ensure GTK is initialized, this has no side effect if it was already - * initialized. Also, we do that lazily, so the application can be first */ -- if (!gtk_init_check (NULL, NULL)) { -+ if (!gtk_init_check ( -+#if !defined(BUILD_FOR_GTK4) -+ NULL, NULL -+#endif -+ )) { - GST_ERROR_OBJECT (gtk_sink, "Could not ensure GTK initialization."); - return NULL; - } -@@ -197,9 +205,11 @@ gst_gtk_base_sink_get_widget (GstGtkBaseSink * gtk_sink) - gtk_sink->bind_pixel_aspect_ratio = - g_object_bind_property (gtk_sink, "pixel-aspect-ratio", gtk_sink->widget, - "pixel-aspect-ratio", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); -+#if !defined(BUILD_FOR_GTK4) - gtk_sink->bind_ignore_alpha = - g_object_bind_property (gtk_sink, "ignore-alpha", gtk_sink->widget, - "ignore-alpha", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); -+#endif - - /* Take the floating ref, other wise the destruction of the container will - * make this widget disappear possibly before we are done. */ -@@ -313,25 +323,55 @@ gst_gtk_base_sink_start_on_main (GstBaseSink * bsink) - GstGtkBaseSink *gst_sink = GST_GTK_BASE_SINK (bsink); - GstGtkBaseSinkClass *klass = GST_GTK_BASE_SINK_GET_CLASS (bsink); - GtkWidget *toplevel; -+#if defined(BUILD_FOR_GTK4) -+ GtkRoot *root; -+#endif - - if (gst_gtk_base_sink_get_widget (gst_sink) == NULL) - return FALSE; - - /* After this point, gtk_sink->widget will always be set */ - -+#if defined(BUILD_FOR_GTK4) -+ root = gtk_widget_get_root (GTK_WIDGET (gst_sink->widget)); -+ if (!GTK_IS_ROOT (root)) { -+ GtkWidget *parent = gtk_widget_get_parent (GTK_WIDGET (gst_sink->widget)); -+ if (parent) { -+ GtkWidget *temp_parent; -+ while ((temp_parent = gtk_widget_get_parent (parent))) -+ parent = temp_parent; -+ } -+ toplevel = (parent) ? parent : GTK_WIDGET (gst_sink->widget); -+#else - toplevel = gtk_widget_get_toplevel (GTK_WIDGET (gst_sink->widget)); - if (!gtk_widget_is_toplevel (toplevel)) { -+#endif - /* sanity check */ - g_assert (klass->window_title); - - /* User did not add widget its own UI, let's popup a new GtkWindow to - * make gst-launch-1.0 work. */ -- gst_sink->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); -+ gst_sink->window = gtk_window_new ( -+#if !defined(BUILD_FOR_GTK4) -+ GTK_WINDOW_TOPLEVEL -+#endif -+ ); - gtk_window_set_default_size (GTK_WINDOW (gst_sink->window), 640, 480); - gtk_window_set_title (GTK_WINDOW (gst_sink->window), klass->window_title); -- gtk_container_add (GTK_CONTAINER (gst_sink->window), toplevel); -- gst_sink->window_destroy_id = g_signal_connect (gst_sink->window, "destroy", -- G_CALLBACK (window_destroy_cb), gst_sink); -+#if defined(BUILD_FOR_GTK4) -+ gtk_window_set_child (GTK_WINDOW ( -+#else -+ gtk_container_add (GTK_CONTAINER ( -+#endif -+ gst_sink->window), toplevel); -+ -+ gst_sink->window_destroy_id = g_signal_connect ( -+#if defined(BUILD_FOR_GTK4) -+ GTK_WINDOW (gst_sink->window), -+#else -+ gst_sink->window, -+#endif -+ "destroy", G_CALLBACK (window_destroy_cb), gst_sink); - } - - return TRUE; -@@ -350,7 +390,11 @@ gst_gtk_base_sink_stop_on_main (GstBaseSink * bsink) - GstGtkBaseSink *gst_sink = GST_GTK_BASE_SINK (bsink); - - if (gst_sink->window) { -+#if defined(BUILD_FOR_GTK4) -+ gtk_window_destroy (GTK_WINDOW (gst_sink->window)); -+#else - gtk_widget_destroy (gst_sink->window); -+#endif - gst_sink->window = NULL; - gst_sink->widget = NULL; - } -@@ -371,10 +415,14 @@ gst_gtk_base_sink_stop (GstBaseSink * bsink) - } - - static void --gst_gtk_widget_show_all_and_unref (GtkWidget * widget) -+gst_gtk_window_show_all_and_unref (GtkWidget * window) - { -- gtk_widget_show_all (widget); -- g_object_unref (widget); -+#if defined(BUILD_FOR_GTK4) -+ gtk_window_present (GTK_WINDOW (window)); -+#else -+ gtk_widget_show_all (window); -+#endif -+ g_object_unref (window); - } - - static GstStateChangeReturn -@@ -402,7 +450,7 @@ gst_gtk_base_sink_change_state (GstElement * element, GstStateChange transition) - GST_OBJECT_UNLOCK (gtk_sink); - - if (window) -- gst_gtk_invoke_on_main ((GThreadFunc) gst_gtk_widget_show_all_and_unref, -+ gst_gtk_invoke_on_main ((GThreadFunc) gst_gtk_window_show_all_and_unref, - window); - - break; -diff --git a/ext/gtk/gstgtkglsink.c b/ext/gtk/gstgtkglsink.c -index 3024bef95..daaf0eb3f 100644 ---- a/ext/gtk/gstgtkglsink.c -+++ b/ext/gtk/gstgtkglsink.c -@@ -1,6 +1,7 @@ - /* - * GStreamer - * Copyright (C) 2015 Matthew Waters -+ * Copyright (C) 2020 Rafał Dzięgiel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public -@@ -23,12 +24,18 @@ - * @title: gtkglsink - */ - -+/** -+ * SECTION:element-gtk4glsink -+ * @title: gtk4glsink -+ */ -+ - #ifdef HAVE_CONFIG_H - #include "config.h" - #endif - - #include - -+#include "gtkconfig.h" - #include "gstgtkglsink.h" - #include "gtkgstglwidget.h" - -@@ -58,7 +65,7 @@ static GstStaticPadTemplate gst_gtk_gl_sink_template = - #define gst_gtk_gl_sink_parent_class parent_class - G_DEFINE_TYPE_WITH_CODE (GstGtkGLSink, gst_gtk_gl_sink, - GST_TYPE_GTK_BASE_SINK, GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_gl_sink, -- "gtkglsink", 0, "Gtk GL Video Sink")); -+ GTKCONFIG_GLSINK, 0, GTKCONFIG_NAME " GL Video Sink")); - - static void - gst_gtk_gl_sink_class_init (GstGtkGLSinkClass * klass) -@@ -82,11 +89,13 @@ gst_gtk_gl_sink_class_init (GstGtkGLSinkClass * klass) - gstbasesink_class->get_caps = gst_gtk_gl_sink_get_caps; - - gstgtkbasesink_class->create_widget = gtk_gst_gl_widget_new; -- gstgtkbasesink_class->window_title = "Gtk+ GL renderer"; -+ gstgtkbasesink_class->window_title = GTKCONFIG_NAME " GL Renderer"; - -- gst_element_class_set_metadata (gstelement_class, "Gtk GL Video Sink", -+ gst_element_class_set_metadata (gstelement_class, -+ GTKCONFIG_NAME " GL Video Sink", - "Sink/Video", "A video sink that renders to a GtkWidget using OpenGL", -- "Matthew Waters "); -+ "Matthew Waters , " -+ "Rafał Dzięgiel "); - - gst_element_class_add_static_pad_template (gstelement_class, - &gst_gtk_gl_sink_template); -@@ -119,6 +128,7 @@ gst_gtk_gl_sink_query (GstBaseSink * bsink, GstQuery * query) - return res; - } - -+#if !defined(BUILD_FOR_GTK4) - static void - _size_changed_cb (GtkWidget * widget, GdkRectangle * rectangle, - GstGtkGLSink * gtk_sink) -@@ -138,11 +148,12 @@ _size_changed_cb (GtkWidget * widget, GdkRectangle * rectangle, - GST_OBJECT_UNLOCK (gtk_sink); - - if (reconfigure) { -- GST_DEBUG_OBJECT (gtk_sink, "Sending reconfigure event on sinkpad."); -+ GST_DEBUG_OBJECT (gtk_sink, "Sending reconfigure event on sinkpad"); - gst_pad_push_event (GST_BASE_SINK (gtk_sink)->sinkpad, - gst_event_new_reconfigure ()); - } - } -+#endif - - static void - destroy_cb (GtkWidget * widget, GstGtkGLSink * gtk_sink) -@@ -171,12 +182,14 @@ gst_gtk_gl_sink_start (GstBaseSink * bsink) - /* After this point, gtk_sink->widget will always be set */ - gst_widget = GTK_GST_GL_WIDGET (base_sink->widget); - -+#if !defined(BUILD_FOR_GTK4) - /* Track the allocation size */ - if (!gtk_sink->size_allocate_sig_handler) { - gtk_sink->size_allocate_sig_handler = - g_signal_connect (gst_widget, "size-allocate", - G_CALLBACK (_size_changed_cb), gtk_sink); - } -+#endif - - if (!gtk_sink->widget_destroy_sig_handler) { - gtk_sink->widget_destroy_sig_handler = -@@ -184,11 +197,9 @@ gst_gtk_gl_sink_start (GstBaseSink * bsink) - gtk_sink); - } - -- _size_changed_cb (GTK_WIDGET (gst_widget), NULL, gtk_sink); -- - if (!gtk_gst_gl_widget_init_winsys (gst_widget)) { - GST_ELEMENT_ERROR (bsink, RESOURCE, NOT_FOUND, ("%s", -- "Failed to initialize OpenGL with Gtk"), (NULL)); -+ "Failed to initialize OpenGL with GTK"), (NULL)); - return FALSE; - } - -@@ -201,7 +212,7 @@ gst_gtk_gl_sink_start (GstBaseSink * bsink) - - if (!gtk_sink->display || !gtk_sink->context || !gtk_sink->gtk_context) { - GST_ELEMENT_ERROR (bsink, RESOURCE, NOT_FOUND, ("%s", -- "Failed to retrieve OpenGL context from Gtk"), (NULL)); -+ "Failed to retrieve OpenGL context from GTK"), (NULL)); - return FALSE; - } - -diff --git a/ext/gtk/gstplugin.c b/ext/gtk/gstplugin.c -index ed275785b..788f4f9dd 100644 ---- a/ext/gtk/gstplugin.c -+++ b/ext/gtk/gstplugin.c -@@ -1,6 +1,7 @@ - /* - * GStreamer - * Copyright (C) 2015 Matthew Waters -+ * Copyright (C) 2020 Rafał Dzięgiel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public -@@ -22,31 +23,37 @@ - #include "config.h" - #endif - -+#include "gtkconfig.h" -+ -+#if !defined(BUILD_FOR_GTK4) - #include "gstgtksink.h" --#if defined(HAVE_GTK3_GL) -+#endif -+ -+#if defined(HAVE_GTK_GL) - #include "gstgtkglsink.h" - #endif - - static gboolean - plugin_init (GstPlugin * plugin) - { -+#if !defined(BUILD_FOR_GTK4) - if (!gst_element_register (plugin, "gtksink", - GST_RANK_NONE, GST_TYPE_GTK_SINK)) { - return FALSE; - } --#if defined(HAVE_GTK3_GL) -- if (!gst_element_register (plugin, "gtkglsink", -+#endif -+ -+#if defined(HAVE_GTK_GL) -+ if (!gst_element_register (plugin, GTKCONFIG_GLSINK, - GST_RANK_NONE, GST_TYPE_GTK_GL_SINK)) { - return FALSE; - } - #endif -- - return TRUE; - } - - GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, - GST_VERSION_MINOR, -- gtk, -- "Gtk+ sink", -+ GTKCONFIG_PLUGIN, GTKCONFIG_NAME " sink", - plugin_init, PACKAGE_VERSION, GST_LICENSE, GST_PACKAGE_NAME, - GST_PACKAGE_ORIGIN) -diff --git a/ext/gtk/gtkconfig.h b/ext/gtk/gtkconfig.h -new file mode 100644 -index 000000000..8dd28dc00 ---- /dev/null -+++ b/ext/gtk/gtkconfig.h -@@ -0,0 +1,29 @@ -+/* -+ * GStreamer -+ * Copyright (C) 2020 Rafał Dzięgiel -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Library General Public -+ * License as published by the Free Software Foundation; either -+ * version 2 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Library General Public License for more details. -+ * -+ * You should have received a copy of the GNU Library General Public -+ * License along with this library; if not, write to the -+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, -+ * Boston, MA 02110-1301, USA. -+ */ -+ -+#if defined(BUILD_FOR_GTK4) -+#define GTKCONFIG_PLUGIN gtk4 -+#define GTKCONFIG_NAME "GTK4" -+#define GTKCONFIG_GLSINK "gtk4glsink" -+#else -+#define GTKCONFIG_PLUGIN gtk -+#define GTKCONFIG_NAME "GTK" -+#define GTKCONFIG_GLSINK "gtkglsink" -+#endif -diff --git a/ext/gtk/gtkgstbasewidget.c b/ext/gtk/gtkgstbasewidget.c -index 5d57b0ee7..bd0794f2f 100644 ---- a/ext/gtk/gtkgstbasewidget.c -+++ b/ext/gtk/gtkgstbasewidget.c -@@ -1,6 +1,7 @@ - /* - * GStreamer - * Copyright (C) 2015 Matthew Waters -+ * Copyright (C) 2020 Rafał Dzięgiel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public -@@ -74,6 +75,22 @@ gtk_gst_base_widget_get_preferred_height (GtkWidget * widget, gint * min, - *natural = video_height; - } - -+#if defined(BUILD_FOR_GTK4) -+static void -+gtk_gst_base_widget_measure (GtkWidget * widget, GtkOrientation orientation, -+ gint for_size, gint * min, gint * natural, -+ gint * minimum_baseline, gint * natural_baseline) -+{ -+ if (orientation == GTK_ORIENTATION_HORIZONTAL) -+ gtk_gst_base_widget_get_preferred_width (widget, min, natural); -+ else -+ gtk_gst_base_widget_get_preferred_height (widget, min, natural); -+ -+ *minimum_baseline = -1; -+ *natural_baseline = -1; -+} -+#endif -+ - static void - gtk_gst_base_widget_set_property (GObject * object, guint prop_id, - const GValue * value, GParamSpec * pspec) -@@ -235,11 +252,23 @@ _gdk_key_to_navigation_string (guint keyval) - } - } - -+static GdkEvent * -+_get_current_event (GtkEventController * controller) -+{ -+#if defined(BUILD_FOR_GTK4) -+ return gtk_event_controller_get_current_event (controller); -+#else -+ return gtk_get_current_event (); -+#endif -+} -+ - static void - _gdk_event_free (GdkEvent * event) - { -+#if !defined(BUILD_FOR_GTK4) - if (event) - gdk_event_free (event); -+#endif - } - - static gboolean -@@ -253,7 +282,7 @@ gtk_gst_base_widget_key_event (GtkEventControllerKey * key_controller, - - if ((element = g_weak_ref_get (&base_widget->element))) { - if (GST_IS_NAVIGATION (element)) { -- GdkEvent *event = gtk_get_current_event (); -+ GdkEvent *event = _get_current_event (controller); - const gchar *str = _gdk_key_to_navigation_string (keyval); - - if (str) { -@@ -337,7 +366,12 @@ _display_size_to_stream_size (GtkGstBaseWidget * base_widget, gdouble x, - } - - static gboolean --gtk_gst_base_widget_button_event (GtkGestureMultiPress * gesture, -+gtk_gst_base_widget_button_event ( -+#if defined(BUILD_FOR_GTK4) -+ GtkGestureClick * gesture, -+#else -+ GtkGestureMultiPress * gesture, -+#endif - gint n_press, gdouble x, gdouble y) - { - GtkEventController *controller = GTK_EVENT_CONTROLLER (gesture); -@@ -347,18 +381,26 @@ gtk_gst_base_widget_button_event (GtkGestureMultiPress * gesture, - - if ((element = g_weak_ref_get (&base_widget->element))) { - if (GST_IS_NAVIGATION (element)) { -- GdkEvent *event = gtk_get_current_event (); -+ GdkEvent *event = _get_current_event (controller); - const gchar *key_type = - gdk_event_get_event_type (event) == GDK_BUTTON_PRESS - ? "mouse-button-press" : "mouse-button-release"; - gdouble stream_x, stream_y; -+#if !defined(BUILD_FOR_GTK4) - guint button; - gdk_event_get_button (event, &button); -+#endif - - _display_size_to_stream_size (base_widget, x, y, &stream_x, &stream_y); - - gst_navigation_send_mouse_event (GST_NAVIGATION (element), key_type, -- button, stream_x, stream_y); -+#if defined(BUILD_FOR_GTK4) -+ /* Gesture is set to ignore other buttons so we do not have to check */ -+ GDK_BUTTON_PRIMARY, -+#else -+ button, -+#endif -+ stream_x, stream_y); - - _gdk_event_free (event); - } -@@ -418,11 +460,15 @@ gtk_gst_base_widget_class_init (GtkGstBaseWidgetClass * klass) - "When enabled, alpha will be ignored and converted to black", - DEFAULT_IGNORE_ALPHA, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - -+#if defined(BUILD_FOR_GTK4) -+ widget_klass->measure = gtk_gst_base_widget_measure; -+#else - widget_klass->get_preferred_width = gtk_gst_base_widget_get_preferred_width; - widget_klass->get_preferred_height = gtk_gst_base_widget_get_preferred_height; -+#endif - - GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_base_widget, "gtkbasewidget", 0, -- "Gtk Video Base Widget"); -+ "GTK Video Base Widget"); - } - - void -@@ -439,23 +485,46 @@ gtk_gst_base_widget_init (GtkGstBaseWidget * widget) - g_weak_ref_init (&widget->element, NULL); - g_mutex_init (&widget->lock); - -- widget->key_controller = gtk_event_controller_key_new (GTK_WIDGET (widget)); -+ widget->key_controller = gtk_event_controller_key_new ( -+#if !defined(BUILD_FOR_GTK4) -+ GTK_WIDGET (widget) -+#endif -+ ); - g_signal_connect (widget->key_controller, "key-pressed", - G_CALLBACK (gtk_gst_base_widget_key_event), NULL); - g_signal_connect (widget->key_controller, "key-released", - G_CALLBACK (gtk_gst_base_widget_key_event), NULL); - -- widget->motion_controller = -- gtk_event_controller_motion_new (GTK_WIDGET (widget)); -+ widget->motion_controller = gtk_event_controller_motion_new ( -+#if !defined(BUILD_FOR_GTK4) -+ GTK_WIDGET (widget) -+#endif -+ ); - g_signal_connect (widget->motion_controller, "motion", - G_CALLBACK (gtk_gst_base_widget_motion_event), NULL); - -- widget->click_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (widget)); -+ widget->click_gesture = -+#if defined(BUILD_FOR_GTK4) -+ gtk_gesture_click_new (); -+#else -+ gtk_gesture_multi_press_new (GTK_WIDGET (widget)); -+#endif - g_signal_connect (widget->click_gesture, "pressed", - G_CALLBACK (gtk_gst_base_widget_button_event), NULL); - g_signal_connect (widget->click_gesture, "released", - G_CALLBACK (gtk_gst_base_widget_button_event), NULL); - -+#if defined(BUILD_FOR_GTK4) -+ gtk_widget_set_focusable (GTK_WIDGET (widget), TRUE); -+ gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (widget->click_gesture), -+ GDK_BUTTON_PRIMARY); -+ -+ gtk_widget_add_controller (GTK_WIDGET (widget), widget->key_controller); -+ gtk_widget_add_controller (GTK_WIDGET (widget), widget->motion_controller); -+ gtk_widget_add_controller (GTK_WIDGET (widget), -+ GTK_EVENT_CONTROLLER (widget->click_gesture)); -+#endif -+ - gtk_widget_set_can_focus (GTK_WIDGET (widget), TRUE); - } - -@@ -464,9 +533,13 @@ gtk_gst_base_widget_finalize (GObject * object) - { - GtkGstBaseWidget *widget = GTK_GST_BASE_WIDGET (object); - -+ /* GTK4 takes ownership of EventControllers -+ * while GTK3 still needs manual unref */ -+#if !defined(BUILD_FOR_GTK4) - g_object_unref (widget->key_controller); - g_object_unref (widget->motion_controller); - g_object_unref (widget->click_gesture); -+#endif - - gst_buffer_replace (&widget->pending_buffer, NULL); - gst_buffer_replace (&widget->buffer, NULL); -diff --git a/ext/gtk/gtkgstbasewidget.h b/ext/gtk/gtkgstbasewidget.h -index 0e31478a0..0b0fe9e55 100644 ---- a/ext/gtk/gtkgstbasewidget.h -+++ b/ext/gtk/gtkgstbasewidget.h -@@ -1,6 +1,7 @@ - /* - * GStreamer - * Copyright (C) 2015 Matthew Waters -+ * Copyright (C) 2020 Rafał Dzięgiel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public -@@ -24,7 +25,10 @@ - #include - #include - #include -+ -+#if !defined(BUILD_FOR_GTK4) - #include -+#endif - - #define GTK_GST_BASE_WIDGET(w) ((GtkGstBaseWidget *)(w)) - #define GTK_GST_BASE_WIDGET_CLASS(k) ((GtkGstBaseWidgetClass *)(k)) -@@ -39,10 +43,10 @@ typedef struct _GtkGstBaseWidgetClass GtkGstBaseWidgetClass; - struct _GtkGstBaseWidget - { - union { -+#if !defined(BUILD_FOR_GTK4) - GtkDrawingArea drawing_area; --#if GTK_CHECK_VERSION(3, 15, 0) -- GtkGLArea gl_area; - #endif -+ GtkGLArea gl_area; - } parent; - - /* properties */ -@@ -80,10 +84,10 @@ struct _GtkGstBaseWidget - struct _GtkGstBaseWidgetClass - { - union { -+#if !defined(BUILD_FOR_GTK4) - GtkDrawingAreaClass drawing_area_class; --#if GTK_CHECK_VERSION(3, 15, 0) -- GtkGLAreaClass gl_area_class; - #endif -+ GtkGLAreaClass gl_area_class; - } parent_class; - }; - -diff --git a/ext/gtk/gtkgstglwidget.c b/ext/gtk/gtkgstglwidget.c -index 6c423ad89..186144a1c 100644 ---- a/ext/gtk/gtkgstglwidget.c -+++ b/ext/gtk/gtkgstglwidget.c -@@ -1,6 +1,7 @@ - /* - * GStreamer - * Copyright (C) 2015 Matthew Waters -+ * Copyright (C) 2020 Rafał Dzięgiel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public -@@ -30,12 +31,20 @@ - #include - - #if GST_GL_HAVE_WINDOW_X11 && defined (GDK_WINDOWING_X11) -+#if defined(BUILD_FOR_GTK4) -+#include -+#else - #include -+#endif - #include - #endif - - #if GST_GL_HAVE_WINDOW_WAYLAND && defined (GDK_WINDOWING_WAYLAND) -+#if defined(BUILD_FOR_GTK4) -+#include -+#else - #include -+#endif - #include - #endif - -@@ -78,8 +87,7 @@ static const GLfloat vertices[] = { - G_DEFINE_TYPE_WITH_CODE (GtkGstGLWidget, gtk_gst_gl_widget, GTK_TYPE_GL_AREA, - G_ADD_PRIVATE (GtkGstGLWidget) - GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "gtkgstglwidget", 0, -- "Gtk Gst GL Widget"); -- ); -+ "GTK Gst GL Widget")); - - static void - gtk_gst_gl_widget_bind_buffer (GtkGstGLWidget * gst_widget) -@@ -407,8 +415,11 @@ gtk_gst_gl_widget_init (GtkGstGLWidget * gst_widget) - - GST_INFO ("Created %" GST_PTR_FORMAT, priv->display); - -+ /* GTK4 always has alpha */ -+#if !defined(BUILD_FOR_GTK4) - gtk_gl_area_set_has_alpha (GTK_GL_AREA (gst_widget), - !base_widget->ignore_alpha); -+#endif - } - - static void -diff --git a/ext/gtk/meson.build b/ext/gtk/meson.build -index 722775e08..466e9221e 100644 ---- a/ext/gtk/meson.build -+++ b/ext/gtk/meson.build -@@ -1,59 +1,93 @@ -+gtk_versions = [3, 4] - gtk_sources = [ - 'gstgtkbasesink.c', -- 'gstgtksink.c', - 'gstgtkutils.c', - 'gstplugin.c', - 'gtkgstbasewidget.c', -- 'gtkgstwidget.c', - ] -+gtk_dep = dependency('gtk+-3.0', required : get_option('gtk3')) -+gtk4_dep = dependency('gtk4', required : get_option('gtk4')) - --gtk_defines = [] --optional_deps = [] -+foreach gtk_ver : gtk_versions -+ gtkv = 'gtk' + gtk_ver.to_string() - --gtk_dep = dependency('gtk+-3.0', required : get_option('gtk3')) --if gtk_dep.found() -- # FIXME: automagic -- if have_gstgl and gtk_dep.version().version_compare('>=3.24.0') -- have_gtk3_gl_windowing = false -+ gtk_state = get_option(gtkv) -+ if gtk_state.disabled() -+ continue -+ endif -+ -+ min_ver = gtk_ver >= 4 ? '3.99.2' : '3.24.0' -+ x11_dep = gtk_ver >= 4 ? gtkv + '-x11' : 'gtk+-x11-3.0' -+ way_dep = gtk_ver >= 4 ? gtkv + '-wayland' : 'gtk+-wayland-3.0' -+ lib_dep = gtk_ver >= 4 ? gtk4_dep : gtk_dep - -+ if not lib_dep.found() or not lib_dep.version().version_compare('>=' + min_ver) -+ continue -+ endif -+ -+ lib_sources = [] -+ gtk_defines = [] -+ optional_deps = [] -+ have_gtk_gl_windowing = false -+ -+ lib_sources += gtk_sources -+ if gtk_ver == 3 -+ lib_sources += [ -+ 'gstgtksink.c', -+ 'gtkgstwidget.c', -+ ] -+ endif -+ -+ if have_gstgl - if gst_gl_have_window_x11 and gst_gl_have_platform_glx - # FIXME: automagic -- gtk_x11_dep = dependency('gtk+-x11-3.0', required : false) -+ gtk_x11_dep = dependency(x11_dep, required : false) - if gtk_x11_dep.found() - optional_deps += [gtk_x11_dep, gstglx11_dep] -- have_gtk3_gl_windowing = true -+ have_gtk_gl_windowing = true - endif - endif - - if gst_gl_have_window_wayland and gst_gl_have_platform_egl - # FIXME: automagic -- gtk_wayland_dep = dependency('gtk+-wayland-3.0', required : false) -+ gtk_wayland_dep = dependency(way_dep, required : false) - if gtk_wayland_dep.found() - optional_deps += [gtk_wayland_dep, gstglegl_dep, gstglwayland_dep] -- have_gtk3_gl_windowing = true -+ have_gtk_gl_windowing = true - endif - endif -+ endif -+ -+ if gtk_ver > 3 and not have_gtk_gl_windowing -+ continue -+ endif - -- if have_gtk3_gl_windowing -- gtk_sources += [ -- 'gstgtkglsink.c', -- 'gtkgstglwidget.c', -- ] -- optional_deps += [gstgl_dep, gstglproto_dep] -- gtk_defines += ['-DGST_USE_UNSTABLE_API', '-DHAVE_GTK3_GL'] -+ if have_gtk_gl_windowing -+ lib_sources += [ -+ 'gstgtkglsink.c', -+ 'gtkgstglwidget.c', -+ ] -+ optional_deps += [gstgl_dep, gstglproto_dep] -+ gtk_defines += ['-DGST_USE_UNSTABLE_API', '-DHAVE_GTK_GL'] -+ if gtk_ver == 4 -+ gtk_defines += '-DBUILD_FOR_GTK4' - endif - endif - -- gstgtk = library('gstgtk', -- gtk_sources, -+ lib_name = 'gstgtk' -+ if gtk_ver > 3 -+ lib_name += gtk_ver.to_string() -+ endif -+ -+ gstgtk = library(lib_name, -+ lib_sources, - c_args : gst_plugins_good_args + gtk_defines, - link_args : noseh_link_args, - include_directories : [configinc], -- dependencies : [gtk_dep, gstvideo_dep, gstbase_dep, libm] + optional_deps, -+ dependencies : [lib_dep, gstvideo_dep, gstbase_dep, libm] + optional_deps, - install : true, - install_dir : plugins_install_dir, - ) - pkgconfig.generate(gstgtk, install_dir : plugins_pkgconfig_install_dir) - plugins += [gstgtk] --endif -- -+endforeach -diff --git a/meson_options.txt b/meson_options.txt -index 3dafe1fda..ca2b5d8d7 100644 ---- a/meson_options.txt -+++ b/meson_options.txt -@@ -53,6 +53,7 @@ option('dv1394', type : 'feature', value : 'auto', description : 'Digital IEEE13 - option('flac', type : 'feature', value : 'auto', description : 'FLAC audio codec plugin') - option('gdk-pixbuf', type : 'feature', value : 'auto', description : 'gdk-pixbuf image decoder, overlay, and sink plugin') - option('gtk3', type : 'feature', value : 'auto', description : 'GTK+ video sink plugin') -+option('gtk4', type : 'feature', value : 'disabled', description : 'GTK4 video sink plugin') - option('jack', type : 'feature', value : 'auto', description : 'JACK audio source/sink plugin') - option('jpeg', type : 'feature', value : 'auto', description : 'JPEG image codec plugin') - option('lame', type : 'feature', value : 'auto', description : 'LAME mp3 audio encoder plugin') --- -GitLab - - -From dca6efe22a665339307a3c6f2ecd9f7b72cd6a31 Mon Sep 17 00:00:00 2001 -From: Rafostar <40623528+Rafostar@users.noreply.github.com> -Date: Thu, 12 Nov 2020 14:46:15 +0100 -Subject: [PATCH 04/10] gtk(4): separate gtk and gtk4 meson dependencies - -This fixes building tests against the correct gtk version ---- - ext/gtk/meson.build | 17 +++++++++++++---- - tests/examples/gtk/meson.build | 2 +- - 2 files changed, 14 insertions(+), 5 deletions(-) - -diff --git a/ext/gtk/meson.build b/ext/gtk/meson.build -index 466e9221e..82765b6c8 100644 ---- a/ext/gtk/meson.build -+++ b/ext/gtk/meson.build -@@ -6,7 +6,10 @@ gtk_sources = [ - 'gtkgstbasewidget.c', - ] - gtk_dep = dependency('gtk+-3.0', required : get_option('gtk3')) -+gtk_optional_deps = [] -+ - gtk4_dep = dependency('gtk4', required : get_option('gtk4')) -+gtk4_optional_deps = [] - - foreach gtk_ver : gtk_versions - gtkv = 'gtk' + gtk_ver.to_string() -@@ -17,8 +20,8 @@ foreach gtk_ver : gtk_versions - endif - - min_ver = gtk_ver >= 4 ? '3.99.2' : '3.24.0' -- x11_dep = gtk_ver >= 4 ? gtkv + '-x11' : 'gtk+-x11-3.0' -- way_dep = gtk_ver >= 4 ? gtkv + '-wayland' : 'gtk+-wayland-3.0' -+ x11_str = gtk_ver >= 4 ? gtkv + '-x11' : 'gtk+-x11-3.0' -+ way_str = gtk_ver >= 4 ? gtkv + '-wayland' : 'gtk+-wayland-3.0' - lib_dep = gtk_ver >= 4 ? gtk4_dep : gtk_dep - - if not lib_dep.found() or not lib_dep.version().version_compare('>=' + min_ver) -@@ -41,7 +44,7 @@ foreach gtk_ver : gtk_versions - if have_gstgl - if gst_gl_have_window_x11 and gst_gl_have_platform_glx - # FIXME: automagic -- gtk_x11_dep = dependency(x11_dep, required : false) -+ gtk_x11_dep = dependency(x11_str, required : false) - if gtk_x11_dep.found() - optional_deps += [gtk_x11_dep, gstglx11_dep] - have_gtk_gl_windowing = true -@@ -50,7 +53,7 @@ foreach gtk_ver : gtk_versions - - if gst_gl_have_window_wayland and gst_gl_have_platform_egl - # FIXME: automagic -- gtk_wayland_dep = dependency(way_dep, required : false) -+ gtk_wayland_dep = dependency(way_str, required : false) - if gtk_wayland_dep.found() - optional_deps += [gtk_wayland_dep, gstglegl_dep, gstglwayland_dep] - have_gtk_gl_windowing = true -@@ -74,6 +77,12 @@ foreach gtk_ver : gtk_versions - endif - endif - -+ if gtk_ver == 3 -+ gtk_optional_deps = optional_deps -+ elif gtk_ver == 4 -+ gtk4_optional_deps = optional_deps -+ endif -+ - lib_name = 'gstgtk' - if gtk_ver > 3 - lib_name += gtk_ver.to_string() -diff --git a/tests/examples/gtk/meson.build b/tests/examples/gtk/meson.build -index 76e9f4f8e..4de2075e6 100644 ---- a/tests/examples/gtk/meson.build -+++ b/tests/examples/gtk/meson.build -@@ -1,5 +1,5 @@ - executable('gtksink', 'gtksink.c', -- dependencies: [gst_dep, gtk_dep, optional_deps], -+ dependencies: [gst_dep, gtk_dep, gtk_optional_deps], - c_args: gst_plugins_good_args, - include_directories: [configinc], - install: false) --- -GitLab - - -From 905e86bca45af1d706c9e7fc1a22d0f4cf962faf Mon Sep 17 00:00:00 2001 -From: Rafostar <40623528+Rafostar@users.noreply.github.com> -Date: Thu, 12 Nov 2020 18:16:23 +0100 -Subject: [PATCH 05/10] gtk(4): clear widget during our window destruction - -In GTK4 the "destroy" signal will not be emitted -as long as someone is holding a ref on an object. -We cannot use it to do the unref anymore. Cleanup -on our window "destroy" signal instead. This is -only used to make gst-launch-1.0 close properly. ---- - ext/gtk/gstgtkbasesink.c | 11 +++++++++++ - ext/gtk/gstgtkbasesink.h | 10 +++++----- - 2 files changed, 16 insertions(+), 5 deletions(-) - -diff --git a/ext/gtk/gstgtkbasesink.c b/ext/gtk/gstgtkbasesink.c -index 1f5319089..d176d3ee8 100644 ---- a/ext/gtk/gstgtkbasesink.c -+++ b/ext/gtk/gstgtkbasesink.c -@@ -150,6 +150,8 @@ gst_gtk_base_sink_finalize (GObject * object) - { - GstGtkBaseSink *gtk_sink = GST_GTK_BASE_SINK (object); - -+ GST_DEBUG ("finalizing base sink"); -+ - GST_OBJECT_LOCK (gtk_sink); - if (gtk_sink->window && gtk_sink->window_destroy_id) - g_signal_handler_disconnect (gtk_sink->window, gtk_sink->window_destroy_id); -@@ -174,6 +176,14 @@ static void - window_destroy_cb (GtkWidget * widget, GstGtkBaseSink * gtk_sink) - { - GST_OBJECT_LOCK (gtk_sink); -+ if (gtk_sink->widget) { -+ if (gtk_sink->widget_destroy_id) { -+ g_signal_handler_disconnect (gtk_sink->widget, -+ gtk_sink->widget_destroy_id); -+ gtk_sink->widget_destroy_id = 0; -+ } -+ g_clear_object (>k_sink->widget); -+ } - gtk_sink->window = NULL; - GST_OBJECT_UNLOCK (gtk_sink); - } -@@ -214,6 +224,7 @@ gst_gtk_base_sink_get_widget (GstGtkBaseSink * gtk_sink) - /* Take the floating ref, other wise the destruction of the container will - * make this widget disappear possibly before we are done. */ - gst_object_ref_sink (gtk_sink->widget); -+ - gtk_sink->widget_destroy_id = g_signal_connect (gtk_sink->widget, "destroy", - G_CALLBACK (widget_destroy_cb), gtk_sink); - -diff --git a/ext/gtk/gstgtkbasesink.h b/ext/gtk/gstgtkbasesink.h -index 650175036..db0acb2c0 100644 ---- a/ext/gtk/gstgtkbasesink.h -+++ b/ext/gtk/gstgtkbasesink.h -@@ -51,14 +51,14 @@ GType gst_gtk_base_sink_get_type (void); - struct _GstGtkBaseSink - { - /* */ -- GstVideoSink parent; -+ GstVideoSink parent; - -- GstVideoInfo v_info; -+ GstVideoInfo v_info; - - GtkGstBaseWidget *widget; - - /* properties */ -- gboolean force_aspect_ratio; -+ gboolean force_aspect_ratio; - GBinding *bind_aspect_ratio; - - gint par_n; -@@ -69,8 +69,8 @@ struct _GstGtkBaseSink - GBinding *bind_ignore_alpha; - - GtkWidget *window; -- gulong widget_destroy_id; -- gulong window_destroy_id; -+ gulong widget_destroy_id; -+ gulong window_destroy_id; - }; - - /** --- -GitLab - - -From a91cd51babbe8cbe2e086a9f51efd6e526310d9a Mon Sep 17 00:00:00 2001 -From: Rafostar <40623528+Rafostar@users.noreply.github.com> -Date: Tue, 29 Dec 2020 15:03:08 +0100 -Subject: [PATCH 06/10] gtk(4): replace "size-allocate" signal with "resize" - -In GTK4 the "size-allocate" signal was removed. -Recommended replacement is "resize" signal which was -also available in GTK3, so use it instead. ---- - ext/gtk/gstgtkglsink.c | 42 ++++++++++++++++++++---------------------- - ext/gtk/gstgtkglsink.h | 2 +- - 2 files changed, 21 insertions(+), 23 deletions(-) - -diff --git a/ext/gtk/gstgtkglsink.c b/ext/gtk/gstgtkglsink.c -index daaf0eb3f..e680c5a0f 100644 ---- a/ext/gtk/gstgtkglsink.c -+++ b/ext/gtk/gstgtkglsink.c -@@ -128,17 +128,18 @@ gst_gtk_gl_sink_query (GstBaseSink * bsink, GstQuery * query) - return res; - } - --#if !defined(BUILD_FOR_GTK4) - static void --_size_changed_cb (GtkWidget * widget, GdkRectangle * rectangle, -- GstGtkGLSink * gtk_sink) -+_size_changed_cb (GtkWidget * widget, gint width, -+ gint height, GstGtkGLSink * gtk_sink) - { -- gint scale_factor, width, height; - gboolean reconfigure; - -- scale_factor = gtk_widget_get_scale_factor (widget); -- width = scale_factor * gtk_widget_get_allocated_width (widget); -- height = scale_factor * gtk_widget_get_allocated_height (widget); -+ GtkGstBaseWidget *base_widget = GTK_GST_BASE_WIDGET (widget); -+ -+ /* Ignore size changes before widget is negotiated -+ * we are going to queue a resize after negotiation */ -+ if (!base_widget->negotiated) -+ return; - - GST_OBJECT_LOCK (gtk_sink); - reconfigure = -@@ -153,14 +154,13 @@ _size_changed_cb (GtkWidget * widget, GdkRectangle * rectangle, - gst_event_new_reconfigure ()); - } - } --#endif - - static void - destroy_cb (GtkWidget * widget, GstGtkGLSink * gtk_sink) - { -- if (gtk_sink->size_allocate_sig_handler) { -- g_signal_handler_disconnect (widget, gtk_sink->size_allocate_sig_handler); -- gtk_sink->size_allocate_sig_handler = 0; -+ if (gtk_sink->widget_resize_sig_handler) { -+ g_signal_handler_disconnect (widget, gtk_sink->widget_resize_sig_handler); -+ gtk_sink->widget_resize_sig_handler = 0; - } - - if (gtk_sink->widget_destroy_sig_handler) { -@@ -182,14 +182,12 @@ gst_gtk_gl_sink_start (GstBaseSink * bsink) - /* After this point, gtk_sink->widget will always be set */ - gst_widget = GTK_GST_GL_WIDGET (base_sink->widget); - --#if !defined(BUILD_FOR_GTK4) - /* Track the allocation size */ -- if (!gtk_sink->size_allocate_sig_handler) { -- gtk_sink->size_allocate_sig_handler = -- g_signal_connect (gst_widget, "size-allocate", -+ if (!gtk_sink->widget_resize_sig_handler) { -+ gtk_sink->widget_resize_sig_handler = -+ g_signal_connect (gst_widget, "resize", - G_CALLBACK (_size_changed_cb), gtk_sink); - } --#endif - - if (!gtk_sink->widget_destroy_sig_handler) { - gtk_sink->widget_destroy_sig_handler = -@@ -228,10 +226,10 @@ gst_gtk_gl_sink_stop (GstBaseSink * bsink) - GstGtkGLSink *gtk_sink = GST_GTK_GL_SINK (bsink); - GstGtkBaseSink *base_sink = GST_GTK_BASE_SINK (bsink); - -- if (gtk_sink->size_allocate_sig_handler) { -+ if (gtk_sink->widget_resize_sig_handler) { - g_signal_handler_disconnect (base_sink->widget, -- gtk_sink->size_allocate_sig_handler); -- gtk_sink->size_allocate_sig_handler = 0; -+ gtk_sink->widget_resize_sig_handler); -+ gtk_sink->widget_resize_sig_handler = 0; - } - - if (gtk_sink->display) { -@@ -373,10 +371,10 @@ gst_gtk_gl_sink_finalize (GObject * object) - GstGtkGLSink *gtk_sink = GST_GTK_GL_SINK (object); - GstGtkBaseSink *base_sink = GST_GTK_BASE_SINK (object); - -- if (gtk_sink->size_allocate_sig_handler) { -+ if (gtk_sink->widget_resize_sig_handler) { - g_signal_handler_disconnect (base_sink->widget, -- gtk_sink->size_allocate_sig_handler); -- gtk_sink->size_allocate_sig_handler = 0; -+ gtk_sink->widget_resize_sig_handler); -+ gtk_sink->widget_resize_sig_handler = 0; - } - - if (gtk_sink->widget_destroy_sig_handler) { -diff --git a/ext/gtk/gstgtkglsink.h b/ext/gtk/gstgtkglsink.h -index 8ff935948..57450c8ac 100644 ---- a/ext/gtk/gstgtkglsink.h -+++ b/ext/gtk/gstgtkglsink.h -@@ -57,7 +57,7 @@ struct _GstGtkGLSink - gint display_width; - gint display_height; - -- gulong size_allocate_sig_handler; -+ gulong widget_resize_sig_handler; - gulong widget_destroy_sig_handler; - }; - --- -GitLab - - -From 8798dffb7f1f5b6ba281334789bdf4336faa005c Mon Sep 17 00:00:00 2001 -From: Rafostar <40623528+Rafostar@users.noreply.github.com> -Date: Sat, 2 Jan 2021 22:56:36 +0100 -Subject: [PATCH 07/10] gtk: fix wrong element name in docs - -In docs "gtksink" was named "gtkgstsink" which caused -the doc generation to not detect and describe it properly. ---- - ext/gtk/gstgtksink.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/ext/gtk/gstgtksink.c b/ext/gtk/gstgtksink.c -index ba8ea33ca..c330a82b4 100644 ---- a/ext/gtk/gstgtksink.c -+++ b/ext/gtk/gstgtksink.c -@@ -19,8 +19,8 @@ - */ - - /** -- * SECTION:element-gtkgstsink -- * @title: gtkgstsink -+ * SECTION:element-gtksink -+ * @title: gtksink - * - */ - --- -GitLab - - -From 53802970c1a5182f85468552cecbabda0bb0e98d Mon Sep 17 00:00:00 2001 -From: Rafostar <40623528+Rafostar@users.noreply.github.com> -Date: Thu, 31 Dec 2020 12:44:23 +0100 -Subject: [PATCH 08/10] gtksink: add GTK4 support - -Add GTK4 compatibility for Cairo renderer based plugin. -The new sink plugin is named "gtk4sink". ---- - ext/gtk/gstgtksink.c | 16 ++++++++++++---- - ext/gtk/gstplugin.c | 8 +------- - ext/gtk/gtkconfig.h | 2 ++ - ext/gtk/gtkgstbasewidget.h | 4 ---- - ext/gtk/gtkgstwidget.c | 35 ++++++++++++++++++++++++++++------- - ext/gtk/meson.build | 16 +++------------- - 6 files changed, 46 insertions(+), 35 deletions(-) - -diff --git a/ext/gtk/gstgtksink.c b/ext/gtk/gstgtksink.c -index c330a82b4..d64859ff6 100644 ---- a/ext/gtk/gstgtksink.c -+++ b/ext/gtk/gstgtksink.c -@@ -24,10 +24,17 @@ - * - */ - -+/** -+ * SECTION:element-gtk4sink -+ * @title: gtk4sink -+ * -+ */ -+ - #ifdef HAVE_CONFIG_H - #include "config.h" - #endif - -+#include "gtkconfig.h" - #include "gtkgstwidget.h" - #include "gstgtksink.h" - -@@ -49,8 +56,8 @@ GST_STATIC_PAD_TEMPLATE ("sink", - - #define gst_gtk_sink_parent_class parent_class - G_DEFINE_TYPE_WITH_CODE (GstGtkSink, gst_gtk_sink, GST_TYPE_GTK_BASE_SINK, -- GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_sink, "gtksink", 0, -- "Gtk Video Sink")); -+ GST_DEBUG_CATEGORY_INIT (gst_debug_gtk_sink, GTKCONFIG_SINK, 0, -+ GTKCONFIG_NAME " Video Sink")); - - static void - gst_gtk_sink_class_init (GstGtkSinkClass * klass) -@@ -62,9 +69,10 @@ gst_gtk_sink_class_init (GstGtkSinkClass * klass) - base_class = (GstGtkBaseSinkClass *) klass; - - base_class->create_widget = gtk_gst_widget_new; -- base_class->window_title = "Gtk+ Cairo renderer"; -+ base_class->window_title = GTKCONFIG_NAME " Cairo Renderer"; - -- gst_element_class_set_metadata (gstelement_class, "Gtk Video Sink", -+ gst_element_class_set_metadata (gstelement_class, -+ GTKCONFIG_NAME " Video Sink", - "Sink/Video", "A video sink that renders to a GtkWidget", - "Matthew Waters "); - -diff --git a/ext/gtk/gstplugin.c b/ext/gtk/gstplugin.c -index 788f4f9dd..5fb2d99f4 100644 ---- a/ext/gtk/gstplugin.c -+++ b/ext/gtk/gstplugin.c -@@ -24,10 +24,7 @@ - #endif - - #include "gtkconfig.h" -- --#if !defined(BUILD_FOR_GTK4) - #include "gstgtksink.h" --#endif - - #if defined(HAVE_GTK_GL) - #include "gstgtkglsink.h" -@@ -36,13 +33,10 @@ - static gboolean - plugin_init (GstPlugin * plugin) - { --#if !defined(BUILD_FOR_GTK4) -- if (!gst_element_register (plugin, "gtksink", -+ if (!gst_element_register (plugin, GTKCONFIG_SINK, - GST_RANK_NONE, GST_TYPE_GTK_SINK)) { - return FALSE; - } --#endif -- - #if defined(HAVE_GTK_GL) - if (!gst_element_register (plugin, GTKCONFIG_GLSINK, - GST_RANK_NONE, GST_TYPE_GTK_GL_SINK)) { -diff --git a/ext/gtk/gtkconfig.h b/ext/gtk/gtkconfig.h -index 8dd28dc00..ecbf95582 100644 ---- a/ext/gtk/gtkconfig.h -+++ b/ext/gtk/gtkconfig.h -@@ -21,9 +21,11 @@ - #if defined(BUILD_FOR_GTK4) - #define GTKCONFIG_PLUGIN gtk4 - #define GTKCONFIG_NAME "GTK4" -+#define GTKCONFIG_SINK "gtk4sink" - #define GTKCONFIG_GLSINK "gtk4glsink" - #else - #define GTKCONFIG_PLUGIN gtk - #define GTKCONFIG_NAME "GTK" -+#define GTKCONFIG_SINK "gtksink" - #define GTKCONFIG_GLSINK "gtkglsink" - #endif -diff --git a/ext/gtk/gtkgstbasewidget.h b/ext/gtk/gtkgstbasewidget.h -index 0b0fe9e55..bc0b805df 100644 ---- a/ext/gtk/gtkgstbasewidget.h -+++ b/ext/gtk/gtkgstbasewidget.h -@@ -43,9 +43,7 @@ typedef struct _GtkGstBaseWidgetClass GtkGstBaseWidgetClass; - struct _GtkGstBaseWidget - { - union { --#if !defined(BUILD_FOR_GTK4) - GtkDrawingArea drawing_area; --#endif - GtkGLArea gl_area; - } parent; - -@@ -84,9 +82,7 @@ struct _GtkGstBaseWidget - struct _GtkGstBaseWidgetClass - { - union { --#if !defined(BUILD_FOR_GTK4) - GtkDrawingAreaClass drawing_area_class; --#endif - GtkGLAreaClass gl_area_class; - } parent_class; - }; -diff --git a/ext/gtk/gtkgstwidget.c b/ext/gtk/gtkgstwidget.c -index a936210ba..eb8db8f7e 100644 ---- a/ext/gtk/gtkgstwidget.c -+++ b/ext/gtk/gtkgstwidget.c -@@ -38,17 +38,15 @@ - - G_DEFINE_TYPE (GtkGstWidget, gtk_gst_widget, GTK_TYPE_DRAWING_AREA); - --static gboolean --gtk_gst_widget_draw (GtkWidget * widget, cairo_t * cr) -+static void -+_drawing_area_draw (GtkDrawingArea * da, cairo_t * cr, -+ gint widget_width, gint widget_height, gpointer data) - { -+ GtkWidget *widget = GTK_WIDGET (da); - GtkGstBaseWidget *gst_widget = (GtkGstBaseWidget *) widget; -- guint widget_width, widget_height; - cairo_surface_t *surface; - GstVideoFrame frame; - -- widget_width = gtk_widget_get_allocated_width (widget); -- widget_height = gtk_widget_get_allocated_height (widget); -- - GTK_GST_BASE_WIDGET_LOCK (gst_widget); - - /* There is not much to optimize in term of redisplay, so simply swap the -@@ -148,7 +146,10 @@ gtk_gst_widget_draw (GtkWidget * widget, cairo_t * cr) - color.alpha = 1.0; - } else { - gtk_style_context_get_color (gtk_widget_get_style_context (widget), -- GTK_STATE_FLAG_NORMAL, &color); -+#if !defined(BUILD_FOR_GTK4) -+ GTK_STATE_FLAG_NORMAL, -+#endif -+ &color); - } - gdk_cairo_set_source_rgba (cr, &color); - cairo_rectangle (cr, 0, 0, widget_width, widget_height); -@@ -156,8 +157,20 @@ gtk_gst_widget_draw (GtkWidget * widget, cairo_t * cr) - } - - GTK_GST_BASE_WIDGET_UNLOCK (gst_widget); -+} -+ -+#if !defined(BUILD_FOR_GTK4) -+static gboolean -+gtk_gst_widget_draw (GtkWidget * widget, cairo_t * cr) -+{ -+ gint width = gtk_widget_get_allocated_width (widget); -+ gint height = gtk_widget_get_allocated_height (widget); -+ -+ _drawing_area_draw (GTK_DRAWING_AREA (widget), cr, width, height, NULL); -+ - return FALSE; - } -+#endif - - static void - gtk_gst_widget_finalize (GObject * object) -@@ -171,17 +184,25 @@ static void - gtk_gst_widget_class_init (GtkGstWidgetClass * klass) - { - GObjectClass *gobject_klass = (GObjectClass *) klass; -+#if !defined(BUILD_FOR_GTK4) - GtkWidgetClass *widget_klass = (GtkWidgetClass *) klass; -+#endif - - gtk_gst_base_widget_class_init (GTK_GST_BASE_WIDGET_CLASS (klass)); - gobject_klass->finalize = gtk_gst_widget_finalize; -+#if !defined(BUILD_FOR_GTK4) - widget_klass->draw = gtk_gst_widget_draw; -+#endif - } - - static void - gtk_gst_widget_init (GtkGstWidget * widget) - { - gtk_gst_base_widget_init (GTK_GST_BASE_WIDGET (widget)); -+#if defined(BUILD_FOR_GTK4) -+ gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (widget), -+ _drawing_area_draw, NULL, NULL); -+#endif - } - - GtkWidget * -diff --git a/ext/gtk/meson.build b/ext/gtk/meson.build -index 82765b6c8..c157cf8cd 100644 ---- a/ext/gtk/meson.build -+++ b/ext/gtk/meson.build -@@ -1,9 +1,11 @@ - gtk_versions = [3, 4] - gtk_sources = [ - 'gstgtkbasesink.c', -+ 'gstgtksink.c', - 'gstgtkutils.c', - 'gstplugin.c', - 'gtkgstbasewidget.c', -+ 'gtkgstwidget.c', - ] - gtk_dep = dependency('gtk+-3.0', required : get_option('gtk3')) - gtk_optional_deps = [] -@@ -34,12 +36,6 @@ foreach gtk_ver : gtk_versions - have_gtk_gl_windowing = false - - lib_sources += gtk_sources -- if gtk_ver == 3 -- lib_sources += [ -- 'gstgtksink.c', -- 'gtkgstwidget.c', -- ] -- endif - - if have_gstgl - if gst_gl_have_window_x11 and gst_gl_have_platform_glx -@@ -61,10 +57,6 @@ foreach gtk_ver : gtk_versions - endif - endif - -- if gtk_ver > 3 and not have_gtk_gl_windowing -- continue -- endif -- - if have_gtk_gl_windowing - lib_sources += [ - 'gstgtkglsink.c', -@@ -72,15 +64,13 @@ foreach gtk_ver : gtk_versions - ] - optional_deps += [gstgl_dep, gstglproto_dep] - gtk_defines += ['-DGST_USE_UNSTABLE_API', '-DHAVE_GTK_GL'] -- if gtk_ver == 4 -- gtk_defines += '-DBUILD_FOR_GTK4' -- endif - endif - - if gtk_ver == 3 - gtk_optional_deps = optional_deps - elif gtk_ver == 4 - gtk4_optional_deps = optional_deps -+ gtk_defines += '-DBUILD_FOR_GTK4' - endif - - lib_name = 'gstgtk' --- -GitLab - - -From db5a3373c0281ae2923f411375c919583489c5ab Mon Sep 17 00:00:00 2001 -From: Rafostar <40623528+Rafostar@users.noreply.github.com> -Date: Fri, 1 Jan 2021 20:10:38 +0100 -Subject: [PATCH 09/10] gtk4: expand widget by default - -In GTK4, (v/h)expand is disabled by default which -causes widget placed in grid to appear as a 1x1px -video and might be unnoticeable, confusing users -into thinking that something does not work. ---- - ext/gtk/gtkgstbasewidget.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/ext/gtk/gtkgstbasewidget.c b/ext/gtk/gtkgstbasewidget.c -index bd0794f2f..374eb7f97 100644 ---- a/ext/gtk/gtkgstbasewidget.c -+++ b/ext/gtk/gtkgstbasewidget.c -@@ -515,6 +515,11 @@ gtk_gst_base_widget_init (GtkGstBaseWidget * widget) - G_CALLBACK (gtk_gst_base_widget_button_event), NULL); - - #if defined(BUILD_FOR_GTK4) -+ /* Otherwise widget in grid will appear as a 1x1px -+ * video which might be misleading for users */ -+ gtk_widget_set_hexpand (GTK_WIDGET (widget), TRUE); -+ gtk_widget_set_vexpand (GTK_WIDGET (widget), TRUE); -+ - gtk_widget_set_focusable (GTK_WIDGET (widget), TRUE); - gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (widget->click_gesture), - GDK_BUTTON_PRIMARY); --- -GitLab - - -From f17f29ed5cef270a50d5f72116953109c3cc8c86 Mon Sep 17 00:00:00 2001 -From: Rafostar <40623528+Rafostar@users.noreply.github.com> -Date: Sun, 3 Jan 2021 11:24:15 +0100 -Subject: [PATCH 10/10] docs: update plugin cache - -Update gtk plugin and add gtk4 plugin ---- - docs/gst_plugins_cache.json | 129 ++++++++++++++++++++++++++++++++++-- - 1 file changed, 125 insertions(+), 4 deletions(-) - -diff --git a/docs/gst_plugins_cache.json b/docs/gst_plugins_cache.json -index f8ac35e37..5afd41a99 100644 ---- a/docs/gst_plugins_cache.json -+++ b/docs/gst_plugins_cache.json -@@ -7075,10 +7075,10 @@ - "url": "Unknown package origin" - }, - "gtk": { -- "description": "Gtk+ sink", -+ "description": "GTK sink", - "elements": { - "gtkglsink": { -- "author": "Matthew Waters ", -+ "author": "Matthew Waters , Rafał Dzięgiel ", - "description": "A video sink that renders to a GtkWidget using OpenGL", - "hierarchy": [ - "GstGtkGLSink", -@@ -7094,7 +7094,7 @@ - "GstNavigation" - ], - "klass": "Sink/Video", -- "long-name": "Gtk GL Video Sink", -+ "long-name": "GTK GL Video Sink", - "pad-templates": { - "sink": { - "caps": "video/x-raw(memory:GLMemory):\n format: RGBA\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n\nvideo/x-raw(memory:GLMemory, meta:GstVideoOverlayComposition):\n format: RGBA\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", -@@ -7122,7 +7122,7 @@ - "GstNavigation" - ], - "klass": "Sink/Video", -- "long-name": "Gtk Video Sink", -+ "long-name": "GTK Video Sink", - "pad-templates": { - "sink": { - "caps": "video/x-raw:\n format: { BGRx, BGRA }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", -@@ -7209,6 +7209,127 @@ - "tracers": {}, - "url": "Unknown package origin" - }, -+ "gtk4": { -+ "description": "GTK4 sink", -+ "elements": { -+ "gtk4glsink": { -+ "author": "Matthew Waters , Rafał Dzięgiel ", -+ "description": "A video sink that renders to a GtkWidget using OpenGL", -+ "hierarchy": [ -+ "GstGtkGLSink", -+ "GstGtkBaseSink", -+ "GstVideoSink", -+ "GstBaseSink", -+ "GstElement", -+ "GstObject", -+ "GInitiallyUnowned", -+ "GObject" -+ ], -+ "interfaces": [ -+ "GstNavigation" -+ ], -+ "klass": "Sink/Video", -+ "long-name": "GTK4 GL Video Sink", -+ "pad-templates": { -+ "sink": { -+ "caps": "video/x-raw(memory:GLMemory):\n format: RGBA\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n\nvideo/x-raw(memory:GLMemory, meta:GstVideoOverlayComposition):\n format: RGBA\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", -+ "direction": "sink", -+ "presence": "always" -+ } -+ }, -+ "rank": "none" -+ }, -+ "gtk4sink": { -+ "author": "Matthew Waters ", -+ "description": "A video sink that renders to a GtkWidget", -+ "hierarchy": [ -+ "GstGtkSink", -+ "GstGtkBaseSink", -+ "GstVideoSink", -+ "GstBaseSink", -+ "GstElement", -+ "GstObject", -+ "GInitiallyUnowned", -+ "GObject" -+ ], -+ "interfaces": [ -+ "GstNavigation" -+ ], -+ "klass": "Sink/Video", -+ "long-name": "GTK4 Video Sink", -+ "pad-templates": { -+ "sink": { -+ "caps": "video/x-raw:\n format: { BGRx, BGRA }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", -+ "direction": "sink", -+ "presence": "always" -+ } -+ }, -+ "rank": "none" -+ } -+ }, -+ "filename": "gstgtk4", -+ "license": "LGPL", -+ "other-types": { -+ "GstGtkBaseSink": { -+ "hierarchy": [ -+ "GstGtkBaseSink", -+ "GstVideoSink", -+ "GstBaseSink", -+ "GstElement", -+ "GstObject", -+ "GInitiallyUnowned", -+ "GObject" -+ ], -+ "interfaces": [ -+ "GstNavigation" -+ ], -+ "kind": "object", -+ "properties": { -+ "force-aspect-ratio": { -+ "blurb": "When enabled, scaling will respect original aspect ratio", -+ "conditionally-available": false, -+ "construct": false, -+ "construct-only": false, -+ "controllable": false, -+ "default": "true", -+ "mutable": "null", -+ "readable": true, -+ "type": "gboolean", -+ "writable": true -+ }, -+ "pixel-aspect-ratio": { -+ "blurb": "The pixel aspect ratio of the device", -+ "conditionally-available": false, -+ "construct": false, -+ "construct-only": false, -+ "controllable": false, -+ "default": "0/1", -+ "max": "2147483647/1", -+ "min": "0/1", -+ "mutable": "null", -+ "readable": true, -+ "type": "GstFraction", -+ "writable": true -+ }, -+ "widget": { -+ "blurb": "The GtkWidget to place in the widget hierarchy (must only be get from the GTK main thread)", -+ "conditionally-available": false, -+ "construct": false, -+ "construct-only": false, -+ "controllable": false, -+ "mutable": "null", -+ "readable": true, -+ "type": "GtkWidget", -+ "writable": false -+ } -+ } -+ } -+ }, -+ "package": "GStreamer Good Plug-ins", -+ "source": "gst-plugins-good", -+ "tracers": {}, -+ "url": "Unknown package origin" -+ }, - "icydemux": { - "description": "Demux ICY tags from a stream", - "elements": { --- -GitLab - diff --git a/pkgs/applications/misc/authenticator/default.nix b/pkgs/applications/misc/authenticator/default.nix index 89ea3dae229..511feccbdc5 100644 --- a/pkgs/applications/misc/authenticator/default.nix +++ b/pkgs/applications/misc/authenticator/default.nix @@ -62,14 +62,14 @@ stdenv.mkDerivation rec { glib gst_all_1.gstreamer gst_all_1.gst-plugins-base - # See https://gitlab.gnome.org/World/Authenticator/-/blob/master/build-aux/com.belmoussaoui.Authenticator.Devel.json + + # gst-plugins-good needs gtk4 support: + # https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/767 + # We copy the way it is built from the Flatpak: + # https://gitlab.gnome.org/World/Authenticator/-/blob/master/build-aux/com.belmoussaoui.Authenticator.Devel.json (gst_all_1.gst-plugins-good.overrideAttrs (old: { - patches = [ - #(fetchpatch { - # url = "https://gitlab.gnome.org/World/Authenticator/-/raw/master/build-aux/767.patch"; - # sha256 = "1g3zkfs248p8wvrvplwrl38vylqsafv6vapfr1nj5kg7ndfrgilf"; - #}) - ./767.patch + patches = old.patches or [ ] ++ [ + "${src}/build-aux/767.patch" ]; mesonFlags = old.mesonFlags ++ [ "-Dgtk3=disabled" @@ -80,6 +80,7 @@ stdenv.mkDerivation rec { gtk4 ]; })) + gst_all_1.gst-plugins-bad gtk4 libadwaita From b2617ab4b65a372b5d63aca4c5e835bb70fa04cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 3 May 2021 12:17:07 +0200 Subject: [PATCH 42/59] fixup! libadwaita: init at unstable-2021-05-01 --- pkgs/development/libraries/libadwaita/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/libadwaita/default.nix b/pkgs/development/libraries/libadwaita/default.nix index 92ea7076821..486326f15f8 100644 --- a/pkgs/development/libraries/libadwaita/default.nix +++ b/pkgs/development/libraries/libadwaita/default.nix @@ -1,7 +1,7 @@ { lib , stdenv , fetchFromGitLab -, docbook_xsl +, docbook-xsl-nons , gtk-doc , meson , ninja @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { version = "unstable-2021-05-01"; outputs = [ "out" "dev" "devdoc" ]; - outputBin = [ "dev" ]; + outputBin = "dev"; src = fetchFromGitLab { domain = "gitlab.gnome.org"; @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ - docbook_xsl + docbook-xsl-nons gtk-doc meson ninja From 96567bb1ff10f66a96dce9e6b6517ae8db8e5310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 3 May 2021 12:27:54 +0200 Subject: [PATCH 43/59] authenticator: hopefully fix crash --- pkgs/applications/misc/authenticator/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/misc/authenticator/default.nix b/pkgs/applications/misc/authenticator/default.nix index 511feccbdc5..46b61720d0a 100644 --- a/pkgs/applications/misc/authenticator/default.nix +++ b/pkgs/applications/misc/authenticator/default.nix @@ -81,7 +81,7 @@ stdenv.mkDerivation rec { ]; })) - gst_all_1.gst-plugins-bad + (gst_all_1.gst-plugins-bad.override { enableZbar = true; }) gtk4 libadwaita openssl From 1e1dcb723da4a5755e16b8ba05c871fd66b5bb65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Mon, 3 May 2021 13:21:54 +0100 Subject: [PATCH 44/59] rename: 1.9 -> 1.11 --- pkgs/tools/misc/rename/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/misc/rename/default.nix b/pkgs/tools/misc/rename/default.nix index a9f42d1139e..a8b5f4a54ac 100644 --- a/pkgs/tools/misc/rename/default.nix +++ b/pkgs/tools/misc/rename/default.nix @@ -1,19 +1,19 @@ { lib, fetchFromGitHub, perlPackages }: -perlPackages.buildPerlPackage { +perlPackages.buildPerlPackage rec { pname = "rename"; - version = "1.9"; + version = "1.11"; outputs = [ "out" ]; src = fetchFromGitHub { owner = "pstray"; repo = "rename"; - rev = "d46f1d0ced25dc5849acb5d5974a3e2e9d97d536"; - sha256 = "0qahs1cqfaci2hdf1xncrz4k0z5skkfr43apnm3kybs7za33apzw"; + rev = "v${version}"; + sha256 = "SK6wS3IxjCftuDiiZU27TFnn9GVd137zmzvGH88cNLI="; }; meta = with lib; { description = "Rename files according to a Perl rewrite expression"; homepage = "https://github.com/pstray/rename"; - maintainers = with maintainers; [ mkg ]; + maintainers = with maintainers; [ mkg cyplo ]; license = with licenses; [ gpl1Plus ]; }; } From ac4b47f82368a9529a53b0b04fed4b685a9e12e0 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 29 Apr 2021 18:40:36 +0200 Subject: [PATCH 45/59] nixos/pinnwand: improve settings behaviour Individual settings would previously overwrite the whole config, but now individual values can be overwritten. Fix missing slash to make the database path an absolute path per https://docs.sqlalchemy.org/en/14/core/engines.html#sqlite. Drop preferred_lexers, it's not set to anything meaningful anyway. --- nixos/modules/services/misc/pinnwand.nix | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/nixos/modules/services/misc/pinnwand.nix b/nixos/modules/services/misc/pinnwand.nix index aa1ee5cfaa7..ca378847a20 100644 --- a/nixos/modules/services/misc/pinnwand.nix +++ b/nixos/modules/services/misc/pinnwand.nix @@ -24,22 +24,22 @@ in Your pinnwand.toml as a Nix attribute set. Look up possible options in the pinnwand.toml-example. ''; - default = { - # https://github.com/supakeen/pinnwand/blob/master/pinnwand.toml-example - database_uri = "sqlite:///var/lib/pinnwand/pinnwand.db"; - preferred_lexeres = []; - paste_size = 262144; - paste_help = '' -

Welcome to pinnwand, this site is a pastebin. It allows you to share code with others. If you write code in the text area below and press the paste button you will be given a link you can share with others so they can view your code as well.

People with the link can view your pasted code, only you can remove your paste and it expires automatically. Note that anyone could guess the URI to your paste so don't rely on it being private.

- ''; - footer = '' - View source code, the removal or expiry stories, or read the about page. - ''; - }; + default = {}; }; }; config = mkIf cfg.enable { + services.pinnwand.settings = { + database_uri = mkDefault "sqlite:////var/lib/pinnwand/pinnwand.db"; + paste_size = mkDefault 262144; + paste_help = mkDefault '' +

Welcome to pinnwand, this site is a pastebin. It allows you to share code with others. If you write code in the text area below and press the paste button you will be given a link you can share with others so they can view your code as well.

People with the link can view your pasted code, only you can remove your paste and it expires automatically. Note that anyone could guess the URI to your paste so don't rely on it being private.

+ ''; + footer = mkDefault '' + View source code, the removal or expiry stories, or read the about page. + ''; + }; + systemd.services.pinnwand = { description = "Pinnwannd HTTP Server"; after = [ "network.target" ]; From fc6fc69ae7069ae43091e5baa69f6031267d0c1e Mon Sep 17 00:00:00 2001 From: Evils Date: Mon, 3 May 2021 15:13:54 +0200 Subject: [PATCH 46/59] bucklespring: unstable-2021-01-21 -> 1.5.0 2021-01-21 was tagged --- pkgs/applications/audio/bucklespring/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/bucklespring/default.nix b/pkgs/applications/audio/bucklespring/default.nix index 8b1432c5ae8..ee363c5c32e 100644 --- a/pkgs/applications/audio/bucklespring/default.nix +++ b/pkgs/applications/audio/bucklespring/default.nix @@ -19,12 +19,12 @@ let in stdenv.mkDerivation rec { pname = "bucklespring"; - version = "unstable-2021-01-21"; + version = "1.5.0"; src = fetchFromGitHub { owner = "zevv"; repo = pname; - rev = "d63100c4561dd7c57efe6440c12fa8d9e9604145"; + rev = version; sha256 = "114dib4npb7r1z2zd1fwsx71xbf9r6psxqd7n7590cwz1w3r51mz"; }; From 1119dbe76483d6ac50a1722ac2fd4f7378f27b09 Mon Sep 17 00:00:00 2001 From: Badi Abdul-Wahid Date: Mon, 3 May 2021 09:46:21 -0500 Subject: [PATCH 47/59] vivaldi: 3.7.2218.45-1 -> 3.8.2259.37-1 --- pkgs/applications/networking/browsers/vivaldi/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/browsers/vivaldi/default.nix b/pkgs/applications/networking/browsers/vivaldi/default.nix index 96355789eb3..9911044c223 100644 --- a/pkgs/applications/networking/browsers/vivaldi/default.nix +++ b/pkgs/applications/networking/browsers/vivaldi/default.nix @@ -18,11 +18,11 @@ let vivaldiName = if isSnapshot then "vivaldi-snapshot" else "vivaldi"; in stdenv.mkDerivation rec { pname = "vivaldi"; - version = "3.7.2218.45-1"; + version = "3.8.2259.37-1"; src = fetchurl { url = "https://downloads.vivaldi.com/${branch}/vivaldi-${branch}_${version}_amd64.deb"; - sha256 = "11q3whw01nbwvzccgn55b4lkr7dzlql961406r6by8xqvf8zgmp4"; + sha256 = "1lpia3jm6l2yvbhrw5khws28n653w22bszzd44y6zv6zwbw7y127"; }; unpackPhase = '' From 2994db87fb2d3564a4e062083b8c2b7e39eb518e Mon Sep 17 00:00:00 2001 From: regnat Date: Fri, 30 Apr 2021 14:22:26 +0200 Subject: [PATCH 48/59] nixUnstable: pre20210326_dd77f71 -> pre20210503_6d2553a (amongst other things) several fixes to make the `ca-derivations` experimental feature usable on a daily basis --- pkgs/tools/package-management/nix/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index 7eda5ae6f35..ac61a64180d 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -215,13 +215,13 @@ in rec { nixUnstable = lib.lowPrio (callPackage common rec { pname = "nix"; version = "2.4${suffix}"; - suffix = "pre20210326_dd77f71"; + suffix = "pre20210503_6d2553a"; src = fetchFromGitHub { owner = "NixOS"; repo = "nix"; - rev = "dd77f71afe6733e9790dd001125c423cb648b7ce"; - sha256 = "rVHzrsCtdiWjyLuHnDplG2mx+7dw5VyzZ9ReXxuCvHY="; + rev = "6d2553ae1496288554e871c530836428f405fd67"; + sha256 = "sha256-YeSeyOKhBAXHlkzo4mwYr8QIjIP9AgdpJ7YdhqOO2CA="; }; inherit storeDir stateDir confDir boehmgc; From bdc95ab29eaaf4efaf2ae1170cb6458f00a41bab Mon Sep 17 00:00:00 2001 From: regnat Date: Fri, 30 Apr 2021 16:43:56 +0200 Subject: [PATCH 49/59] hydraUnstable: 2021-03-29 -> 2021-04-29 Required to work with the latest nixUnstable --- pkgs/development/tools/misc/hydra/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/misc/hydra/default.nix b/pkgs/development/tools/misc/hydra/default.nix index 40a480a0909..7bed3b5d202 100644 --- a/pkgs/development/tools/misc/hydra/default.nix +++ b/pkgs/development/tools/misc/hydra/default.nix @@ -2,12 +2,12 @@ { hydra-unstable = callPackage ./common.nix { - version = "2021-03-29"; + version = "2021-04-29"; src = fetchFromGitHub { owner = "NixOS"; repo = "hydra"; - rev = "9bb04ed97af047968196bad1728f927f7a6d905f"; - sha256 = "sha256-gN/zNI2hGDMnYUjeGnU7SAuXP4KCmNqG+AYOVfINaQE="; + rev = "6047b1dd04d44acff9343b6b971ab609b73099d5"; + sha256 = "sha256-E7JOHhSd4gIzE6FvSZVMxZE9WagbBkrfZVoibkanaYE="; }; nix = nixFlakes; From fda2ff4edc2c0b897011eff4dffc5d777d07f4c8 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 29 Apr 2021 23:02:59 +0200 Subject: [PATCH 50/59] nixos/pinnwand: add reaper systemd unit/timer The reap function culls expired pastes outside of the process serving the pastes. Previously the database could accumulate a large number of pastes and while they were expired they would not be deleted unless accessed from the frontend. --- nixos/modules/services/misc/pinnwand.nix | 45 ++++++++++++++++++------ 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/nixos/modules/services/misc/pinnwand.nix b/nixos/modules/services/misc/pinnwand.nix index ca378847a20..cbc796c9a7c 100644 --- a/nixos/modules/services/misc/pinnwand.nix +++ b/nixos/modules/services/misc/pinnwand.nix @@ -40,39 +40,64 @@ in ''; }; - systemd.services.pinnwand = { - description = "Pinnwannd HTTP Server"; - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; + systemd.services = let + hardeningOptions = { + User = "pinnwand"; + DynamicUser = true; - unitConfig.Documentation = "https://pinnwand.readthedocs.io/en/latest/"; - serviceConfig = { - ExecStart = "${pkgs.pinnwand}/bin/pinnwand --configuration-path ${configFile} http --port ${toString(cfg.port)}"; StateDirectory = "pinnwand"; StateDirectoryMode = "0700"; AmbientCapabilities = []; CapabilityBoundingSet = ""; DevicePolicy = "closed"; - DynamicUser = true; LockPersonality = true; MemoryDenyWriteExecute = true; PrivateDevices = true; PrivateUsers = true; + ProcSubset = "pid"; ProtectClock = true; ProtectControlGroups = true; - ProtectKernelLogs = true; ProtectHome = true; ProtectHostname = true; + ProtectKernelLogs = true; ProtectKernelModules = true; ProtectKernelTunables = true; - RestrictAddressFamilies = [ "AF_UNIX" "AF_INET" "AF_INET6" ]; + ProtectProc = "invisible"; + RestrictAddressFamilies = [ + "AF_UNIX" + "AF_INET" + "AF_INET6" + ]; RestrictNamespaces = true; RestrictRealtime = true; SystemCallArchitectures = "native"; SystemCallFilter = "@system-service"; UMask = "0077"; }; + + command = "${pkgs.pinnwand}/bin/pinnwand --configuration-path ${configFile}"; + in { + pinnwand = { + description = "Pinnwannd HTTP Server"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + + unitConfig.Documentation = "https://pinnwand.readthedocs.io/en/latest/"; + + serviceConfig = { + ExecStart = "${command} http --port ${toString(cfg.port)}"; + } // hardeningOptions; + }; + + pinnwand-reaper = { + description = "Pinnwand Reaper"; + startAt = "daily"; + + serviceConfig = { + ExecStart = "${command} -vvvv reap"; # verbosity increased to show number of deleted pastes + } // hardeningOptions; + }; }; }; } From f1c32c28096f565c0d977bce6cc3a0adb113d267 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 29 Apr 2021 23:12:20 +0200 Subject: [PATCH 51/59] nixos/tests/pinnwand: show systemd-analyze security Easy way to revisit the hardening setup of the systemd unit. --- nixos/tests/pinnwand.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/tests/pinnwand.nix b/nixos/tests/pinnwand.nix index 0c583e1104d..7f6075c3c74 100644 --- a/nixos/tests/pinnwand.nix +++ b/nixos/tests/pinnwand.nix @@ -82,5 +82,7 @@ in # remove paste and check that it's not available any more client.succeed(f"curl {removal_link}") client.fail(f"curl --fail {raw_url}") + + server.log(server.succeed("systemd-analyze security pinnwand")) ''; }) From 7b2bc43dba0f705987cc8c1f35620a4021838ac8 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 29 Apr 2021 23:53:37 +0200 Subject: [PATCH 52/59] nixos/tests/pinnwand: add negative-test for the reaper The reaper, at this point, should not delete a freshly created paste. --- nixos/tests/pinnwand.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nixos/tests/pinnwand.nix b/nixos/tests/pinnwand.nix index 7f6075c3c74..dc8c2744a81 100644 --- a/nixos/tests/pinnwand.nix +++ b/nixos/tests/pinnwand.nix @@ -75,6 +75,12 @@ in if line.startswith("Removal link:"): removal_link = line.split(":", 1)[1] + + # start the reaper, it shouldn't do anything meaningful here + server.systemctl("start pinnwand-reaper.service") + server.wait_until_fails("systemctl is-active -q pinnwand-reaper.service") + server.log(server.execute("journalctl -u pinnwand-reaper -e --no-pager")[1]) + # check whether paste matches what we sent client.succeed(f"curl {raw_url} > /tmp/machine-id") client.succeed("diff /tmp/machine-id /etc/machine-id") From b208338c3669648f03e7dda5d4107e5e79993907 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 30 Apr 2021 00:03:43 +0200 Subject: [PATCH 53/59] nixos/tests/pinnwand: use wait_for_open_port instead of direct sockstat call --- nixos/tests/pinnwand.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/tests/pinnwand.nix b/nixos/tests/pinnwand.nix index dc8c2744a81..0391c413311 100644 --- a/nixos/tests/pinnwand.nix +++ b/nixos/tests/pinnwand.nix @@ -61,7 +61,7 @@ in client.wait_until_succeeds("ping -c1 server") # make sure pinnwand is listening - server.wait_until_succeeds("ss -lnp | grep ${toString port}") + server.wait_for_open_port(${toString port}) # send the contents of /etc/machine-id response = client.succeed("steck paste /etc/machine-id") From ba286702f5575711dba190e9161f883297a3718d Mon Sep 17 00:00:00 2001 From: Badi Abdul-Wahid Date: Mon, 3 May 2021 09:50:19 -0500 Subject: [PATCH 54/59] vivaldi: add missing build/install phase hooks --- pkgs/applications/networking/browsers/vivaldi/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/applications/networking/browsers/vivaldi/default.nix b/pkgs/applications/networking/browsers/vivaldi/default.nix index 9911044c223..2ff0d2d5df0 100644 --- a/pkgs/applications/networking/browsers/vivaldi/default.nix +++ b/pkgs/applications/networking/browsers/vivaldi/default.nix @@ -47,6 +47,7 @@ in stdenv.mkDerivation rec { + ":$out/opt/${vivaldiName}/lib"; buildPhase = '' + runHook preBuild echo "Patching Vivaldi binaries" patchelf \ --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ @@ -56,12 +57,14 @@ in stdenv.mkDerivation rec { ln -s ${vivaldi-ffmpeg-codecs}/lib/libffmpeg.so opt/${vivaldiName}/libffmpeg.so.''${version%\.*\.*} '' + '' echo "Finished patching Vivaldi binaries" + runHook postBuild ''; dontPatchELF = true; dontStrip = true; installPhase = '' + runHook preInstall mkdir -p "$out" cp -r opt "$out" mkdir "$out/bin" @@ -84,6 +87,8 @@ in stdenv.mkDerivation rec { ${lib.optionalString enableWidevine "--suffix LD_LIBRARY_PATH : ${libPath}"} '' + lib.optionalString enableWidevine '' ln -sf ${vivaldi-widevine}/share/google/chrome/WidevineCdm $out/opt/${vivaldiName}/WidevineCdm + '' + '' + runHook postInstall ''; meta = with lib; { From 9cf8d0d22f8f0c12ffa9234146eb21d346571577 Mon Sep 17 00:00:00 2001 From: Sandro Date: Mon, 3 May 2021 16:59:17 +0200 Subject: [PATCH 55/59] ripgrep: cleanup --- pkgs/tools/text/ripgrep/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/text/ripgrep/default.nix b/pkgs/tools/text/ripgrep/default.nix index 6417fb0f93b..61c24ae39e4 100644 --- a/pkgs/tools/text/ripgrep/default.nix +++ b/pkgs/tools/text/ripgrep/default.nix @@ -6,7 +6,7 @@ , pkg-config , Security , withPCRE2 ? true -, pcre2 ? null +, pcre2 }: rustPlatform.buildRustPackage rec { @@ -26,8 +26,8 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ asciidoctor installShellFiles ] ++ lib.optional withPCRE2 pkg-config; - buildInputs = (lib.optional withPCRE2 pcre2) - ++ (lib.optional stdenv.isDarwin Security); + buildInputs = lib.optional withPCRE2 pcre2 + ++ lib.optional stdenv.isDarwin Security; preFixup = '' installManPage $releaseDir/build/ripgrep-*/out/rg.1 From a376d4944c395040295d80c91d79e2d90a574b76 Mon Sep 17 00:00:00 2001 From: Tethys Svensson Date: Mon, 3 May 2021 19:01:09 +0200 Subject: [PATCH 56/59] busybox: Add a fix for CVE-2021-28831 (#121578) --- pkgs/os-specific/linux/busybox/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/busybox/default.nix b/pkgs/os-specific/linux/busybox/default.nix index 6c034e1c2af..63435e09168 100644 --- a/pkgs/os-specific/linux/busybox/default.nix +++ b/pkgs/os-specific/linux/busybox/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, buildPackages, fetchurl, fetchFromGitLab +{ stdenv, lib, buildPackages, fetchurl, fetchFromGitLab, fetchpatch , enableStatic ? stdenv.hostPlatform.isStatic , enableMinimal ? false # Allow forcing musl without switching stdenv itself, e.g. for our bootstrapping: @@ -49,6 +49,9 @@ in stdenv.mkDerivation rec { pname = "busybox"; + # TODO: When bumping to next version, remove the patch + # for CVE-2021-28831 (assuming the patch was included in + # the next upstream release) version = "1.32.1"; # Note to whoever is updating busybox: please verify that: @@ -64,6 +67,11 @@ stdenv.mkDerivation rec { patches = [ ./busybox-in-store.patch + (fetchpatch { + name = "CVE-2021-28831.patch"; + url = "https://git.busybox.net/busybox/patch/?id=f25d254dfd4243698c31a4f3153d4ac72aa9e9bd"; + sha256 = "0y79flfbk45krwn963nnbqc21a88bsz4k4asqwvcnfk2lkciadxm"; + }) # TODO: Removing when bumping the version ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ./clang-cross.patch; postPatch = "patchShebangs ."; From ff43bbe53e370fa1072e952b89d0a32fb1dfda3a Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Sat, 16 Jan 2021 13:57:59 -0800 Subject: [PATCH 57/59] matrix-dendrite: add nixos module --- nixos/modules/module-list.nix | 1 + .../modules/services/misc/matrix-dendrite.nix | 181 ++++++++++++++++++ 2 files changed, 182 insertions(+) create mode 100644 nixos/modules/services/misc/matrix-dendrite.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index dd6fa483281..11d55e29a82 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -509,6 +509,7 @@ ./services/misc/mame.nix ./services/misc/matrix-appservice-discord.nix ./services/misc/matrix-appservice-irc.nix + ./services/misc/matrix-dendrite.nix ./services/misc/matrix-synapse.nix ./services/misc/mautrix-telegram.nix ./services/misc/mbpfan.nix diff --git a/nixos/modules/services/misc/matrix-dendrite.nix b/nixos/modules/services/misc/matrix-dendrite.nix new file mode 100644 index 00000000000..b719df29c5a --- /dev/null +++ b/nixos/modules/services/misc/matrix-dendrite.nix @@ -0,0 +1,181 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.services.matrix-dendrite; + settingsFormat = pkgs.formats.yaml { }; + configurationYaml = settingsFormat.generate "dendrite.yaml" cfg.settings; + workingDir = "/var/lib/matrix-dendrite"; +in +{ + options.services.matrix-dendrite = { + enable = lib.mkEnableOption "matrix.org dendrite"; + httpPort = lib.mkOption { + type = lib.types.nullOr lib.types.port; + default = 8008; + description = '' + The port to listen for HTTP requests on. + ''; + }; + httpsPort = lib.mkOption { + type = lib.types.nullOr lib.types.port; + default = null; + description = '' + The port to listen for HTTPS requests on. + ''; + }; + tlsCert = lib.mkOption { + type = lib.types.nullOr lib.types.path; + example = "/var/lib/matrix-dendrite/server.cert"; + default = null; + description = '' + The path to the TLS certificate. + + + nix-shell -p matrix-dendrite --command "generate-keys --tls-cert server.crt --tls-key server.key" + + ''; + }; + tlsKey = lib.mkOption { + type = lib.types.nullOr lib.types.path; + example = "/var/lib/matrix-dendrite/server.key"; + default = null; + description = '' + The path to the TLS key. + + + nix-shell -p matrix-dendrite --command "generate-keys --tls-cert server.crt --tls-key server.key" + + ''; + }; + environmentFile = lib.mkOption { + type = lib.types.nullOr lib.types.path; + example = "/var/lib/matrix-dendrite/registration_secret"; + default = null; + description = '' + Environment file as defined in + systemd.exec5 + . + Secrets may be passed to the service without adding them to the world-readable + Nix store, by specifying placeholder variables as the option value in Nix and + setting these variables accordingly in the environment file. Currently only used + for the registration secret to allow secure registration when + client_api.registration_disabled is true. + + + # snippet of dendrite-related config + services.matrix-dendrite.settings.client_api.registration_shared_secret = "$REGISTRATION_SHARED_SECRET"; + + + + # content of the environment file + REGISTRATION_SHARED_SECRET=verysecretpassword + + + Note that this file needs to be available on the host on which + dendrite is running. + ''; + }; + settings = lib.mkOption { + type = lib.types.submodule { + freeformType = settingsFormat.type; + options.global = { + server_name = lib.mkOption { + type = lib.types.str; + example = "example.com"; + description = '' + The domain name of the server, with optional explicit port. + This is used by remote servers to connect to this server. + This is also the last part of your UserID. + ''; + }; + private_key = lib.mkOption { + type = lib.types.path; + example = "${workingDir}/matrix_key.pem"; + description = '' + The path to the signing private key file, used to sign + requests and events. + + + nix-shell -p matrix-dendrite --command "generate-keys --private-key matrix_key.pem" + + ''; + }; + trusted_third_party_id_servers = lib.mkOption { + type = lib.types.listOf lib.types.str; + example = [ "matrix.org" ]; + default = [ "matrix.org" "vector.im" ]; + description = '' + Lists of domains that the server will trust as identity + servers to verify third party identifiers such as phone + numbers and email addresses + ''; + }; + }; + options.client_api = { + registration_disabled = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Whether to disable user registration to the server + without the shared secret. + ''; + }; + }; + }; + default = { }; + description = '' + Configuration for dendrite, see: + + for available options with which to populate settings. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + assertions = [{ + assertion = cfg.httpsPort != null -> (cfg.tlsCert != null && cfg.tlsKey != null); + message = '' + If Dendrite is configured to use https, tlsCert and tlsKey must be provided. + + nix-shell -p matrix-dendrite --command "generate-keys --tls-cert server.crt --tls-key server.key" + ''; + }]; + + systemd.services.matrix-dendrite = { + description = "Dendrite Matrix homeserver"; + after = [ + "network.target" + ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + Type = "simple"; + DynamicUser = true; + StateDirectory = "matrix-dendrite"; + WorkingDirectory = workingDir; + RuntimeDirectory = "matrix-dendrite"; + RuntimeDirectoryMode = "0700"; + EnvironmentFile = lib.mkIf (cfg.environmentFile != null) cfg.environmentFile; + ExecStartPre = + if (cfg.environmentFile != null) then '' + ${pkgs.envsubst}/bin/envsubst \ + -i ${configurationYaml} \ + -o /run/matrix-dendrite/dendrite.yaml + '' else '' + ${pkgs.coreutils}/bin/cp ${configurationYaml} /run/matrix-dendrite/dendrite.yaml + ''; + ExecStart = lib.strings.concatStringsSep " " ([ + "${pkgs.matrix-dendrite}/bin/dendrite-monolith-server" + "--config /run/matrix-dendrite/dendrite.yaml" + ] ++ lib.optionals (cfg.httpPort != null) [ + "--http-bind-address :${builtins.toString cfg.httpPort}" + ] ++ lib.optionals (cfg.httpsPort != null) [ + "--https-bind-address :${builtins.toString cfg.httpsPort}" + "--tls-cert ${cfg.tlsCert}" + "--tls-key ${cfg.tlsKey}" + ]); + ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; + Restart = "on-failure"; + }; + }; + }; + meta.maintainers = lib.teams.matrix.members; +} From f7906ec8b2978b78d6e541716b1f949fbc045849 Mon Sep 17 00:00:00 2001 From: alvar <8402811+oxzi@users.noreply.github.com> Date: Mon, 3 May 2021 19:15:33 +0200 Subject: [PATCH 58/59] pythonPackages.pytmx: 3.24.0 -> 3.25.0 (#121485) --- .../development/python-modules/pytmx/default.nix | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/pytmx/default.nix b/pkgs/development/python-modules/pytmx/default.nix index 17c18a96c73..6d88f4b636b 100644 --- a/pkgs/development/python-modules/pytmx/default.nix +++ b/pkgs/development/python-modules/pytmx/default.nix @@ -5,20 +5,26 @@ buildPythonPackage rec { pname = "pytmx"; - version = "3.24.0"; + version = "3.25"; disabled = isPy27; src = fetchFromGitHub { - # The release was not git tagged. owner = "bitcraft"; repo = "PyTMX"; - rev = "eb96efea30d57b731654b2a167d86b8b553b147d"; - sha256 = "1g1j4w75zw76p5f8m5v0hdigdlva2flf0ngyk8nvqcwzcl5vq5wc"; + rev = version; + sha256 = "0v07zhvzvl2qcqhjzgfzm8hgayq38gaqcxxkyhlq9n0hlk93nm97"; }; propagatedBuildInputs = [ pygame pyglet pysdl2 six ]; + pythonImportsCheck = [ + "pytmx.pytmx" + "pytmx.util_pygame" + "pytmx.util_pyglet" + "pytmx.util_pysdl2" + ]; + checkPhase = '' # Change into the test directory due to a relative resource path. cd tests/pytmx @@ -28,7 +34,7 @@ buildPythonPackage rec { meta = with lib; { homepage = "https://github.com/bitcraft/PyTMX"; description = "Python library to read Tiled Map Editor's TMX maps"; - license = licenses.lgpl3; + license = licenses.lgpl3Plus; maintainers = with maintainers; [ oxzi ]; }; } From 62f241d4457381b1a0cdd0903501ad5f90e888c1 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Giraudeau Date: Mon, 15 Mar 2021 17:54:11 +0100 Subject: [PATCH 59/59] nixos/oauth2_proxy_nginx: add nginx config only if oauth2_proxy is enabled. --- nixos/modules/services/security/oauth2_proxy_nginx.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/security/oauth2_proxy_nginx.nix b/nixos/modules/services/security/oauth2_proxy_nginx.nix index 553638ad496..d82ddb894ea 100644 --- a/nixos/modules/services/security/oauth2_proxy_nginx.nix +++ b/nixos/modules/services/security/oauth2_proxy_nginx.nix @@ -23,7 +23,8 @@ in config.services.oauth2_proxy = mkIf (cfg.virtualHosts != [] && (hasPrefix "127.0.0.1:" cfg.proxy)) { enable = true; }; - config.services.nginx = mkMerge ((optional (cfg.virtualHosts != []) { + config.services.nginx = mkIf config.services.oauth2_proxy.enable (mkMerge + ((optional (cfg.virtualHosts != []) { recommendedProxySettings = true; # needed because duplicate headers }) ++ (map (vhost: { virtualHosts.${vhost} = { @@ -60,5 +61,5 @@ in ''; }; - }) cfg.virtualHosts)); + }) cfg.virtualHosts))); }