Luke Granger-Brown
57725ef3ec
git-subtree-dir: third_party/nixpkgs git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
103 lines
2.9 KiB
Diff
103 lines
2.9 KiB
Diff
diff --git a/tools/install.pl b/tools/install.pl
|
|
index f09218f..a63de58 100644
|
|
--- a/tools/install.pl
|
|
+++ b/tools/install.pl
|
|
@@ -9,6 +9,7 @@ use Config;
|
|
|
|
use feature qw(say);
|
|
use File::Path qw(make_path);
|
|
+use File::Copy qw(copy);
|
|
|
|
#Vendor dependencies
|
|
my @vendor_css = (
|
|
@@ -90,32 +91,6 @@ if ( $ENV{HOMEBREW_FORMULA_PREFIX} ) {
|
|
$cpanopt = " -l " . $ENV{HOMEBREW_FORMULA_PREFIX} . "/libexec";
|
|
}
|
|
|
|
-#Load IPC::Cmd
|
|
-install_package( "IPC::Cmd", $cpanopt );
|
|
-install_package( "Config::AutoConf", $cpanopt );
|
|
-IPC::Cmd->import('can_run');
|
|
-require Config::AutoConf;
|
|
-
|
|
-say("\r\nWill now check if all LRR software dependencies are met. \r\n");
|
|
-
|
|
-#Check for Redis
|
|
-say("Checking for Redis...");
|
|
-can_run('redis-server')
|
|
- or die 'NOT FOUND! Please install a Redis server before proceeding.';
|
|
-say("OK!");
|
|
-
|
|
-#Check for GhostScript
|
|
-say("Checking for GhostScript...");
|
|
-can_run('gs')
|
|
- or warn 'NOT FOUND! PDF support will not work properly. Please install the "gs" tool.';
|
|
-say("OK!");
|
|
-
|
|
-#Check for libarchive
|
|
-say("Checking for libarchive...");
|
|
-Config::AutoConf->new()->check_header("archive.h")
|
|
- or die 'NOT FOUND! Please install libarchive and ensure its headers are present.';
|
|
-say("OK!");
|
|
-
|
|
#Check for PerlMagick
|
|
say("Checking for ImageMagick/PerlMagick...");
|
|
my $imgk;
|
|
@@ -135,37 +110,11 @@ if ($@) {
|
|
say("OK!");
|
|
}
|
|
|
|
-#Build & Install CPAN Dependencies
|
|
-if ( $back || $full ) {
|
|
- say("\r\nInstalling Perl modules... This might take a while.\r\n");
|
|
-
|
|
- if ( $Config{"osname"} ne "darwin" ) {
|
|
- say("Installing Linux::Inotify2 for non-macOS systems... (This will do nothing if the package is there already)");
|
|
-
|
|
- install_package( "Linux::Inotify2", $cpanopt );
|
|
- }
|
|
-
|
|
- if ( system( "cpanm --installdeps ./tools/. --notest" . $cpanopt ) != 0 ) {
|
|
- die "Something went wrong while installing Perl modules - Bailing out.";
|
|
- }
|
|
-}
|
|
-
|
|
#Clientside Dependencies with Provisioning
|
|
if ( $front || $full ) {
|
|
|
|
- say("\r\nObtaining remote Web dependencies...\r\n");
|
|
-
|
|
- my $npmcmd = $legacy ? "npm install" : "npm ci";
|
|
- if ( system($npmcmd) != 0 ) {
|
|
- die "Something went wrong while obtaining node modules - Bailing out.";
|
|
- }
|
|
-
|
|
say("\r\nProvisioning...\r\n");
|
|
|
|
- #Load File::Copy
|
|
- install_package( "File::Copy", $cpanopt );
|
|
- File::Copy->import("copy");
|
|
-
|
|
make_path getcwd . "/public/css/vendor";
|
|
make_path getcwd . "/public/css/webfonts";
|
|
make_path getcwd . "/public/js/vendor";
|
|
@@ -212,19 +161,3 @@ sub cp_node_module {
|
|
|
|
}
|
|
|
|
-sub install_package {
|
|
-
|
|
- my $package = $_[0];
|
|
- my $cpanopt = $_[1];
|
|
-
|
|
- ## no critic
|
|
- eval "require $package"; #Run-time evals are needed here to check if the package has been properly installed.
|
|
- ## use critic
|
|
-
|
|
- if ($@) {
|
|
- say("$package not installed! Trying to install now using cpanm$cpanopt");
|
|
- system("cpanm $package $cpanopt");
|
|
- } else {
|
|
- say("$package package installed, proceeding...");
|
|
- }
|
|
-}
|