Lines Matching +full:sub +full:- +full:system
2 # SPDX-License-Identifier: GPL-2.0-or-later
5 # Copyright (c) 2017-2020 Mauro Carvalho Chehab <mchehab@kernel.org>
51 'amsfonts.sty' => 'texlive-amsfonts',
52 'amsmath.sty' => 'texlive-amsmath',
53 'amssymb.sty' => 'texlive-amsfonts',
54 'amsthm.sty' => 'texlive-amscls',
55 'anyfontsize.sty' => 'texlive-anyfontsize',
56 'atbegshi.sty' => 'texlive-oberdiek',
57 'bm.sty' => 'texlive-tools',
58 'capt-of.sty' => 'texlive-capt-of',
59 'cmap.sty' => 'texlive-cmap',
60 'ecrm1000.tfm' => 'texlive-ec',
61 'eqparbox.sty' => 'texlive-eqparbox',
62 'eu1enc.def' => 'texlive-euenc',
63 'fancybox.sty' => 'texlive-fancybox',
64 'fancyvrb.sty' => 'texlive-fancyvrb',
65 'float.sty' => 'texlive-float',
66 'fncychap.sty' => 'texlive-fncychap',
67 'footnote.sty' => 'texlive-mdwtools',
68 'framed.sty' => 'texlive-framed',
69 'luatex85.sty' => 'texlive-luatex85',
70 'multirow.sty' => 'texlive-multirow',
71 'needspace.sty' => 'texlive-needspace',
72 'palatino.sty' => 'texlive-psnfss',
73 'parskip.sty' => 'texlive-parskip',
74 'polyglossia.sty' => 'texlive-polyglossia',
75 'tabulary.sty' => 'texlive-tabulary',
76 'threeparttable.sty' => 'texlive-threeparttable',
77 'titlesec.sty' => 'texlive-titlesec',
78 'ucs.sty' => 'texlive-ucs',
79 'upquote.sty' => 'texlive-upquote',
80 'wrapfig.sty' => 'texlive-wrapfig',
81 'ctexhook.sty' => 'texlive-ctex',
88 sub check_missing(%)
102 $optional--;
123 sub add_package($$)
136 sub check_missing_file($$$)
143 return if(-e $_);
149 sub findprog($)
152 return "$_/$_[0]" if(-x "$_/$_[0]");
156 sub find_python_no_venv()
165 return "$dir/python3" if(-x "$dir/python3");
169 return "$dir/python" if(-x "$dir/python");
174 sub check_program($$)
184 sub check_perl_module($$)
189 my $err = system("perl -M$prog -e 1 2>/dev/null /dev/null");
195 sub check_python_module($$)
202 my $err = system("$python_cmd -c 'import $prog' 2>/dev/null /dev/null");
208 sub check_rpm_missing($$)
214 my $err = system("rpm -q '$prog' 2>/dev/null >/dev/null");
219 sub check_pacman_missing($$)
225 my $err = system("pacman -Q '$prog' 2>/dev/null >/dev/null");
230 sub check_missing_tex($)
246 sub get_sphinx_fname()
248 my $fname = "sphinx-build";
251 $fname = "sphinx-build-3";
260 sub get_sphinx_version($)
265 open IN, "$cmd --version 2>&1 |";
267 if (m/^\s*sphinx-build\s+([\d\.]+)((\+\/[\da-f]+)|(b\d+))?$/) {
281 sub check_sphinx()
322 sub catcheck($)
325 $res = qx(cat $_[0]) if (-r $_[0]);
329 sub which($)
336 return $name if (-x $name );
342 # Subroutines that check distro-specific hints
345 sub give_debian_hints()
348 "python-sphinx" => "python3-sphinx",
349 "yaml" => "python3-yaml",
350 "ensurepip" => "python3-venv",
354 "Pod::Usage" => "perl-modules",
355 "xelatex" => "texlive-xetex",
356 "rsvg-convert" => "librsvg2-bin",
360 check_missing_file(["/usr/share/texlive/texmf-dist/tex/latex/ctex/ctexhook.sty"],
361 "texlive-lang-chinese", 2);
364 "fonts-dejavu", 2);
366 check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc",
367 "/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc",
368 "/usr/share/fonts/opentype/noto/NotoSerifCJK-Regular.ttc"],
369 "fonts-noto-cjk", 2);
377 printf("\n\tsudo apt-get install $install\n");
380 sub give_redhat_hints()
383 "python-sphinx" => "python3-sphinx",
384 "yaml" => "python3-pyyaml",
385 "virtualenv" => "python3-virtualenv",
388 "Pod::Usage" => "perl-Pod-Usage",
389 "xelatex" => "texlive-xetex-bin",
390 "rsvg-convert" => "librsvg2-tools",
394 "graphviz-gd", # Fedora 26: needed for PDF support
398 "texlive-collection-fontsrecommended",
399 "texlive-collection-latex",
400 "texlive-xecjk",
401 "dejavu-sans-fonts",
402 "dejavu-serif-fonts",
403 "dejavu-sans-mono-fonts",
411 my $noto_sans_redhat = "google-noto-sans-cjk-ttc-fonts";
415 $map{"virtualenv"} = "python-virtualenv";
423 printf("\thttps://www.systutorials.com/241660/how-to-install-tex-live-on-centos-7-linux/\n");
430 $noto_sans_redhat = "google-noto-sans-cjk-fonts";
440 check_missing_file(["/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc",
441 "/usr/share/fonts/google-noto-sans-cjk-fonts/NotoSansCJK-Regular.ttc"],
455 printf("\n\tsudo dnf install -y $install\n");
459 printf("\n\tsudo yum install -y $install\n");
463 sub give_opensuse_hints()
466 "python-sphinx" => "python3-sphinx",
467 "yaml" => "python3-pyyaml",
468 "virtualenv" => "python3-virtualenv",
471 "Pod::Usage" => "perl-Pod-Usage",
472 "xelatex" => "texlive-xetex-bin",
475 # On Tumbleweed, this package is also named rsvg-convert
476 $map{"rsvg-convert"} = "rsvg-view" if (!($system_release =~ /Tumbleweed/));
479 "texlive-babel-english",
480 "texlive-caption",
481 "texlive-colortbl",
482 "texlive-courier",
483 "texlive-dvips",
484 "texlive-helvetic",
485 "texlive-makeindex",
486 "texlive-metafont",
487 "texlive-metapost",
488 "texlive-palatino",
489 "texlive-preview",
490 "texlive-times",
491 "texlive-zapfchan",
492 "texlive-zapfding",
495 $map{"latexmk"} = "texlive-latexmk-bin";
508 printf("\n\tsudo zypper install --no-recommends $install\n");
511 sub give_mageia_hints()
514 "python-sphinx" => "python3-sphinx",
515 "yaml" => "python3-yaml",
516 "virtualenv" => "python3-virtualenv",
519 "Pod::Usage" => "perl-Pod-Usage",
521 "rsvg-convert" => "librsvg2",
525 "texlive-fontsextra",
528 $map{"latexmk"} = "texlive-collection-basic";
534 $noto_sans = "noto-sans-cjk-fonts";
535 @tex_pkgs = ( "texlive-collection-fontsextra" );
538 $noto_sans = "google-noto-sans-cjk-ttc-fonts";
543 check_missing_file(["/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc",
544 "/usr/share/fonts/TTF/NotoSans-Regular.ttf"],
556 sub give_arch_linux_hints()
559 "yaml" => "python-yaml",
560 "virtualenv" => "python-virtualenv",
563 "xelatex" => "texlive-xetex",
564 "latexmk" => "texlive-core",
565 "rsvg-convert" => "extra/librsvg",
569 "texlive-core",
570 "texlive-latexextra",
571 "ttf-dejavu",
576 check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc"],
577 "noto-fonts-cjk", 2);
584 printf("\n\tsudo pacman -S $install\n");
587 sub give_gentoo_hints()
590 "yaml" => "dev-python/pyyaml",
591 "virtualenv" => "dev-python/virtualenv",
592 "dot" => "media-gfx/graphviz",
593 "convert" => "media-gfx/imagemagick",
594 "xelatex" => "dev-texlive/texlive-xetex media-fonts/dejavu",
595 "rsvg-convert" => "gnome-base/librsvg",
599 "media-fonts/dejavu", 2) if ($pdf);
602 check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJKsc-Regular.otf",
603 "/usr/share/fonts/noto-cjk/NotoSerifCJK-Regular.ttc"],
604 "media-fonts/noto-cjk", 2);
614 my $imagemagick = "media-gfx/imagemagick svg png";
615 my $cairo = "media-gfx/graphviz cairo pdf";
620 printf("\tsudo su -c 'echo \"$imagemagick\" > $portage_imagemagick'\n")
623 printf("\tsudo su -c 'echo \"$cairo\" > $portage_cairo'\n");
626 printf("\tsudo emerge --ask $install\n");
630 sub check_distros()
632 # Distro-specific hints
683 # Fall-back to generic hint code for other distros
687 "sphinx-build" => "sphinx"
700 sub deactivate_help()
706 sub get_virtenv()
718 $sphinx_cmd =~ s/activate/sphinx-build/;
719 next if (! -f $sphinx_cmd);
725 …rtual environment $f is not working.\nPython version upgrade? Remove it with:\n\n\trm -rf $f\n\n");
737 sub recommend_sphinx_upgrade()
741 # Avoid running sphinx-builds from venv if $cur_version is good
747 # Get the highest version from sphinx_*/bin/sphinx-build and the
779 # - minimal supported version;
780 # - minimal PDF version;
781 # - recommended version.
783 sub recommend_sphinx_version($)
793 # sphinx-build is present and its version is >= $min_version
866 printf "\tpip install -r $requirement_file\n";
879 add_package("python-sphinx", 0);
886 printf "\n Please note that Sphinx >= 3.0 will currently produce false-positive\n";
889 printf "\thttps://github.com/sphinx-doc/sphinx/pull/8313\n";
892 sub check_needs()
911 my $tmp = qx($python_cmd --version 2>&1);
925 add_package("python-sphinx", 0);
936 $virtualenv_cmd = findprog("virtualenv-3");
937 $virtualenv_cmd = findprog("virtualenv-3.5") if (!$virtualenv_cmd);
943 $virtualenv_cmd = "$python_cmd -m venv";
956 # Extra PDF files - should use 2 for is_optional
958 check_program("rsvg-convert", 2) if ($pdf);
961 # Do distro-specific checks and output distro-install commands
972 # Check if sphinx-build is called sphinx-build-3
974 printf "\tsudo ln -sf %s /usr/bin/sphinx-build\n\n",
975 which("sphinx-build-3");
999 if ($arg eq "--no-virtualenv") {
1001 } elsif ($arg eq "--no-pdf"){
1003 } elsif ($arg eq "--version-check"){
1006 print "Usage:\n\t$0 <--no-virtualenv> <--no-pdf> <--version-check>\n\n";
1008 print "\t--no-virtualenv\t- Recommend installing Sphinx instead of using a virtualenv\n";
1009 print "\t--version-check\t- if version is compatible, don't check for missing dependencies\n";
1010 print "\t--no-pdf\t- don't check for dependencies required to build PDF docs\n\n";
1011 exit -1;
1016 # Determine the system type. There's no standard unique way that would
1025 $system_release = qx(lsb_release -d) if which("lsb_release");
1027 $system_release = catcheck("/etc/system-release") if !$system_release;
1028 $system_release = catcheck("/etc/redhat-release") if !$system_release;
1029 $system_release = catcheck("/etc/lsb-release") if !$system_release;
1030 $system_release = catcheck("/etc/gentoo-release") if !$system_release;
1035 if (open IN, "cat /etc/os-release|") {