Lines Matching +full:check +full:- +full:system +full:- +full:opensuse

2 # SPDX-License-Identifier: GPL-2.0-or-later
5 # Copyright (c) 2017-2020 Mauro Carvalho Chehab <mchehab@kernel.org>
48 # List of required texlive packages on Fedora and OpenSuse
52 'amsfonts.sty' => 'texlive-amsfonts',
53 'amsmath.sty' => 'texlive-amsmath',
54 'amssymb.sty' => 'texlive-amsfonts',
55 'amsthm.sty' => 'texlive-amscls',
56 'anyfontsize.sty' => 'texlive-anyfontsize',
57 'atbegshi.sty' => 'texlive-oberdiek',
58 'bm.sty' => 'texlive-tools',
59 'capt-of.sty' => 'texlive-capt-of',
60 'cmap.sty' => 'texlive-cmap',
61 'ecrm1000.tfm' => 'texlive-ec',
62 'eqparbox.sty' => 'texlive-eqparbox',
63 'eu1enc.def' => 'texlive-euenc',
64 'fancybox.sty' => 'texlive-fancybox',
65 'fancyvrb.sty' => 'texlive-fancyvrb',
66 'float.sty' => 'texlive-float',
67 'fncychap.sty' => 'texlive-fncychap',
68 'footnote.sty' => 'texlive-mdwtools',
69 'framed.sty' => 'texlive-framed',
70 'luatex85.sty' => 'texlive-luatex85',
71 'multirow.sty' => 'texlive-multirow',
72 'needspace.sty' => 'texlive-needspace',
73 'palatino.sty' => 'texlive-psnfss',
74 'parskip.sty' => 'texlive-parskip',
75 'polyglossia.sty' => 'texlive-polyglossia',
76 'tabulary.sty' => 'texlive-tabulary',
77 'threeparttable.sty' => 'texlive-threeparttable',
78 'titlesec.sty' => 'texlive-titlesec',
79 'ucs.sty' => 'texlive-ucs',
80 'upquote.sty' => 'texlive-upquote',
81 'wrapfig.sty' => 'texlive-wrapfig',
82 'ctexhook.sty' => 'texlive-ctex',
103 $optional--;
144 return if(-e $_);
153 return "$_/$_[0]" if(-x "$_/$_[0]");
166 return "$dir/python3" if(-x "$dir/python3");
170 return "$dir/python" if(-x "$dir/python");
190 my $err = system("perl -M$prog -e 1 2>/dev/null /dev/null");
203 my $err = system("$python_cmd -c 'import $prog' 2>/dev/null /dev/null");
215 my $err = system("rpm -q '$prog' 2>/dev/null >/dev/null");
226 my $err = system("pacman -Q '$prog' 2>/dev/null >/dev/null");
249 my $fname = "sphinx-build";
252 $fname = "sphinx-build-3";
266 open IN, "$cmd --version 2>&1 |";
268 if (m/^\s*sphinx-build\s+([\d\.]+)((\+\/[\da-f]+)|(b\d+))?$/) {
330 # On version check mode, just assume Sphinx has all mandatory deps
341 $res = qx(cat $_[0]) if (-r $_[0]);
352 return $name if (-x $name );
358 # Subroutines that check distro-specific hints
364 "python-sphinx" => "python3-sphinx",
365 "ensurepip" => "python3-venv",
369 "Pod::Usage" => "perl-modules",
370 "xelatex" => "texlive-xetex",
371 "rsvg-convert" => "librsvg2-bin",
375 check_missing_file(["/usr/share/texlive/texmf-dist/tex/latex/ctex/ctexhook.sty"],
376 "texlive-lang-chinese", 2);
379 "fonts-dejavu", 2);
381 check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc",
382 "/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc",
383 "/usr/share/fonts/opentype/noto/NotoSerifCJK-Regular.ttc"],
384 "fonts-noto-cjk", 2);
392 printf("\n\tsudo apt-get install $install\n");
398 "python-sphinx" => "python3-sphinx",
399 "virtualenv" => "python3-virtualenv",
402 "Pod::Usage" => "perl-Pod-Usage",
403 "xelatex" => "texlive-xetex-bin",
404 "rsvg-convert" => "librsvg2-tools",
408 "graphviz-gd", # Fedora 26: needed for PDF support
412 "texlive-collection-fontsrecommended",
413 "texlive-collection-latex",
414 "texlive-xecjk",
415 "dejavu-sans-fonts",
416 "dejavu-serif-fonts",
417 "dejavu-sans-mono-fonts",
428 $map{"virtualenv"} = "python-virtualenv";
436 printf("\thttps://www.systutorials.com/241660/how-to-install-tex-live-on-centos-7-linux/\n");
450 check_missing_file(["/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc"],
451 "google-noto-sans-cjk-ttc-fonts", 2);
464 printf("\n\tsudo dnf install -y $install\n");
468 printf("\n\tsudo yum install -y $install\n");
475 "python-sphinx" => "python3-sphinx",
476 "virtualenv" => "python3-virtualenv",
479 "Pod::Usage" => "perl-Pod-Usage",
480 "xelatex" => "texlive-xetex-bin",
483 # On Tumbleweed, this package is also named rsvg-convert
484 $map{"rsvg-convert"} = "rsvg-view" if (!($system_release =~ /Tumbleweed/));
487 "texlive-babel-english",
488 "texlive-caption",
489 "texlive-colortbl",
490 "texlive-courier",
491 "texlive-dvips",
492 "texlive-helvetic",
493 "texlive-makeindex",
494 "texlive-metafont",
495 "texlive-metapost",
496 "texlive-palatino",
497 "texlive-preview",
498 "texlive-times",
499 "texlive-zapfchan",
500 "texlive-zapfding",
503 $map{"latexmk"} = "texlive-latexmk-bin";
508 # "Noto Sans CJK SC" on openSUSE
516 printf("\n\tsudo zypper install --no-recommends $install\n");
522 "python-sphinx" => "python3-sphinx",
523 "virtualenv" => "python3-virtualenv",
526 "Pod::Usage" => "perl-Pod-Usage",
528 "rsvg-convert" => "librsvg2",
532 "texlive-fontsextra",
535 $map{"latexmk"} = "texlive-collection-basic";
541 $noto_sans = "noto-sans-cjk-fonts";
542 @tex_pkgs = ( "texlive-collection-fontsextra" );
545 $noto_sans = "google-noto-sans-cjk-ttc-fonts";
550 check_missing_file(["/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc",
551 "/usr/share/fonts/TTF/NotoSans-Regular.ttf"],
566 "virtualenv" => "python-virtualenv",
569 "xelatex" => "texlive-bin",
570 "latexmk" => "texlive-core",
571 "rsvg-convert" => "extra/librsvg",
575 "texlive-core",
576 "texlive-latexextra",
577 "ttf-dejavu",
582 check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc"],
583 "noto-fonts-cjk", 2);
590 printf("\n\tsudo pacman -S $install\n");
596 "virtualenv" => "dev-python/virtualenv",
597 "dot" => "media-gfx/graphviz",
598 "convert" => "media-gfx/imagemagick",
599 "xelatex" => "dev-texlive/texlive-xetex media-fonts/dejavu",
600 "rsvg-convert" => "gnome-base/librsvg",
604 "media-fonts/dejavu", 2) if ($pdf);
607 check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJKsc-Regular.otf",
608 "/usr/share/fonts/noto-cjk/NotoSerifCJK-Regular.ttc"],
609 "media-fonts/noto-cjk", 2);
619 my $imagemagick = "media-gfx/imagemagick svg png";
620 my $cairo = "media-gfx/graphviz cairo pdf";
625 printf("\tsudo su -c 'echo \"$imagemagick\" > $portage_imagemagick'\n")
628 printf("\tsudo su -c 'echo \"$cairo\" > $portage_cairo'\n");
631 printf("\tsudo emerge --ask $install\n");
637 # Distro-specific hints
666 if ($system_release =~ /openSUSE/) {
688 # Fall-back to generic hint code for other distros
692 "sphinx-build" => "sphinx"
723 $sphinx_cmd =~ s/activate/sphinx-build/;
724 next if (! -f $sphinx_cmd);
730 …rtual environment $f is not working.\nPython version upgrade? Remove it with:\n\n\trm -rf $f\n\n");
746 # Avoid running sphinx-builds from venv if $cur_version is good
752 # Get the highest version from sphinx_*/bin/sphinx-build and the
764 # virtual environments, don't check if upgrades are needed
784 # - minimal supported version;
785 # - minimal PDF version;
786 # - recommended version.
801 # sphinx-build is present and its version is >= $min_version
878 printf "\tpip install -r $requirement_file\n";
891 add_package("python-sphinx", 0);
898 printf "\n Please note that Sphinx >= 3.0 will currently produce false-positive\n";
901 printf "\thttps://github.com/sphinx-doc/sphinx/pull/8313\n";
906 # Check if Sphinx is already accessible from current environment
916 # Check python command line, trying first python3
920 # Check the type of virtual env, depending on Python version
923 my $tmp = qx($python_cmd --version 2>&1);
937 add_package("python-sphinx", 0);
948 $virtualenv_cmd = findprog("virtualenv-3");
949 $virtualenv_cmd = findprog("virtualenv-3.5") if (!$virtualenv_cmd);
955 $virtualenv_cmd = "$python_cmd -m venv";
960 # Check for needed programs/tools
967 # Extra PDF files - should use 2 for is_optional
969 check_program("rsvg-convert", 2) if ($pdf);
972 # Do distro-specific checks and output distro-install commands
983 # Check if sphinx-build is called sphinx-build-3
985 printf "\tsudo ln -sf %s /usr/bin/sphinx-build\n\n",
986 which("sphinx-build-3");
1010 if ($arg eq "--no-virtualenv") {
1012 } elsif ($arg eq "--no-pdf"){
1014 } elsif ($arg eq "--version-check"){
1017 print "Usage:\n\t$0 <--no-virtualenv> <--no-pdf> <--version-check>\n\n";
1019 print "\t--no-virtualenv\t- Recommend installing Sphinx instead of using a virtualenv\n";
1020 print "\t--version-check\t- if version is compatible, don't check for missing dependencies\n";
1021 print "\t--no-pdf\t- don't check for dependencies required to build PDF docs\n\n";
1022 exit -1;
1027 # Determine the system type. There's no standard unique way that would
1036 $system_release = qx(lsb_release -d) if which("lsb_release");
1038 $system_release = catcheck("/etc/system-release") if !$system_release;
1039 $system_release = catcheck("/etc/redhat-release") if !$system_release;
1040 $system_release = catcheck("/etc/lsb-release") if !$system_release;
1041 $system_release = catcheck("/etc/gentoo-release") if !$system_release;
1046 if (open IN, "cat /etc/os-release|") {