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',
85 sub check_missing(%)
99 $optional--;
118 sub add_package($$)
131 sub check_missing_file($$$)
138 return if(-e $_);
144 sub findprog($)
147 return "$_/$_[0]" if(-x "$_/$_[0]");
151 sub find_python_no_venv()
160 return "$dir/python3" if(-x "$dir/python3");
164 return "$dir/python" if(-x "$dir/python");
169 sub check_program($$)
179 sub check_perl_module($$)
184 my $err = system("perl -M$prog -e 1 2>/dev/null /dev/null");
190 sub check_python_module($$)
197 my $err = system("$python_cmd -c 'import $prog' 2>/dev/null /dev/null");
203 sub check_rpm_missing($$)
209 my $err = system("rpm -q '$prog' 2>/dev/null >/dev/null");
214 sub check_pacman_missing($$)
220 my $err = system("pacman -Q '$prog' 2>/dev/null >/dev/null");
225 sub check_missing_tex($)
241 sub get_sphinx_fname()
243 my $fname = "sphinx-build";
246 $fname = "sphinx-build-3";
255 sub get_sphinx_version($)
260 open IN, "$cmd --version 2>&1 |";
262 if (m/^\s*sphinx-build\s+([\d\.]+)(\+\/[\da-f]+)?$/) {
276 sub check_sphinx()
335 sub catcheck($)
338 $res = qx(cat $_[0]) if (-r $_[0]);
342 sub which($)
349 return $name if (-x $name );
355 # Subroutines that check distro-specific hints
358 sub give_debian_hints()
361 "python-sphinx" => "python3-sphinx",
362 "sphinx_rtd_theme" => "python3-sphinx-rtd-theme",
363 "ensurepip" => "python3-venv",
367 "Pod::Usage" => "perl-modules",
368 "xelatex" => "texlive-xetex",
369 "rsvg-convert" => "librsvg2-bin",
374 "fonts-dejavu", 2);
376 check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc",
377 "/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc",
378 "/usr/share/fonts/opentype/noto/NotoSerifCJK-Regular.ttc"],
379 "fonts-noto-cjk", 2);
386 printf("You should run:\n\n\tsudo apt-get install $install\n");
389 sub give_redhat_hints()
392 "python-sphinx" => "python3-sphinx",
393 "sphinx_rtd_theme" => "python3-sphinx_rtd_theme",
394 "virtualenv" => "python3-virtualenv",
397 "Pod::Usage" => "perl-Pod-Usage",
398 "xelatex" => "texlive-xetex-bin",
399 "rsvg-convert" => "librsvg2-tools",
403 "graphviz-gd", # Fedora 26: needed for PDF support
407 "texlive-collection-fontsrecommended",
408 "texlive-collection-latex",
409 "texlive-xecjk",
410 "dejavu-sans-fonts",
411 "dejavu-serif-fonts",
412 "dejavu-sans-mono-fonts",
423 $map{"virtualenv"} = "python-virtualenv";
431 printf("\thttps://www.systutorials.com/241660/how-to-install-tex-live-on-centos-7-linux/\n");
445 check_missing_file(["/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc"],
446 "google-noto-sans-cjk-ttc-fonts", 2);
458 printf("You should run:\n\n\tsudo dnf install -y $install\n");
461 printf("You should run:\n\n\tsudo yum install -y $install\n");
465 sub give_opensuse_hints()
468 "python-sphinx" => "python3-sphinx",
469 "sphinx_rtd_theme" => "python3-sphinx_rtd_theme",
470 "virtualenv" => "python3-virtualenv",
473 "Pod::Usage" => "perl-Pod-Usage",
474 "xelatex" => "texlive-xetex-bin",
477 # On Tumbleweed, this package is also named rsvg-convert
478 $map{"rsvg-convert"} = "rsvg-view" if (!($system_release =~ /Tumbleweed/));
481 "texlive-babel-english",
482 "texlive-caption",
483 "texlive-colortbl",
484 "texlive-courier",
485 "texlive-dvips",
486 "texlive-helvetic",
487 "texlive-makeindex",
488 "texlive-metafont",
489 "texlive-metapost",
490 "texlive-palatino",
491 "texlive-preview",
492 "texlive-times",
493 "texlive-zapfchan",
494 "texlive-zapfding",
497 $map{"latexmk"} = "texlive-latexmk-bin";
509 printf("You should run:\n\n\tsudo zypper install --no-recommends $install\n");
512 sub give_mageia_hints()
515 "python-sphinx" => "python3-sphinx",
516 "sphinx_rtd_theme" => "python3-sphinx_rtd_theme",
517 "virtualenv" => "python3-virtualenv",
520 "Pod::Usage" => "perl-Pod-Usage",
522 "rsvg-convert" => "librsvg2",
526 "texlive-fontsextra",
529 $map{"latexmk"} = "texlive-collection-basic";
535 $noto_sans = "noto-sans-cjk-fonts";
536 @tex_pkgs = ( "texlive-collection-fontsextra" );
539 $noto_sans = "google-noto-sans-cjk-ttc-fonts";
544 check_missing_file(["/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc",
545 "/usr/share/fonts/TTF/NotoSans-Regular.ttf"],
556 sub give_arch_linux_hints()
559 "sphinx_rtd_theme" => "python-sphinx_rtd_theme",
560 "virtualenv" => "python-virtualenv",
563 "xelatex" => "texlive-bin",
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);
583 printf("You should run:\n\n\tsudo pacman -S $install\n");
586 sub give_gentoo_hints()
589 "sphinx_rtd_theme" => "dev-python/sphinx_rtd_theme",
590 "virtualenv" => "dev-python/virtualenv",
591 "dot" => "media-gfx/graphviz",
592 "convert" => "media-gfx/imagemagick",
593 "xelatex" => "dev-texlive/texlive-xetex media-fonts/dejavu",
594 "rsvg-convert" => "gnome-base/librsvg",
598 "media-fonts/dejavu", 2) if ($pdf);
601 check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJKsc-Regular.otf",
602 "/usr/share/fonts/noto-cjk/NotoSerifCJK-Regular.ttc"],
603 "media-fonts/noto-cjk", 2);
612 my $imagemagick = "media-gfx/imagemagick svg png";
613 my $cairo = "media-gfx/graphviz cairo pdf";
618 printf("\tsudo su -c 'echo \"$imagemagick\" > $portage_imagemagick'\n")
621 printf("\tsudo su -c 'echo \"$cairo\" > $portage_cairo'\n");
624 printf("\tsudo emerge --ask $install\n");
628 sub check_distros()
630 # Distro-specific hints
681 # Fall-back to generic hint code for other distros
685 "sphinx-build" => "sphinx"
698 sub deactivate_help()
704 sub check_needs()
723 my $tmp = qx($python_cmd --version 2>&1);
738 add_package("python-sphinx", 0);
745 $virtualenv_cmd = findprog("virtualenv-3");
746 $virtualenv_cmd = findprog("virtualenv-3.5") if (!$virtualenv_cmd);
761 # Extra PDF files - should use 2 for is_optional
763 check_program("rsvg-convert", 2) if ($pdf);
770 # Do distro-specific checks and output distro-install commands
781 # Check if sphinx-build is called sphinx-build-3
783 printf "\tsudo ln -sf %s /usr/bin/sphinx-build\n\n",
784 which("sphinx-build-3");
787 # NOTE: if the system has a too old Sphinx version installed,
807 $sphinx_cmd =~ s/activate/sphinx-build/;
808 next if (! -f $sphinx_cmd);
837 printf "\t$python_cmd -m venv $virtenv_dir\n";
842 printf "\tpip install -r $requirement_file\n";
868 if ($arg eq "--no-virtualenv") {
870 } elsif ($arg eq "--no-pdf"){
872 } elsif ($arg eq "--version-check"){
875 print "Usage:\n\t$0 <--no-virtualenv> <--no-pdf> <--version-check>\n\n";
877 print "\t--no-virtualenv\t- Recommend installing Sphinx instead of using a virtualenv\n";
878 print "\t--version-check\t- if version is compatible, don't check for missing dependencies\n";
879 print "\t--no-pdf\t- don't check for dependencies required to build PDF docs\n\n";
880 exit -1;
885 # Determine the system type. There's no standard unique way that would
894 $system_release = qx(lsb_release -d) if which("lsb_release");
896 $system_release = catcheck("/etc/system-release") if !$system_release;
897 $system_release = catcheck("/etc/redhat-release") if !$system_release;
898 $system_release = catcheck("/etc/lsb-release") if !$system_release;
899 $system_release = catcheck("/etc/gentoo-release") if !$system_release;
904 if (open IN, "cat /etc/os-release|") {