nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 103 lines 3.0 kB view raw
1diff --git a/tools/install.pl b/tools/install.pl 2index f09218f..a63de58 100644 3--- a/tools/install.pl 4+++ b/tools/install.pl 5@@ -9,6 +9,7 @@ use Config; 6 7 use feature qw(say); 8 use File::Path qw(make_path); 9+use File::Copy qw(copy); 10 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"; 15 } 16 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; 22- 23-say("\r\nWill now check if all LRR software dependencies are met. \r\n"); 24- 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!"); 30- 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!"); 36- 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!"); 42- 43 #Check for PerlMagick 44 say("Checking for ImageMagick/PerlMagick..."); 45 my $imgk; 46@@ -135,37 +110,11 @@ if ($@) { 47 say("OK!"); 48 } 49 50-#Build & Install CPAN Dependencies 51-if ( $back || $full ) { 52- say("\r\nInstalling Perl modules... This might take a while.\r\n"); 53- 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)"); 56- 57- install_package( "Linux::Inotify2", $cpanopt ); 58- } 59- 60- if ( system( "cpanm --installdeps ./tools/. --notest" . $cpanopt ) != 0 ) { 61- die "Something went wrong while installing Perl modules - Bailing out."; 62- } 63-} 64- 65 #Clientside Dependencies with Provisioning 66 if ( $front || $full ) { 67 68- say("\r\nObtaining remote Web dependencies...\r\n"); 69- 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- } 74- 75 say("\r\nProvisioning...\r\n"); 76 77- #Load File::Copy 78- install_package( "File::Copy", $cpanopt ); 79- File::Copy->import("copy"); 80- 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 { 85 86 } 87 88-sub install_package { 89- 90- my $package = $_[0]; 91- my $cpanopt = $_[1]; 92- 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 96- 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..."); 102- } 103-}