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>
49 'amsfonts.sty' => 'texlive-amsfonts',
50 'amsmath.sty' => 'texlive-amsmath',
51 'amssymb.sty' => 'texlive-amsfonts',
52 'amsthm.sty' => 'texlive-amscls',
53 'anyfontsize.sty' => 'texlive-anyfontsize',
54 'atbegshi.sty' => 'texlive-oberdiek',
55 'bm.sty' => 'texlive-tools',
56 'capt-of.sty' => 'texlive-capt-of',
57 'cmap.sty' => 'texlive-cmap',
58 'ecrm1000.tfm' => 'texlive-ec',
59 'eqparbox.sty' => 'texlive-eqparbox',
60 'eu1enc.def' => 'texlive-euenc',
61 'fancybox.sty' => 'texlive-fancybox',
62 'fancyvrb.sty' => 'texlive-fancyvrb',
63 'float.sty' => 'texlive-float',
64 'fncychap.sty' => 'texlive-fncychap',
65 'footnote.sty' => 'texlive-mdwtools',
66 'framed.sty' => 'texlive-framed',
67 'luatex85.sty' => 'texlive-luatex85',
68 'multirow.sty' => 'texlive-multirow',
69 'needspace.sty' => 'texlive-needspace',
70 'palatino.sty' => 'texlive-psnfss',
71 'parskip.sty' => 'texlive-parskip',
72 'polyglossia.sty' => 'texlive-polyglossia',
73 'tabulary.sty' => 'texlive-tabulary',
74 'threeparttable.sty' => 'texlive-threeparttable',
75 'titlesec.sty' => 'texlive-titlesec',
76 'ucs.sty' => 'texlive-ucs',
77 'upquote.sty' => 'texlive-upquote',
78 'wrapfig.sty' => 'texlive-wrapfig',
79 'ctexhook.sty' => 'texlive-ctex',
86 sub check_missing(%)
100 $optional--;
119 sub add_package($$)
132 sub check_missing_file($$$)
139 return if(-e $_);
145 sub findprog($)
148 return "$_/$_[0]" if(-x "$_/$_[0]");
152 sub find_python_no_venv()
161 return "$dir/python3" if(-x "$dir/python3");
165 return "$dir/python" if(-x "$dir/python");
170 sub check_program($$)
180 sub check_perl_module($$)
185 my $err = system("perl -M$prog -e 1 2>/dev/null /dev/null");
191 sub check_python_module($$)
198 my $err = system("$python_cmd -c 'import $prog' 2>/dev/null /dev/null");
204 sub check_rpm_missing($$)
210 my $err = system("rpm -q '$prog' 2>/dev/null >/dev/null");
215 sub check_pacman_missing($$)
221 my $err = system("pacman -Q '$prog' 2>/dev/null >/dev/null");
226 sub check_missing_tex($)
242 sub get_sphinx_fname()
244 my $fname = "sphinx-build";
247 $fname = "sphinx-build-3";
256 sub get_sphinx_version($)
261 open IN, "$cmd --version 2>&1 |";
263 if (m/^\s*sphinx-build\s+([\d\.]+)(\+\/[\da-f]+)?$/) {
277 sub check_sphinx()
336 sub catcheck($)
339 $res = qx(cat $_[0]) if (-r $_[0]);
343 sub which($)
350 return $name if (-x $name );
356 # Subroutines that check distro-specific hints
359 sub give_debian_hints()
362 "python-sphinx" => "python3-sphinx",
363 "sphinx_rtd_theme" => "python3-sphinx-rtd-theme",
364 "ensurepip" => "python3-venv",
368 "Pod::Usage" => "perl-modules",
369 "xelatex" => "texlive-xetex",
370 "rsvg-convert" => "librsvg2-bin",
374 check_missing_file(["/usr/share/texlive/texmf-dist/tex/latex/ctex/ctexhook.sty"],
375 "texlive-lang-chinese", 2);
378 "fonts-dejavu", 2);
380 check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc",
381 "/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc",
382 "/usr/share/fonts/opentype/noto/NotoSerifCJK-Regular.ttc"],
383 "fonts-noto-cjk", 2);
390 printf("You should run:\n\n\tsudo apt-get install $install\n");
393 sub give_redhat_hints()
396 "python-sphinx" => "python3-sphinx",
397 "sphinx_rtd_theme" => "python3-sphinx_rtd_theme",
398 "virtualenv" => "python3-virtualenv",
401 "Pod::Usage" => "perl-Pod-Usage",
402 "xelatex" => "texlive-xetex-bin",
403 "rsvg-convert" => "librsvg2-tools",
407 "graphviz-gd", # Fedora 26: needed for PDF support
411 "texlive-collection-fontsrecommended",
412 "texlive-collection-latex",
413 "texlive-xecjk",
414 "dejavu-sans-fonts",
415 "dejavu-serif-fonts",
416 "dejavu-sans-mono-fonts",
427 $map{"virtualenv"} = "python-virtualenv";
435 printf("\thttps://www.systutorials.com/241660/how-to-install-tex-live-on-centos-7-linux/\n");
449 check_missing_file(["/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc"],
450 "google-noto-sans-cjk-ttc-fonts", 2);
462 printf("You should run:\n\n\tsudo dnf install -y $install\n");
465 printf("You should run:\n\n\tsudo yum install -y $install\n");
469 sub give_opensuse_hints()
472 "python-sphinx" => "python3-sphinx",
473 "sphinx_rtd_theme" => "python3-sphinx_rtd_theme",
474 "virtualenv" => "python3-virtualenv",
477 "Pod::Usage" => "perl-Pod-Usage",
478 "xelatex" => "texlive-xetex-bin",
481 # On Tumbleweed, this package is also named rsvg-convert
482 $map{"rsvg-convert"} = "rsvg-view" if (!($system_release =~ /Tumbleweed/));
485 "texlive-babel-english",
486 "texlive-caption",
487 "texlive-colortbl",
488 "texlive-courier",
489 "texlive-dvips",
490 "texlive-helvetic",
491 "texlive-makeindex",
492 "texlive-metafont",
493 "texlive-metapost",
494 "texlive-palatino",
495 "texlive-preview",
496 "texlive-times",
497 "texlive-zapfchan",
498 "texlive-zapfding",
501 $map{"latexmk"} = "texlive-latexmk-bin";
513 printf("You should run:\n\n\tsudo zypper install --no-recommends $install\n");
516 sub give_mageia_hints()
519 "python-sphinx" => "python3-sphinx",
520 "sphinx_rtd_theme" => "python3-sphinx_rtd_theme",
521 "virtualenv" => "python3-virtualenv",
524 "Pod::Usage" => "perl-Pod-Usage",
526 "rsvg-convert" => "librsvg2",
530 "texlive-fontsextra",
533 $map{"latexmk"} = "texlive-collection-basic";
539 $noto_sans = "noto-sans-cjk-fonts";
540 @tex_pkgs = ( "texlive-collection-fontsextra" );
543 $noto_sans = "google-noto-sans-cjk-ttc-fonts";
548 check_missing_file(["/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc",
549 "/usr/share/fonts/TTF/NotoSans-Regular.ttf"],
560 sub give_arch_linux_hints()
563 "sphinx_rtd_theme" => "python-sphinx_rtd_theme",
564 "virtualenv" => "python-virtualenv",
567 "xelatex" => "texlive-bin",
568 "latexmk" => "texlive-core",
569 "rsvg-convert" => "extra/librsvg",
573 "texlive-core",
574 "texlive-latexextra",
575 "ttf-dejavu",
580 check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc"],
581 "noto-fonts-cjk", 2);
587 printf("You should run:\n\n\tsudo pacman -S $install\n");
590 sub give_gentoo_hints()
593 "sphinx_rtd_theme" => "dev-python/sphinx_rtd_theme",
594 "virtualenv" => "dev-python/virtualenv",
595 "dot" => "media-gfx/graphviz",
596 "convert" => "media-gfx/imagemagick",
597 "xelatex" => "dev-texlive/texlive-xetex media-fonts/dejavu",
598 "rsvg-convert" => "gnome-base/librsvg",
602 "media-fonts/dejavu", 2) if ($pdf);
605 check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJKsc-Regular.otf",
606 "/usr/share/fonts/noto-cjk/NotoSerifCJK-Regular.ttc"],
607 "media-fonts/noto-cjk", 2);
616 my $imagemagick = "media-gfx/imagemagick svg png";
617 my $cairo = "media-gfx/graphviz cairo pdf";
622 printf("\tsudo su -c 'echo \"$imagemagick\" > $portage_imagemagick'\n")
625 printf("\tsudo su -c 'echo \"$cairo\" > $portage_cairo'\n");
628 printf("\tsudo emerge --ask $install\n");
632 sub check_distros()
634 # Distro-specific hints
685 # Fall-back to generic hint code for other distros
689 "sphinx-build" => "sphinx"
702 sub deactivate_help()
708 sub check_needs()
727 my $tmp = qx($python_cmd --version 2>&1);
742 add_package("python-sphinx", 0);
749 $virtualenv_cmd = findprog("virtualenv-3");
750 $virtualenv_cmd = findprog("virtualenv-3.5") if (!$virtualenv_cmd);
765 # Extra PDF files - should use 2 for is_optional
767 check_program("rsvg-convert", 2) if ($pdf);
774 # Do distro-specific checks and output distro-install commands
785 # Check if sphinx-build is called sphinx-build-3
787 printf "\tsudo ln -sf %s /usr/bin/sphinx-build\n\n",
788 which("sphinx-build-3");
791 # NOTE: if the system has a too old Sphinx version installed,
811 $sphinx_cmd =~ s/activate/sphinx-build/;
812 next if (! -f $sphinx_cmd);
841 printf "\t$python_cmd -m venv $virtenv_dir\n";
846 printf "\tpip install -r $requirement_file\n";
872 if ($arg eq "--no-virtualenv") {
874 } elsif ($arg eq "--no-pdf"){
876 } elsif ($arg eq "--version-check"){
879 print "Usage:\n\t$0 <--no-virtualenv> <--no-pdf> <--version-check>\n\n";
881 print "\t--no-virtualenv\t- Recommend installing Sphinx instead of using a virtualenv\n";
882 print "\t--version-check\t- if version is compatible, don't check for missing dependencies\n";
883 print "\t--no-pdf\t- don't check for dependencies required to build PDF docs\n\n";
884 exit -1;
889 # Determine the system type. There's no standard unique way that would
898 $system_release = qx(lsb_release -d) if which("lsb_release");
900 $system_release = catcheck("/etc/system-release") if !$system_release;
901 $system_release = catcheck("/etc/redhat-release") if !$system_release;
902 $system_release = catcheck("/etc/lsb-release") if !$system_release;
903 $system_release = catcheck("/etc/gentoo-release") if !$system_release;
908 if (open IN, "cat /etc/os-release|") {