btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / la / lanraragi / install.patch
blob42138483389a7992a1c8348aa8ea51d60cb58a5c
1 diff --git a/tools/install.pl b/tools/install.pl
2 index f09218f..a63de58 100644
3 --- a/tools/install.pl
4 +++ b/tools/install.pl
5 @@ -9,6 +9,7 @@ use Config;
7 use feature qw(say);
8 use File::Path qw(make_path);
9 +use File::Copy qw(copy);
11 #Vendor dependencies
12 my @vendor_css = (
13 @@ -90,32 +91,6 @@ if ( $ENV{HOMEBREW_FORMULA_PREFIX} ) {
14 $cpanopt = " -l " . $ENV{HOMEBREW_FORMULA_PREFIX} . "/libexec";
17 -#Load IPC::Cmd
18 -install_package( "IPC::Cmd", $cpanopt );
19 -install_package( "Config::AutoConf", $cpanopt );
20 -IPC::Cmd->import('can_run');
21 -require Config::AutoConf;
23 -say("\r\nWill now check if all LRR software dependencies are met. \r\n");
25 -#Check for Redis
26 -say("Checking for Redis...");
27 -can_run('redis-server')
28 - or die 'NOT FOUND! Please install a Redis server before proceeding.';
29 -say("OK!");
31 -#Check for GhostScript
32 -say("Checking for GhostScript...");
33 -can_run('gs')
34 - or warn 'NOT FOUND! PDF support will not work properly. Please install the "gs" tool.';
35 -say("OK!");
37 -#Check for libarchive
38 -say("Checking for libarchive...");
39 -Config::AutoConf->new()->check_header("archive.h")
40 - or die 'NOT FOUND! Please install libarchive and ensure its headers are present.';
41 -say("OK!");
43 #Check for PerlMagick
44 say("Checking for ImageMagick/PerlMagick...");
45 my $imgk;
46 @@ -135,37 +110,11 @@ if ($@) {
47 say("OK!");
50 -#Build & Install CPAN Dependencies
51 -if ( $back || $full ) {
52 - say("\r\nInstalling Perl modules... This might take a while.\r\n");
54 - if ( $Config{"osname"} ne "darwin" ) {
55 - say("Installing Linux::Inotify2 for non-macOS systems... (This will do nothing if the package is there already)");
57 - install_package( "Linux::Inotify2", $cpanopt );
58 - }
60 - if ( system( "cpanm --installdeps ./tools/. --notest" . $cpanopt ) != 0 ) {
61 - die "Something went wrong while installing Perl modules - Bailing out.";
62 - }
65 #Clientside Dependencies with Provisioning
66 if ( $front || $full ) {
68 - say("\r\nObtaining remote Web dependencies...\r\n");
70 - my $npmcmd = $legacy ? "npm install" : "npm ci";
71 - if ( system($npmcmd) != 0 ) {
72 - die "Something went wrong while obtaining node modules - Bailing out.";
73 - }
75 say("\r\nProvisioning...\r\n");
77 - #Load File::Copy
78 - install_package( "File::Copy", $cpanopt );
79 - File::Copy->import("copy");
81 make_path getcwd . "/public/css/vendor";
82 make_path getcwd . "/public/css/webfonts";
83 make_path getcwd . "/public/js/vendor";
84 @@ -212,19 +161,3 @@ sub cp_node_module {
88 -sub install_package {
90 - my $package = $_[0];
91 - my $cpanopt = $_[1];
93 - ## no critic
94 - eval "require $package"; #Run-time evals are needed here to check if the package has been properly installed.
95 - ## use critic
97 - if ($@) {
98 - say("$package not installed! Trying to install now using cpanm$cpanopt");
99 - system("cpanm $package $cpanopt");
100 - } else {
101 - say("$package package installed, proceeding...");