diff --git a/pkgs/applications/misc/auto-multiple-choice/0001-AMC-TXT-New-global-option-ShowGroupText.patch b/pkgs/applications/misc/auto-multiple-choice/0001-AMC-TXT-New-global-option-ShowGroupText.patch new file mode 100644 index 000000000000000..906ea569394a12f --- /dev/null +++ b/pkgs/applications/misc/auto-multiple-choice/0001-AMC-TXT-New-global-option-ShowGroupText.patch @@ -0,0 +1,57 @@ +From 20c120c57a65eb0ab9203cb347bb78b664b80974 Mon Sep 17 00:00:00 2001 +From: Michal Sojka +Date: Sun, 21 Jan 2018 23:13:00 +0100 +Subject: [PATCH 1/2] AMC-TXT: New global option ShowGroupText + +When this option is enabled (default), the text after group start/end +marks i.e., after "*(" or "*)", is shown in the printed tests. This is +the same behavior as before this commit. + +By setting this option to 0, no group marks are generated. This is +useful if groups are used merely as containers for similar questions +and have numquestions=1 option. In this case, it makes little sense to +add group text before and after every question. +--- + AMC-perl/AMC/Filter/plain.pm | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/AMC-perl/AMC/Filter/plain.pm b/AMC-perl/AMC/Filter/plain.pm +index 5970266d..e0f7d4be 100644 +--- a/AMC-perl/AMC/Filter/plain.pm ++++ b/AMC-perl/AMC/Filter/plain.pm +@@ -63,6 +63,7 @@ sub new { + TitleWidth + Pages + RandomSeed ++ ShowGroupText + PreAssociation PreAssociationKey PreAssociationName + / + ]; +@@ -75,6 +76,7 @@ sub new { + CompleteMulti SeparateAnswerSheet AutoMarks + Arabic + ManualDuplex SingleSided ++ ShowGroupText + / + ]; + +@@ -119,6 +121,7 @@ sub new { + namefieldlinespace => '.5em', + titlewidth => ".47\\linewidth", + randomseed => "1527384", ++ showgrouptext => 1, + lang => '', + code => 0, + 'latex-preambule' => '', +@@ -487,7 +490,7 @@ sub read_file { + if (/^\s*\*([\(\)])(?:\[([^]]*)\])?\s*(.*)/) { + my $action = $1; + my $options = $2; +- my $text = $3; ++ my $text=$self->{'options'}->{'showgrouptext'} ? $3 : ""; + debug "Group A=" . printable($action) . " O=" . printable($options); + my %oo = $self->read_options($options); + if ( $action eq '(' ) { +-- +2.34.1 + diff --git a/pkgs/applications/misc/auto-multiple-choice/0002-Test-8-page-alignment.patch b/pkgs/applications/misc/auto-multiple-choice/0002-Test-8-page-alignment.patch new file mode 100644 index 000000000000000..9c6efa571eb8744 --- /dev/null +++ b/pkgs/applications/misc/auto-multiple-choice/0002-Test-8-page-alignment.patch @@ -0,0 +1,55 @@ +From bed560fcf352343d75f8a4c719d2710c60420672 Mon Sep 17 00:00:00 2001 +From: Michal Sojka +Date: Fri, 25 Jan 2019 18:26:26 +0100 +Subject: [PATCH 2/2] Test 8-page alignment + +--- + AMC-buildpdf.cc | 2 ++ + AMC-perl/AMC/Annotate.pm | 11 +++++++++++ + 2 files changed, 13 insertions(+) + +diff --git a/AMC-buildpdf.cc b/AMC-buildpdf.cc +index 73dea3ca..a4549e57 100644 +--- a/AMC-buildpdf.cc ++++ b/AMC-buildpdf.cc +@@ -89,6 +89,8 @@ int main(int argc, char** argv ) + processing_error = PDF.load_pdf(command + 9); + } else if(sscanf(command, "page pdf %ld", &i) == 1) { + processing_error = PDF.new_page_from_pdf(i); ++ } else if(strcmp(command, "page empty") == 0) { ++ processing_error = PDF.next_page(); + } else if(strcmp(command, "matrix identity") == 0) { + PDF.identity_matrix(); + } else if(sscanf(command, "matrix %lf %lf %lf %lf %lf %lf", +diff --git a/AMC-perl/AMC/Annotate.pm b/AMC-perl/AMC/Annotate.pm +index 6e15af59..cbb49f37 100644 +--- a/AMC-perl/AMC/Annotate.pm ++++ b/AMC-perl/AMC/Annotate.pm +@@ -1036,6 +1036,14 @@ sub student_draw_page { + } + } + ++sub draw_empty_page { ++ my ($self,$page)=@_; ++ ++ debug "Drawing empty page #$page"; ++ ++ $self->command("page empty"); ++} ++ + # process a student copy + + sub process_student { +@@ -1077,6 +1085,9 @@ sub process_student { + for my $page ( $self->student_pages($student) ) { + $self->student_draw_page( $student, $page ); + } ++ for (my $i = $self->student_pages($student); $i % 8 != 0; $i++) { ++ $self->draw_empty_page($i+1); ++ } + + $self->{data}->end_transaction('aOST'); + } +-- +2.34.1 + diff --git a/pkgs/applications/misc/auto-multiple-choice/default.nix b/pkgs/applications/misc/auto-multiple-choice/default.nix index 43aad6d5be16b4c..c7713dad8185cbf 100644 --- a/pkgs/applications/misc/auto-multiple-choice/default.nix +++ b/pkgs/applications/misc/auto-multiple-choice/default.nix @@ -68,6 +68,11 @@ stdenv.mkDerivation (finalAttrs: rec { "GCC_PP=${stdenv.cc.targetPrefix}c++" ]; + patches = [ + ./0001-AMC-TXT-New-global-option-ShowGroupText.patch + ./0002-Test-8-page-alignment.patch + ]; + preFixup = '' makeWrapperArgs+=("''${gappsWrapperArgs[@]}") ''; diff --git a/pkgs/applications/misc/gcalcli/default.nix b/pkgs/applications/misc/gcalcli/default.nix index 90b4883ec290af4..6446a9bfb71cff2 100644 --- a/pkgs/applications/misc/gcalcli/default.nix +++ b/pkgs/applications/misc/gcalcli/default.nix @@ -5,13 +5,13 @@ with python3.pkgs; buildPythonApplication rec { pname = "gcalcli"; - version = "4.3.0"; + version = "4.3.0+pr599"; src = fetchFromGitHub { owner = "insanum"; repo = pname; - rev = "v${version}"; - sha256 = "0s5fhcmz3n0dwh3vkqr4aigi59q43v03ch5jhh6v75149icwr0df"; + rev = "d8378f7ec92b160012d867e51ceb5c73af1cc4b0"; # https://github.com/insanum/gcalcli/pull/599 + sha256 = "sha256-V4oqetDg56YksjYd/yjB7wH+t+mvxSmExVSYEFUhD/0="; }; postPatch = lib.optionalString stdenv.isLinux '' diff --git a/pkgs/applications/video/shotcut/0001-Don-t-use-connection_type-x11-for-VAAPI-HW-accelerat.patch b/pkgs/applications/video/shotcut/0001-Don-t-use-connection_type-x11-for-VAAPI-HW-accelerat.patch new file mode 100644 index 000000000000000..7cf5f6e9f0f8a36 --- /dev/null +++ b/pkgs/applications/video/shotcut/0001-Don-t-use-connection_type-x11-for-VAAPI-HW-accelerat.patch @@ -0,0 +1,57 @@ +From 36adc7859d8e9f8eeeca14c9620b0218d4306438 Mon Sep 17 00:00:00 2001 +From: Michal Sojka +Date: Sat, 4 Sep 2021 11:18:16 +0200 +Subject: [PATCH] Don't use connection_type=x11 for VAAPI HW acceleration + +Without this, HW acceleration doesn't work on my Intel system. +--- + src/docks/encodedock.cpp | 3 +-- + src/proxymanager.cpp | 4 ++-- + 2 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/src/docks/encodedock.cpp b/src/docks/encodedock.cpp +index 18d21a8f..0f0f4255 100644 +--- a/src/docks/encodedock.cpp ++++ b/src/docks/encodedock.cpp +@@ -791,7 +791,6 @@ Mlt::Properties* EncodeDock::collectProperties(int realtime, bool includeProfile + setIfNotSet(p, "pix_fmt", "nv12"); + } else if (vcodec.endsWith("_vaapi")) { + setIfNotSet(p, "vprofile", "main"); +- setIfNotSet(p, "connection_type", "x11"); + } + } + if (includeProfile || ui->widthSpinner->value() != MLT.profile().width()) { +@@ -2052,7 +2051,7 @@ bool EncodeDock::detectHardwareEncoders() + QStringList args; + args << "-hide_banner" << "-f" << "lavfi" << "-i" << "color=s=640x360" << "-frames" << "1" << "-an"; + if (codec.endsWith("_vaapi")) +- args << "-init_hw_device" << "vaapi=vaapi0:,connection_type=x11" << "-filter_hw_device" << "vaapi0" << "-vf" << "format=nv12,hwupload"; ++ args << "-init_hw_device" << "vaapi=vaapi0:" << "-filter_hw_device" << "vaapi0" << "-vf" << "format=nv12,hwupload"; + else if (codec == "hevc_qsv") + args << "-load_plugin" << "hevc_hw"; + args << "-c:v" << codec << "-f" << "rawvideo" << "pipe:"; +diff --git a/src/proxymanager.cpp b/src/proxymanager.cpp +index 0fcc2fc1..bc4f1c44 100644 +--- a/src/proxymanager.cpp ++++ b/src/proxymanager.cpp +@@ -175,7 +175,7 @@ void ProxyManager::generateVideoProxy(Mlt::Producer& producer, bool fullRange, S + args << "-rc" << "1"; + args << "-qp_i" << "32" << "-qp_p" << "32"; + } else if (hwCodecs.contains("hevc_vaapi")) { +- args << "-init_hw_device" << "vaapi=vaapi0:,connection_type=x11" << "-filter_hw_device" << "vaapi0"; ++ args << "-init_hw_device" << "vaapi=vaapi0:" << "-filter_hw_device" << "vaapi0"; + args << "-codec:v" << "hevc_vaapi"; + args << "-qp" << "37"; + } else if (hwCodecs.contains("h264_nvenc")) { +@@ -183,7 +183,7 @@ void ProxyManager::generateVideoProxy(Mlt::Producer& producer, bool fullRange, S + args << "-rc" << "constqp"; + args << "-vglobal_quality" << "37"; + } else if (hwCodecs.contains("h264_vaapi")) { +- args << "-init_hw_device" << "vaapi=vaapi0:,connection_type=x11" << "-filter_hw_device" << "vaapi0"; ++ args << "-init_hw_device" << "vaapi=vaapi0:" << "-filter_hw_device" << "vaapi0"; + args << "-codec:v" << "h264_vaapi"; + args << "-qp" << "30"; + } else if (hwCodecs.contains("hevc_videotoolbox")) { +-- +2.32.0 + diff --git a/pkgs/applications/video/shotcut/default.nix b/pkgs/applications/video/shotcut/default.nix index efa7782891ceb58..a1c857afda8b161 100644 --- a/pkgs/applications/video/shotcut/default.nix +++ b/pkgs/applications/video/shotcut/default.nix @@ -62,6 +62,8 @@ mkDerivation rec { sed "s_/usr/bin/nice_''${NICE}_" -i src/jobs/meltjob.cpp src/jobs/ffmpegjob.cpp ''; + patches = [ ./0001-Don-t-use-connection_type-x11-for-VAAPI-HW-accelerat.patch ]; + qtWrapperArgs = [ "--prefix FREI0R_PATH : ${frei0r}/lib/frei0r-1" "--prefix LADSPA_PATH : ${ladspaPlugins}/lib/ladspa" diff --git a/pkgs/by-name/oa/oauth2ms/package.nix b/pkgs/by-name/oa/oauth2ms/package.nix new file mode 100644 index 000000000000000..b32ea14d3a9f1f7 --- /dev/null +++ b/pkgs/by-name/oa/oauth2ms/package.nix @@ -0,0 +1,35 @@ +{ lib, stdenv, fetchFromGitHub, python3 }: + +stdenv.mkDerivation { + pname = "oauth2ms"; + version = "2021-07-09"; + + src = fetchFromGitHub { + owner = "harishkrupo"; + repo = "oauth2ms"; + rev = "a1ef0cabfdea57e9309095954b90134604e21c08"; # No tags or releases in the repo + sha256 = "sha256-xPSWlHJAXhhj5I6UMjUtH1EZqCZWHJMFWTu3a4k1ETc"; + }; + + buildInputs = [ + (python3.withPackages (ps: with ps; [ + pyxdg + msal + python-gnupg + ])) + ]; + + installPhase = '' + runHook preInstall + install -m755 -D oauth2ms $out/bin/oauth2ms + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://github.com/harishkrupo/oauth2ms"; + description = "XOAUTH2 compatible Office365 token fetcher"; + platforms = platforms.all; + license = licenses.asl20; + maintainers = with maintainers; [ wentasah ]; + }; +} diff --git a/pkgs/tools/graphics/gnuplot/default.nix b/pkgs/tools/graphics/gnuplot/default.nix index fa9635f0cb8aab2..a292dedc6f99921 100644 --- a/pkgs/tools/graphics/gnuplot/default.nix +++ b/pkgs/tools/graphics/gnuplot/default.nix @@ -13,6 +13,7 @@ , gnused ? null , coreutils ? null , withQt ? false, mkDerivation, qttools, qtbase, qtsvg +, enableInfo ? true, emacs }: assert libX11 != null -> (fontconfig != null && gnused != null && coreutils != null); @@ -28,7 +29,12 @@ in sha256 = "sha256-l12MHMLEHHztxOMjr/A12Xf+ual/ApbdKopm0Zelsnw="; }; - nativeBuildInputs = [ makeWrapper pkg-config texinfo ] ++ lib.optional withQt qttools; + outputs = [ "out" ] ++ lib.optional enableInfo "info"; + + nativeBuildInputs = + [ makeWrapper pkg-config texinfo ] + ++ lib.optional withQt qttools + ++ lib.optional enableInfo emacs; buildInputs = [ cairo gd libcerf pango readline zlib ] @@ -74,6 +80,10 @@ in enableParallelBuilding = true; + installTargets = + [ "install" ] + ++ lib.optional enableInfo "install-info"; + meta = with lib; { homepage = "http://www.gnuplot.info/"; description = "A portable command-line driven graphing utility for many platforms"; diff --git a/pkgs/tools/networking/ucspi-tcp/default.nix b/pkgs/tools/networking/ucspi-tcp/default.nix index 4b307079266b1ee..9743d704bd0e7f5 100644 --- a/pkgs/tools/networking/ucspi-tcp/default.nix +++ b/pkgs/tools/networking/ucspi-tcp/default.nix @@ -1,5 +1,6 @@ -{ lib, stdenv, fetchurl }: - +{ lib, stdenv, fetchurl +, ipv6Support ? true +}: stdenv.mkDerivation rec { pname = "ucspi-tcp"; version = "0.88"; @@ -15,7 +16,11 @@ stdenv.mkDerivation rec { url = "http://ftp.de.debian.org/debian/pool/main/u/ucspi-tcp/ucspi-tcp_0.88-3.diff.gz"; sha256 = "0mzmhz8hjkrs0khmkzs5i0s1kgmgaqz07h493bd5jj5fm5njxln6"; }) - ./remove-setuid.patch + ] ++ lib.optional ipv6Support [ + (fetchurl { + url = "https://salsa.debian.org/debian/ucspi-tcp/-/raw/debian/1%250.88-7/debian/ipv6-support.patch"; + sha256 = "sha256-sFOVWJBsnLNZhsOH+TFmYt7NyMwJfbtSg/qCKEAyaQI="; + }) ]; # Apply Debian patches @@ -24,6 +29,9 @@ stdenv.mkDerivation rec { echo "Applying patch $fname" patch < "$fname" done + + # Remove setuid + substituteInPlace hier.c --replace ',02755);' ',0755);' ''; # The build system is weird; 'make install' doesn't install anything, instead @@ -46,6 +54,14 @@ stdenv.mkDerivation rec { # run the newly built installer ./install + '' + lib.optionalString ipv6Support '' + # Replicate Debian's man install logic (some man pages from + # ipv6-support.patch will be overwritten below by + # debian/ucspi-tcp-man/*.1). + rm -rf "$out/usr/man/man5" # don't include tcp-environ(5) + mv -v "$out"/man/man1/*.1 "$out/share/man/man1/" + + '' + '' # Install Debian man pages (upstream has none) cp debian/ucspi-tcp-man/*.1 "$out/share/man/man1" ''; diff --git a/pkgs/tools/networking/ucspi-tcp/remove-setuid.patch b/pkgs/tools/networking/ucspi-tcp/remove-setuid.patch deleted file mode 100644 index dd693320804630d..000000000000000 --- a/pkgs/tools/networking/ucspi-tcp/remove-setuid.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/hier.c b/hier.c -index 5663ada..1d73b84 100644 ---- a/hier.c -+++ b/hier.c -@@ -2,8 +2,8 @@ - - void hier() - { -- h(auto_home,-1,-1,02755); -- d(auto_home,"bin",-1,-1,02755); -+ h(auto_home,-1,-1,0755); -+ d(auto_home,"bin",-1,-1,0755); - - c(auto_home,"bin","tcpserver",-1,-1,0755); - c(auto_home,"bin","tcprules",-1,-1,0755);