Merge pull request #255715 from TomaSajt/lanraragi

lanraragi: init at 0.8.90

authored by Stig and committed by GitHub a99cbd99 425cac96

+893
+1
nixos/modules/module-list.nix
··· 1270 1270 ./services/web-apps/kavita.nix 1271 1271 ./services/web-apps/keycloak.nix 1272 1272 ./services/web-apps/komga.nix 1273 + ./services/web-apps/lanraragi.nix 1273 1274 ./services/web-apps/lemmy.nix 1274 1275 ./services/web-apps/limesurvey.nix 1275 1276 ./services/web-apps/mainsail.nix
+100
nixos/modules/services/web-apps/lanraragi.nix
··· 1 + { pkgs, lib, config, ... }: 2 + 3 + let 4 + cfg = config.services.lanraragi; 5 + in 6 + { 7 + meta.maintainers = with lib.maintainers; [ tomasajt ]; 8 + 9 + options.services = { 10 + lanraragi = { 11 + enable = lib.mkEnableOption (lib.mdDoc "LANraragi"); 12 + package = lib.mkPackageOptionMD pkgs "lanraragi" { }; 13 + 14 + port = lib.mkOption { 15 + type = lib.types.port; 16 + default = 3000; 17 + description = lib.mdDoc "Port for LANraragi's web interface."; 18 + }; 19 + 20 + passwordFile = lib.mkOption { 21 + type = lib.types.nullOr lib.types.path; 22 + default = null; 23 + example = "/run/keys/lanraragi-password"; 24 + description = lib.mdDoc '' 25 + A file containing the password for LANraragi's admin interface. 26 + ''; 27 + }; 28 + 29 + redis = { 30 + port = lib.mkOption { 31 + type = lib.types.port; 32 + default = 6379; 33 + description = lib.mdDoc "Port for LANraragi's Redis server."; 34 + }; 35 + passwordFile = lib.mkOption { 36 + type = lib.types.nullOr lib.types.path; 37 + default = null; 38 + example = "/run/keys/redis-lanraragi-password"; 39 + description = lib.mdDoc '' 40 + A file containing the password for LANraragi's Redis server. 41 + ''; 42 + }; 43 + }; 44 + }; 45 + }; 46 + 47 + config = lib.mkIf cfg.enable { 48 + services.redis.servers.lanraragi = { 49 + enable = true; 50 + port = cfg.redis.port; 51 + requirePassFile = cfg.redis.passwordFile; 52 + }; 53 + 54 + systemd.services.lanraragi = { 55 + description = "LANraragi main service"; 56 + after = [ "network.target" "redis-lanraragi.service" ]; 57 + requires = [ "redis-lanraragi.service" ]; 58 + wantedBy = [ "multi-user.target" ]; 59 + serviceConfig = { 60 + ExecStart = lib.getExe cfg.package; 61 + DynamicUser = true; 62 + StateDirectory = "lanraragi"; 63 + RuntimeDirectory = "lanraragi"; 64 + LogsDirectory = "lanraragi"; 65 + Restart = "on-failure"; 66 + WorkingDirectory = "/var/lib/lanraragi"; 67 + }; 68 + environment = { 69 + "LRR_TEMP_DIRECTORY" = "/run/lanraragi"; 70 + "LRR_LOG_DIRECTORY" = "/var/log/lanraragi"; 71 + "LRR_NETWORK" = "http://*:${toString cfg.port}"; 72 + "HOME" = "/var/lib/lanraragi"; 73 + }; 74 + preStart = '' 75 + REDIS_PASS=${lib.optionalString (cfg.redis.passwordFile != null) "$(head -n1 ${cfg.redis.passwordFile})"} 76 + cat > lrr.conf <<EOF 77 + { 78 + redis_address => "127.0.0.1:${toString cfg.redis.port}", 79 + redis_password => "$REDIS_PASS", 80 + redis_database => "0", 81 + redis_database_minion => "1", 82 + redis_database_config => "2", 83 + redis_database_search => "3", 84 + } 85 + EOF 86 + '' + lib.optionalString (cfg.passwordFile != null) '' 87 + PASS_HASH=$( 88 + PASS=$(head -n1 ${cfg.passwordFile}) ${cfg.package.perlEnv}/bin/perl -I${cfg.package}/share/lanraragi/lib -e \ 89 + 'use LANraragi::Controller::Config; print LANraragi::Controller::Config::make_password_hash($ENV{PASS})' \ 90 + 2>/dev/null 91 + ) 92 + 93 + ${lib.getExe pkgs.redis} -h 127.0.0.1 -p ${toString cfg.redis.port} -a "$REDIS_PASS" <<EOF 94 + SELECT 2 95 + HSET LRR_CONFIG password $PASS_HASH 96 + EOF 97 + ''; 98 + }; 99 + }; 100 + }
+1
nixos/tests/all-tests.nix
··· 432 432 kubo = import ./kubo { inherit recurseIntoAttrs runTest; }; 433 433 ladybird = handleTest ./ladybird.nix {}; 434 434 languagetool = handleTest ./languagetool.nix {}; 435 + lanraragi = handleTest ./lanraragi.nix {}; 435 436 latestKernel.login = handleTest ./login.nix { latestKernel = true; }; 436 437 leaps = handleTest ./leaps.nix {}; 437 438 lemmy = handleTest ./lemmy.nix {};
+40
nixos/tests/lanraragi.nix
··· 1 + import ./make-test-python.nix ({ pkgs, lib, ... }: { 2 + name = "lanraragi"; 3 + meta.maintainers = with lib.maintainers; [ tomasajt ]; 4 + 5 + nodes = { 6 + machine1 = { pkgs, ... }: { 7 + services.lanraragi.enable = true; 8 + }; 9 + machine2 = { pkgs, ... }: { 10 + services.lanraragi = { 11 + enable = true; 12 + passwordFile = pkgs.writeText "lrr-test-pass" '' 13 + ultra-secure-password 14 + ''; 15 + port = 4000; 16 + redis = { 17 + port = 4001; 18 + passwordFile = pkgs.writeText "redis-lrr-test-pass" '' 19 + still-a-very-secure-password 20 + ''; 21 + }; 22 + }; 23 + }; 24 + 25 + 26 + }; 27 + 28 + testScript = '' 29 + start_all() 30 + 31 + machine1.wait_for_unit("lanraragi.service") 32 + machine1.wait_until_succeeds("curl -f localhost:3000") 33 + machine1.succeed("[ $(curl -o /dev/null -X post 'http://localhost:3000/login' --data-raw 'password=kamimamita' -w '%{http_code}') -eq 302 ]") 34 + 35 + machine2.wait_for_unit("lanraragi.service") 36 + machine2.wait_until_succeeds("curl -f localhost:4000") 37 + machine2.succeed("[ $(curl -o /dev/null -X post 'http://localhost:4000/login' --data-raw 'password=ultra-secure-password' -w '%{http_code}') -eq 302 ]") 38 + ''; 39 + }) 40 +
+36
pkgs/by-name/la/lanraragi/expose-password-hashing.patch
··· 1 + diff --git a/lib/LANraragi/Controller/Config.pm b/lib/LANraragi/Controller/Config.pm 2 + index 2cd2c999..0bd8ab6e 100644 3 + --- a/lib/LANraragi/Controller/Config.pm 4 + +++ b/lib/LANraragi/Controller/Config.pm 5 + @@ -50,6 +50,15 @@ sub index { 6 + ); 7 + } 8 + 9 + +sub make_password_hash { 10 + + my $ppr = Authen::Passphrase::BlowfishCrypt->new( 11 + + cost => 8, 12 + + salt_random => 1, 13 + + passphrase => shift, 14 + + ); 15 + + return $ppr->as_rfc2307; 16 + +} 17 + + 18 + # Save the given parameters to the Redis config 19 + sub save_config { 20 + 21 + @@ -95,14 +104,7 @@ sub save_config { 22 + my $password = $self->req->param('newpassword'); 23 + 24 + if ( $password ne "" ) { 25 + - my $ppr = Authen::Passphrase::BlowfishCrypt->new( 26 + - cost => 8, 27 + - salt_random => 1, 28 + - passphrase => $password, 29 + - ); 30 + - 31 + - my $pass_hashed = $ppr->as_rfc2307; 32 + - $confhash{password} = $pass_hashed; 33 + + $confhash{password} = make_password_hash($password); 34 + } 35 + } 36 +
+34
pkgs/by-name/la/lanraragi/fix-minion-redis-password.patch
··· 1 + diff --git a/lib/LANraragi.pm b/lib/LANraragi.pm 2 + index e6b833c4..d677030b 100644 3 + --- a/lib/LANraragi.pm 4 + +++ b/lib/LANraragi.pm 5 + @@ -144,8 +144,13 @@ sub startup { 6 + shutdown_from_pid( get_temp . "/minion.pid" ); 7 + 8 + my $miniondb = $self->LRR_CONF->get_redisad . "/" . $self->LRR_CONF->get_miniondb; 9 + + my $redispassword = $self->LRR_CONF->get_redispassword; 10 + + 11 + + # If the password is non-empty, add the required delimiters 12 + + if ($redispassword) { $redispassword = "x:" . $redispassword . "@"; } 13 + + 14 + say "Minion will use the Redis database at $miniondb"; 15 + - $self->plugin( 'Minion' => { Redis => "redis://$miniondb" } ); 16 + + $self->plugin( 'Minion' => { Redis => "redis://$redispassword$miniondb" } ); 17 + $self->LRR_LOGGER->info("Successfully connected to Minion database."); 18 + $self->minion->missing_after(5); # Clean up older workers after 5 seconds of unavailability 19 + 20 + diff --git a/lib/LANraragi/Model/Config.pm b/lib/LANraragi/Model/Config.pm 21 + index f52056d4..63e1f5d3 100644 22 + --- a/lib/LANraragi/Model/Config.pm 23 + +++ b/lib/LANraragi/Model/Config.pm 24 + @@ -42,8 +42,8 @@ sub get_minion { 25 + my $miniondb = get_redisad . "/" . get_miniondb; 26 + my $password = get_redispassword; 27 + 28 + - # If the password is non-empty, add the required @ 29 + - if ($password) { $password = $password . "@"; } 30 + + # If the password is non-empty, add the required delimiters 31 + + if ($password) { $password = "x:" . $password . "@"; } 32 + 33 + return Minion->new( Redis => "redis://$password$miniondb" ); 34 + }
+100
pkgs/by-name/la/lanraragi/fix-paths.patch
··· 1 + diff --git a/lib/LANraragi.pm b/lib/LANraragi.pm 2 + index e6b833c4..4b90e4c5 100644 3 + --- a/lib/LANraragi.pm 4 + +++ b/lib/LANraragi.pm 5 + @@ -21,6 +21,8 @@ use LANraragi::Utils::Minion; 6 + use LANraragi::Model::Search; 7 + use LANraragi::Model::Config; 8 + 9 + +use FindBin; 10 + + 11 + # This method will run once at server start 12 + sub startup { 13 + my $self = shift; 14 + @@ -30,7 +32,7 @@ sub startup { 15 + say "キタ━━━━━━(゚∀゚)━━━━━━!!!!!"; 16 + 17 + # Load package.json to get version/vername/description 18 + - my $packagejson = decode_json( Mojo::File->new('package.json')->slurp ); 19 + + my $packagejson = decode_json( Mojo::File->new("$FindBin::Bin/../package.json")->slurp ); 20 + 21 + my $version = $packagejson->{version}; 22 + my $vername = $packagejson->{version_name}; 23 + diff --git a/lib/LANraragi/Model/Archive.pm b/lib/LANraragi/Model/Archive.pm 24 + index 73e824dd..8bcea29c 100644 25 + --- a/lib/LANraragi/Model/Archive.pm 26 + +++ b/lib/LANraragi/Model/Archive.pm 27 + @@ -13,6 +13,7 @@ use Time::HiRes qw(usleep); 28 + use File::Basename; 29 + use File::Copy "cp"; 30 + use File::Path qw(make_path); 31 + +use FindBin; 32 + 33 + use LANraragi::Utils::Generic qw(remove_spaces remove_newlines render_api_response); 34 + use LANraragi::Utils::TempFolder qw(get_temp); 35 + @@ -126,7 +127,7 @@ sub serve_thumbnail { 36 + } else { 37 + 38 + # If the thumbnail doesn't exist, serve the default thumbnail. 39 + - $self->render_file( filepath => "./public/img/noThumb.png" ); 40 + + $self->render_file( filepath => "$FindBin::Bin/../public/img/noThumb.png" ); 41 + } 42 + return; 43 + 44 + diff --git a/lib/LANraragi/Utils/Generic.pm b/lib/LANraragi/Utils/Generic.pm 45 + index 14736893..4352f023 100644 46 + --- a/lib/LANraragi/Utils/Generic.pm 47 + +++ b/lib/LANraragi/Utils/Generic.pm 48 + @@ -17,6 +17,8 @@ use Sys::CpuAffinity; 49 + use LANraragi::Utils::TempFolder qw(get_temp); 50 + use LANraragi::Utils::Logging qw(get_logger); 51 + 52 + +use FindBin; 53 + + 54 + # Generic Utility Functions. 55 + use Exporter 'import'; 56 + our @EXPORT_OK = 57 + @@ -161,7 +163,7 @@ sub start_shinobu { 58 + my $mojo = shift; 59 + 60 + my $proc = Proc::Simple->new(); 61 + - $proc->start( $^X, "./lib/Shinobu.pm" ); 62 + + $proc->start( $^X, "$FindBin::Bin/../lib/Shinobu.pm" ); 63 + $proc->kill_on_destroy(0); 64 + 65 + $mojo->LRR_LOGGER->debug( "Shinobu Worker new PID is " . $proc->pid ); 66 + @@ -201,7 +203,7 @@ sub get_css_list { 67 + 68 + #Get all the available CSS sheets. 69 + my @css; 70 + - opendir( my $dir, "./public/themes" ) or die $!; 71 + + opendir( my $dir, "$FindBin::Bin/../public/themes" ) or die $!; 72 + while ( my $file = readdir($dir) ) { 73 + if ( $file =~ /.+\.css/ ) { push( @css, $file ); } 74 + } 75 + diff --git a/lib/LANraragi/Utils/Logging.pm b/lib/LANraragi/Utils/Logging.pm 76 + index ee29c507..6bdfc1bd 100644 77 + --- a/lib/LANraragi/Utils/Logging.pm 78 + +++ b/lib/LANraragi/Utils/Logging.pm 79 + @@ -18,7 +18,7 @@ our @EXPORT_OK = qw(get_logger get_plugin_logger get_logdir get_lines_from_file) 80 + # Get the Log folder. 81 + sub get_logdir { 82 + 83 + - my $log_folder = "$FindBin::Bin/../log"; 84 + + my $log_folder = "./log"; 85 + 86 + # Folder location can be overriden by LRR_LOG_DIRECTORY 87 + if ( $ENV{LRR_LOG_DIRECTORY} ) { 88 + diff --git a/lib/LANraragi/Utils/TempFolder.pm b/lib/LANraragi/Utils/TempFolder.pm 89 + index 792b1c1b..f0eb341b 100644 90 + --- a/lib/LANraragi/Utils/TempFolder.pm 91 + +++ b/lib/LANraragi/Utils/TempFolder.pm 92 + @@ -20,7 +20,7 @@ our @EXPORT_OK = qw(get_temp get_tempsize clean_temp_full clean_temp_partial); 93 + #Get the current tempfolder. 94 + #This can be called from any process safely as it uses FindBin. 95 + sub get_temp { 96 + - my $temp_folder = "$FindBin::Bin/../public/temp"; 97 + + my $temp_folder = "./public/temp"; 98 + 99 + # Folder location can be overriden by LRR_TEMP_DIRECTORY 100 + if ( $ENV{LRR_TEMP_DIRECTORY} ) {
+63
pkgs/by-name/la/lanraragi/install.patch
··· 1 + diff --git a/tools/cpanfile b/tools/cpanfile 2 + index 359c61fe..ca3b7ec7 100755 3 + --- a/tools/cpanfile 4 + +++ b/tools/cpanfile 5 + @@ -20,7 +20,7 @@ requires 'Sort::Naturally', 1.03; 6 + requires 'Authen::Passphrase', 0.008; 7 + requires 'File::ReadBackwards', 1.05; 8 + requires 'URI::Escape', 1.74; 9 + -requires 'URI', 5.09; 10 + +requires 'URI', 5.05; 11 + 12 + # Used by Installer 13 + requires 'IPC::Cmd', 1.02; 14 + diff --git a/tools/install.pl b/tools/install.pl 15 + index 0cbb847d..1bd61fa0 100755 16 + --- a/tools/install.pl 17 + +++ b/tools/install.pl 18 + @@ -91,32 +91,6 @@ if ( $ENV{HOMEBREW_FORMULA_PREFIX} ) { 19 + $cpanopt = " -l " . $ENV{HOMEBREW_FORMULA_PREFIX} . "/libexec"; 20 + } 21 + 22 + -#Load IPC::Cmd 23 + -install_package( "IPC::Cmd", $cpanopt ); 24 + -install_package( "Config::AutoConf", $cpanopt ); 25 + -IPC::Cmd->import('can_run'); 26 + -require Config::AutoConf; 27 + - 28 + -say("\r\nWill now check if all LRR software dependencies are met. \r\n"); 29 + - 30 + -#Check for Redis 31 + -say("Checking for Redis..."); 32 + -can_run('redis-server') 33 + - or die 'NOT FOUND! Please install a Redis server before proceeding.'; 34 + -say("OK!"); 35 + - 36 + -#Check for GhostScript 37 + -say("Checking for GhostScript..."); 38 + -can_run('gs') 39 + - or warn 'NOT FOUND! PDF support will not work properly. Please install the "gs" tool.'; 40 + -say("OK!"); 41 + - 42 + -#Check for libarchive 43 + -say("Checking for libarchive..."); 44 + -Config::AutoConf->new()->check_header("archive.h") 45 + - or die 'NOT FOUND! Please install libarchive and ensure its headers are present.'; 46 + -say("OK!"); 47 + - 48 + #Check for PerlMagick 49 + say("Checking for ImageMagick/PerlMagick..."); 50 + my $imgk; 51 + @@ -154,12 +128,6 @@ if ( $back || $full ) { 52 + #Clientside Dependencies with Provisioning 53 + if ( $front || $full ) { 54 + 55 + - say("\r\nObtaining remote Web dependencies...\r\n"); 56 + - 57 + - if ( system("npm install") != 0 ) { 58 + - die "Something went wrong while obtaining node modules - Bailing out."; 59 + - } 60 + - 61 + say("\r\nProvisioning...\r\n"); 62 + 63 + #Load File::Copy
+130
pkgs/by-name/la/lanraragi/package.nix
··· 1 + { lib 2 + , stdenv 3 + , buildNpmPackage 4 + , fetchFromGitHub 5 + , fetchpatch 6 + , makeBinaryWrapper 7 + , perl 8 + , ghostscript 9 + , nixosTests 10 + }: 11 + 12 + let 13 + perlEnv = perl.withPackages (_: cpanDeps); 14 + 15 + cpanDeps = with perl.pkgs; [ 16 + ImageMagick 17 + locallib 18 + Redis 19 + Encode 20 + ArchiveLibarchiveExtract 21 + ArchiveLibarchivePeek 22 + NetDNSNative 23 + SortNaturally 24 + AuthenPassphrase 25 + FileReadBackwards 26 + URI 27 + LogfileRotate 28 + Mojolicious 29 + MojoliciousPluginTemplateToolkit 30 + MojoliciousPluginRenderFile 31 + MojoliciousPluginStatus 32 + IOSocketSSL 33 + CpanelJSONXS 34 + Minion 35 + MinionBackendRedis 36 + ProcSimple 37 + ParallelLoops 38 + SysCpuAffinity 39 + FileChangeNotify 40 + ModulePluggable 41 + TimeLocal 42 + ] ++ lib.optional stdenv.isLinux LinuxInotify2; 43 + in 44 + buildNpmPackage rec { 45 + pname = "lanraragi"; 46 + version = "0.8.90"; 47 + 48 + src = fetchFromGitHub { 49 + owner = "Difegue"; 50 + repo = "LANraragi"; 51 + rev = "v.${version}"; 52 + hash = "sha256-ljnREUGCKvUJvcQ+aJ6XqiMTkVmfjt/0oC47w3PCj/k="; 53 + }; 54 + 55 + patches = [ 56 + (fetchpatch { 57 + name = "add-package-lock-json.patch"; # Can be removed when updating to 0.9.0 58 + url = "https://github.com/Difegue/LANraragi/commit/c5cd8641795bf7e40deef4ae955ea848dde44050.patch"; 59 + hash = "sha256-XKxRzeugkIe6N4XRN6+O1wEZpxo6OzU0OaG0ywKFv38="; 60 + }) 61 + ./install.patch 62 + ./fix-paths.patch 63 + ./expose-password-hashing.patch 64 + ./fix-minion-redis-password.patch # Should be upstreamed 65 + ]; 66 + 67 + npmFlags = [ "--legacy-peer-deps" ]; 68 + 69 + npmDepsHash = "sha256-UQsChPU5b4+r5Kv6P/3rJCGUzssiUNSKo3w4axNyJew="; 70 + 71 + nativeBuildInputs = [ 72 + perl 73 + makeBinaryWrapper 74 + perl.pkgs.Appcpanminus 75 + ] ++ cpanDeps; 76 + 77 + nativeCheckInputs = with perl.pkgs; [ 78 + TestMockObject 79 + TestTrap 80 + TestDeep 81 + ]; 82 + 83 + buildPhase = '' 84 + runHook preBuild 85 + 86 + perl ./tools/install.pl install-full 87 + rm -r node_modules public/js/vendor/*.map public/css/vendor/*.map 88 + 89 + runHook postBuild 90 + ''; 91 + 92 + doCheck = true; 93 + 94 + checkPhase = '' 95 + runHook preCheck 96 + 97 + rm tests/plugins.t # Uses network 98 + prove -r -l -v tests 99 + 100 + runHook postCheck 101 + ''; 102 + 103 + installPhase = '' 104 + runHook preInstall 105 + 106 + mkdir -p $out/share/lanraragi 107 + cp -r lib public script templates package.json $out/share/lanraragi 108 + 109 + makeWrapper ${perlEnv}/bin/perl $out/bin/lanraragi \ 110 + --prefix PATH : ${lib.makeBinPath [ ghostscript ]} \ 111 + --add-flags "$out/share/lanraragi/script/launcher.pl -f $out/share/lanraragi/script/lanraragi" 112 + 113 + runHook postInstall 114 + ''; 115 + 116 + passthru = { 117 + inherit perlEnv; 118 + tests = { inherit (nixosTests) lanraragi; }; 119 + }; 120 + 121 + meta = { 122 + changelog = "https://github.com/Difegue/LANraragi/releases/tag/${src.rev}"; 123 + description = "Web application for archival and reading of manga/doujinshi"; 124 + homepage = "https://github.com/Difegue/LANraragi"; 125 + license = lib.licenses.mit; 126 + mainProgram = "lanraragi"; 127 + maintainers = with lib.maintainers; [ tomasajt ]; 128 + platforms = lib.platforms.unix; 129 + }; 130 + }
+29
pkgs/development/perl-modules/Alien-FFI-dont-download.patch
··· 1 + diff --git a/alienfile b/alienfile 2 + index 18d6b42..5ccf296 100644 3 + --- a/alienfile 4 + +++ b/alienfile 5 + @@ -11,12 +11,6 @@ plugin 'PkgConfig' => 'libffi'; 6 + 7 + share { 8 + 9 + - plugin 'Download::GitHub' => ( 10 + - github_user => 'libffi', 11 + - github_repo => 'libffi', 12 + - asset => 1, 13 + - ); 14 + - 15 + plugin 'Build::Autoconf' => (); 16 + 17 + my $configure = '--disable-shared --enable-static --disable-builddir'; 18 + diff --git a/t/00_diag.t b/t/00_diag.t 19 + index 51dd784..2bc314c 100644 20 + --- a/t/00_diag.t 21 + +++ b/t/00_diag.t 22 + @@ -13,7 +13,6 @@ $modules{$_} = $_ for qw( 23 + Alien::Base 24 + Alien::Build 25 + Alien::Build::MM 26 + - Alien::Build::Plugin::Download::GitHub 27 + Alien::Build::Plugin::Probe::Vcpkg 28 + Capture::Tiny 29 + ExtUtils::MakeMaker
+25
pkgs/development/perl-modules/ArchiveLibarchive-set-findlib-path.patch
··· 1 + diff --git a/lib/Archive/Libarchive/Lib.pm b/lib/Archive/Libarchive/Lib.pm 2 + index 3fcbcf4..214df7a 100644 3 + --- a/lib/Archive/Libarchive/Lib.pm 4 + +++ b/lib/Archive/Libarchive/Lib.pm 5 + @@ -3,7 +3,7 @@ package Archive::Libarchive::Lib; 6 + use strict; 7 + use warnings; 8 + use 5.020; 9 + -use FFI::CheckLib 0.30 qw( find_lib_or_die ); 10 + +use FFI::CheckLib qw( find_lib_or_die ); 11 + use Encode qw( decode ); 12 + use experimental qw( signatures ); 13 + 14 + index 3fcbcf4..718caed 100644 15 + --- a/lib/Archive/Libarchive/Lib.pm 16 + +++ b/lib/Archive/Libarchive/Lib.pm 17 + @@ -23,7 +23,7 @@ L<Archive::Libarchive>. 18 + 19 + sub lib 20 + { 21 + - $ENV{ARCHIVE_LIBARCHIVE_LIB_DLL} // find_lib_or_die( lib => 'archive', symbol => ['archive_read_free','archive_write_free','archive_free'], alien => ['Alien::Libarchive3'] ); 22 + + $ENV{ARCHIVE_LIBARCHIVE_LIB_DLL} // find_lib_or_die( lib => 'archive', symbol => ['archive_read_free','archive_write_free','archive_free'], libpath => '@@libarchive@@' ); 23 + } 24 + 25 + sub ffi
+334
pkgs/top-level/perl-packages.nix
··· 278 278 }; 279 279 }; 280 280 281 + AlienFFI = buildPerlPackage { 282 + pname = "Alien-FFI"; 283 + version = "0.27"; 284 + src = fetchurl { 285 + url = "mirror://cpan/authors/id/P/PL/PLICEASE/Alien-FFI-0.27.tar.gz"; 286 + hash = "sha256-Kbsgg/P5gqOfSFIkP09qEZFpZvIObneGTpkmnRHotl4="; 287 + }; 288 + patches = [ ../development/perl-modules/Alien-FFI-dont-download.patch ]; 289 + nativeBuildInputs = [ pkgs.pkg-config ]; 290 + buildInputs = [ pkgs.libffi CaptureTiny Test2Suite NetSSLeay MojoDOM58 IOSocketSSL ]; 291 + propagatedBuildInputs = [ AlienBuild ]; 292 + meta = { 293 + homepage = "https://metacpan.org/pod/Alien::FFI"; 294 + description = "Build and make available libffi"; 295 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 296 + maintainers = with maintainers; [ tomasajt ]; 297 + }; 298 + }; 299 + 281 300 AlienGMP = buildPerlPackage { 282 301 pname = "Alien-GMP"; 283 302 version = "1.16"; ··· 989 1008 description = "Validate method/function parameters"; 990 1009 homepage = "https://metacpan.org/release/Params-Validate"; 991 1010 license = with lib.licenses; [ artistic2 ]; 1011 + }; 1012 + }; 1013 + 1014 + ArchiveLibarchive = buildPerlPackage { 1015 + pname = "Archive-Libarchive"; 1016 + version = "0.08"; 1017 + src = fetchurl { 1018 + url = "mirror://cpan/authors/id/P/PL/PLICEASE/Archive-Libarchive-0.08.tar.gz"; 1019 + hash = "sha256-6ONC1U/T1uXn4xYP4IjBOgpQM8/76JSBodJHHUNyAFk="; 1020 + }; 1021 + patches = [ ../development/perl-modules/ArchiveLibarchive-set-findlib-path.patch ]; 1022 + postPatch = '' 1023 + substituteInPlace lib/Archive/Libarchive/Lib.pm --replace "@@libarchive@@" "${pkgs.libarchive.lib}/lib" 1024 + ''; 1025 + buildInputs = [ FFIC Filechdir PathTiny SubIdentify TermTable Test2Suite Test2ToolsMemoryCycle TestArchiveLibarchive TestScript ]; 1026 + propagatedBuildInputs = [ FFICStat FFICheckLib FFIPlatypus FFIPlatypusTypeEnum FFIPlatypusTypePtrObject RefUtil ]; 1027 + meta = { 1028 + homepage = "https://metacpan.org/pod/Archive::Libarchive"; 1029 + description = "Modern Perl bindings to libarchive"; 1030 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 1031 + maintainers = with maintainers; [ tomasajt ]; 1032 + }; 1033 + }; 1034 + 1035 + ArchiveLibarchiveExtract = buildPerlPackage { 1036 + pname = "Archive-Libarchive-Extract"; 1037 + version = "0.03"; 1038 + src = fetchurl { 1039 + url = "mirror://cpan/authors/id/P/PL/PLICEASE/Archive-Libarchive-Extract-0.03.tar.gz"; 1040 + hash = "sha256-yXfAR0hnIX6zJvte5pA04e9spBQUkWHjEpAblf0SwIE="; 1041 + }; 1042 + buildInputs = [ Test2Suite TestScript ]; 1043 + propagatedBuildInputs = [ ArchiveLibarchive Filechdir PathTiny RefUtil ]; 1044 + meta = { 1045 + homepage = "https://metacpan.org/pod/Archive::Libarchive::Extract"; 1046 + description = "An archive extracting mechanism (using libarchive)"; 1047 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 1048 + maintainers = with maintainers; [ tomasajt ]; 1049 + }; 1050 + }; 1051 + 1052 + ArchiveLibarchivePeek = buildPerlPackage { 1053 + pname = "Archive-Libarchive-Peek"; 1054 + version = "0.04"; 1055 + src = fetchurl { 1056 + url = "mirror://cpan/authors/id/P/PL/PLICEASE/Archive-Libarchive-Peek-0.04.tar.gz"; 1057 + hash = "sha256-DYhJ4xG2RsozWz6gGodTtAIkK5XOgAo7zNXHCC4nJPo="; 1058 + }; 1059 + buildInputs = [ Filechdir Test2Suite TestScript ]; 1060 + propagatedBuildInputs = [ ArchiveLibarchive PathTiny RefUtil ]; 1061 + meta = { 1062 + homepage = "https://metacpan.org/pod/Archive::Libarchive::Peek"; 1063 + description = "Peek into archives without extracting them"; 1064 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 1065 + maintainers = with maintainers; [ tomasajt ]; 992 1066 }; 993 1067 }; 994 1068 ··· 9187 9261 }; 9188 9262 }; 9189 9263 9264 + FFIC = buildPerlPackage { 9265 + pname = "FFI-C"; 9266 + version = "0.15"; 9267 + src = fetchurl { 9268 + url = "mirror://cpan/authors/id/P/PL/PLICEASE/FFI-C-0.15.tar.gz"; 9269 + hash = "sha256-63BgfmZzvMsY3yf0zuRZ+23EGODak+aSzcNVX+QNL04="; 9270 + }; 9271 + buildInputs = [ CaptureTiny PathTiny Test2Suite ]; 9272 + propagatedBuildInputs = [ ClassInspector FFIPlatypus FFIPlatypusTypeEnum RefUtil SubIdentify SubInstall ]; 9273 + meta = { 9274 + homepage = "https://metacpan.org/pod/FFI::C"; 9275 + description = "C data types for FFI"; 9276 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 9277 + maintainers = with maintainers; [ tomasajt ]; 9278 + }; 9279 + }; 9280 + 9190 9281 FFICheckLib = buildPerlPackage { 9191 9282 pname = "FFI-CheckLib"; 9192 9283 version = "0.27"; ··· 9199 9290 description = "Check that a library is available for FFI"; 9200 9291 homepage = "https://metacpan.org/pod/FFI::CheckLib"; 9201 9292 license = with lib.licenses; [ artistic1 gpl1Plus ]; 9293 + }; 9294 + }; 9295 + 9296 + FFICStat = buildPerlPackage { 9297 + pname = "FFI-C-Stat"; 9298 + version = "0.02"; 9299 + src = fetchurl { 9300 + url = "mirror://cpan/authors/id/P/PL/PLICEASE/FFI-C-Stat-0.02.tar.gz"; 9301 + hash = "sha256-ThXY9vn5hAfGUtnTE7URUHcTkgGOBx18GShDrILBvlk="; 9302 + }; 9303 + buildInputs = [ Filechdir PathTiny Test2Suite TestScript ]; 9304 + propagatedBuildInputs = [ FFIPlatypus RefUtil ]; 9305 + meta = { 9306 + homepage = "https://metacpan.org/pod/FFI::C::Stat"; 9307 + description = "Object-oriented FFI interface to native stat and lstat"; 9308 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 9309 + maintainers = with maintainers; [ tomasajt ]; 9310 + }; 9311 + }; 9312 + 9313 + FFIPlatypus = buildPerlPackage { 9314 + pname = "FFI-Platypus"; 9315 + version = "2.08"; 9316 + src = fetchurl { 9317 + url = "mirror://cpan/authors/id/P/PL/PLICEASE/FFI-Platypus-2.08.tar.gz"; 9318 + hash = "sha256-EbOrEU7ZY1YxzYWzjSKXhuFEv5Sjr5rAnD17s0M2uSQ="; 9319 + }; 9320 + buildInputs = [ AlienFFI Test2Suite ]; 9321 + propagatedBuildInputs = [ CaptureTiny FFICheckLib ]; 9322 + meta = { 9323 + homepage = "https://pl.atypus.org"; 9324 + description = "Write Perl bindings to non-Perl libraries with FFI. No XS required"; 9325 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 9326 + maintainers = with maintainers; [ tomasajt ]; 9327 + }; 9328 + }; 9329 + 9330 + FFIPlatypusTypePtrObject = buildPerlPackage { 9331 + pname = "FFI-Platypus-Type-PtrObject"; 9332 + version = "0.03"; 9333 + src = fetchurl { 9334 + url = "mirror://cpan/authors/id/P/PL/PLICEASE/FFI-Platypus-Type-PtrObject-0.03.tar.gz"; 9335 + hash = "sha256-4elJB++QtANgqabAPSlaEwR9T2ybVqyvHfK1TRcwf3Q="; 9336 + }; 9337 + buildInputs = [ Test2Suite Test2ToolsFFI ]; 9338 + propagatedBuildInputs = [ FFIPlatypus RefUtil ]; 9339 + meta = { 9340 + homepage = "https://metacpan.org/pod/FFI::Platypus::Type::PtrObject"; 9341 + description = "Platypus custom type for an object wrapped around an opaque pointer"; 9342 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 9343 + maintainers = with maintainers; [ tomasajt ]; 9344 + }; 9345 + }; 9346 + 9347 + FFIPlatypusTypeEnum = buildPerlPackage { 9348 + pname = "FFI-Platypus-Type-Enum"; 9349 + version = "0.06"; 9350 + src = fetchurl { 9351 + url = "mirror://cpan/authors/id/P/PL/PLICEASE/FFI-Platypus-Type-Enum-0.06.tar.gz"; 9352 + hash = "sha256-yVSmBPfWkpYk+pQT2NDh2DtL2XfQVifKznPtU6lcd98="; 9353 + }; 9354 + buildInputs = [ FFIPlatypus Test2Suite ]; 9355 + propagatedBuildInputs = [ RefUtil ]; 9356 + meta = { 9357 + homepage = "https://metacpan.org/pod/FFI::Platypus::Type::Enum"; 9358 + description = "Custom platypus type for dealing with C enumerated types"; 9359 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 9360 + maintainers = with maintainers; [ tomasajt ]; 9202 9361 }; 9203 9362 }; 9204 9363 ··· 9810 9969 }; 9811 9970 }; 9812 9971 9972 + FileShareDirDist = buildPerlPackage { 9973 + pname = "File-ShareDir-Dist"; 9974 + version = "0.07"; 9975 + src = fetchurl { 9976 + url = "mirror://cpan/authors/id/P/PL/PLICEASE/File-ShareDir-Dist-0.07.tar.gz"; 9977 + hash = "sha256-jX/l0O4iNR9B75Wtwi29VsMf+iqbLBmEMA6S/36f6G0="; 9978 + }; 9979 + meta = { 9980 + homepage = "https://metacpan.org/pod/File::ShareDir::Dist"; 9981 + description = "Locate per-dist shared files"; 9982 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 9983 + maintainers = with maintainers; [ tomasajt ]; 9984 + }; 9985 + }; 9986 + 9813 9987 FileShareDirInstall = buildPerlPackage { 9814 9988 pname = "File-ShareDir-Install"; 9815 9989 version = "0.13"; ··· 14099 14273 }; 14100 14274 }; 14101 14275 14276 + LogfileRotate = buildPerlPackage { 14277 + pname = "Logfile-Rotate"; 14278 + version = "1.04"; 14279 + src = fetchurl { 14280 + url = "mirror://cpan/authors/id/P/PA/PAULG/Logfile-Rotate-1.04.tar.gz"; 14281 + hash = "sha256-gQ+LfM2GV9Ox71PNR1glR4Rc67WCArBVObNAhjjK2j4="; 14282 + }; 14283 + meta = { 14284 + description = "Perl module to rotate logfiles"; 14285 + homepage = "https://metacpan.org/dist/Logfile-Rotate"; 14286 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 14287 + maintainers = with maintainers; [ tomasajt ]; 14288 + }; 14289 + }; 14290 + 14102 14291 Logger = buildPerlPackage { 14103 14292 pname = "Log-ger"; 14104 14293 version = "0.037"; ··· 15452 15641 }; 15453 15642 }; 15454 15643 15644 + MinionBackendRedis = buildPerlModule { 15645 + pname = "Minion-Backend-Redis"; 15646 + version = "0.003"; 15647 + src = fetchurl { 15648 + url = "mirror://cpan/authors/id/D/DF/DFUG/Minion-Backend-Redis-0.003.tar.gz"; 15649 + hash = "sha256-zXZRIQbfHKmQF75fObSmXgSCawzZQxe3GsAWGzXzI6A="; 15650 + }; 15651 + buildInputs = [ ModuleBuildTiny ]; 15652 + propagatedBuildInputs = [ Minion MojoRedis Mojolicious SortVersions ]; 15653 + meta = { 15654 + homepage = "https://github.com/Difegue/Minion-Backend-Redis"; 15655 + description = "Redis backend for Minion job queue"; 15656 + license = with lib.licenses; [ artistic2 ]; 15657 + maintainers = with maintainers; [ tomasajt ]; 15658 + }; 15659 + }; 15660 + 15455 15661 MinionBackendSQLite = buildPerlModule { 15456 15662 pname = "Minion-Backend-SQLite"; 15457 15663 version = "5.0.6"; ··· 16258 16464 }; 16259 16465 }; 16260 16466 16467 + MojoliciousPluginRenderFile = buildPerlPackage { 16468 + pname = "Mojolicious-Plugin-RenderFile"; 16469 + version = "0.12"; 16470 + src = fetchurl { 16471 + url = "mirror://cpan/authors/id/K/KO/KOORCHIK/Mojolicious-Plugin-RenderFile-0.12.tar.gz"; 16472 + hash = "sha256-AT5CoswGvHBBuxPJ3ziK8kAQ5peTqN8PCrHSQKphFz8="; 16473 + }; 16474 + propagatedBuildInputs = [ Mojolicious ]; 16475 + meta = { 16476 + description = "\"render_file\" helper for Mojolicious"; 16477 + homepage = "https://github.com/koorchik/Mojolicious-Plugin-RenderFile"; 16478 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 16479 + maintainers = with maintainers; [ tomasajt ]; 16480 + }; 16481 + }; 16482 + 16261 16483 MojoliciousPluginStatus = buildPerlPackage { 16262 16484 pname = "Mojolicious-Plugin-Status"; 16263 16485 version = "1.17"; ··· 16287 16509 homepage = "https://github.com/jhthorsen/mojolicious-plugin-syslog"; 16288 16510 license = with lib.licenses; [ artistic2 ]; 16289 16511 maintainers = [ maintainers.sgo ]; 16512 + }; 16513 + }; 16514 + 16515 + MojoliciousPluginTemplateToolkit = buildPerlModule { 16516 + pname = "Mojolicious-Plugin-TemplateToolkit"; 16517 + version = "0.006"; 16518 + src = fetchurl { 16519 + url = "mirror://cpan/authors/id/D/DB/DBOOK/Mojolicious-Plugin-TemplateToolkit-0.006.tar.gz"; 16520 + hash = "sha256-dBoFAmtTArtrKc+I3KICC3rv0iNHgWELpZNaqPCXNKY="; 16521 + }; 16522 + buildInputs = [ ModuleBuildTiny ]; 16523 + propagatedBuildInputs = [ ClassMethodModifiers Mojolicious TemplateToolkit ]; 16524 + meta = { 16525 + homepage = "https://github.com/Grinnz/Mojolicious-Plugin-TemplateToolkit"; 16526 + description = "Template Toolkit renderer plugin for Mojolicious"; 16527 + license = with lib.licenses; [ artistic2 ]; 16528 + maintainers = with maintainers; [ tomasajt ]; 16290 16529 }; 16291 16530 }; 16292 16531 ··· 16856 17095 }; 16857 17096 }; 16858 17097 17098 + TestArchiveLibarchive = buildPerlPackage { 17099 + pname = "Test-Archive-Libarchive"; 17100 + version = "0.02"; 17101 + src = fetchurl { 17102 + url = "mirror://cpan/authors/id/P/PL/PLICEASE/Test-Archive-Libarchive-0.02.tar.gz"; 17103 + hash = "sha256-KxkYZx4F2i2dIiwQx9kXWFpiQYb+r7j4SQhZnDRwJ1E="; 17104 + }; 17105 + propagatedBuildInputs = [ RefUtil Test2Suite ]; 17106 + meta = { 17107 + homepage = "https://metacpan.org/pod/Test::Archive::Libarchive"; 17108 + description = "Testing tools for Archive::Libarchive"; 17109 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 17110 + maintainers = with maintainers; [ tomasajt ]; 17111 + }; 17112 + }; 17113 + 16859 17114 TestPostgreSQL = buildPerlModule { 16860 17115 pname = "Test-PostgreSQL"; 16861 17116 version = "1.29"; ··· 17780 18035 homepage = "https://github.com/jacquesg/p5-Neovim-Ext"; 17781 18036 license = with licenses; [ gpl1Plus /* or */ artistic1 ]; 17782 18037 maintainers = with maintainers; [ figsoda ]; 18038 + }; 18039 + }; 18040 + 18041 + NetDNSNative = buildPerlPackage { 18042 + pname = "Net-DNS-Native"; 18043 + version = "0.22"; 18044 + src = fetchurl { 18045 + url = "mirror://cpan/authors/id/O/OL/OLEG/Net-DNS-Native-0.22.tar.gz"; 18046 + hash = "sha256-EI2d7bq5/69qDQFSVSbeGJSITpUL/YM3F+XNOJBcMNU="; 18047 + }; 18048 + meta = { 18049 + description = "Non-blocking system DNS resolver"; 18050 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 18051 + maintainers = with maintainers; [ tomasajt ]; 17783 18052 }; 17784 18053 }; 17785 18054 ··· 19222 19491 description = "A simple parallel processing fork manager"; 19223 19492 homepage = "https://github.com/dluxhu/perl-parallel-forkmanager"; 19224 19493 license = with lib.licenses; [ artistic1 gpl1Plus ]; 19494 + }; 19495 + }; 19496 + 19497 + ParallelLoops = buildPerlPackage { 19498 + pname = "Parallel-Loops"; 19499 + version = "0.10"; 19500 + src = fetchurl { 19501 + url = "mirror://cpan/authors/id/P/PM/PMORCH/Parallel-Loops-0.10.tar.gz"; 19502 + hash = "sha256-b5Z7RuejY7FocbmZHDWeFC3Dsigc/psa85kEcEyL0qo="; 19503 + }; 19504 + propagatedBuildInputs = [ ParallelForkManager ]; 19505 + meta = { 19506 + description = "Execute loops using parallel forked subprocesses"; 19507 + homepage = "https://github.com/pmorch/perl-Parallel-Loops"; 19508 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 19509 + maintainers = with maintainers; [ tomasajt ]; 19225 19510 }; 19226 19511 }; 19227 19512 ··· 23128 23413 }; 23129 23414 }; 23130 23415 23416 + SysCpuAffinity = buildPerlModule { 23417 + pname = "Sys-CpuAffinity"; 23418 + version = "1.12"; 23419 + src = fetchurl { 23420 + url = "mirror://cpan/authors/id/M/MO/MOB/Sys-CpuAffinity-1.12.tar.gz"; 23421 + hash = "sha256-/jLAXz6wWXCMZH8ruFslBFhZHyupBR2Nhm9Uajh+6Eg="; 23422 + }; 23423 + doCheck = false; # Would run checks for all supported systems 23424 + meta = { 23425 + description = "Set CPU affinity for processes"; 23426 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 23427 + maintainers = with maintainers; [ tomasajt ]; 23428 + }; 23429 + }; 23430 + 23131 23431 SysHostnameLong = buildPerlPackage { 23132 23432 pname = "Sys-Hostname-Long"; 23133 23433 version = "1.5"; ··· 23845 24145 meta = { 23846 24146 description = "Distribution with a rich set of tools built upon the Test2 framework"; 23847 24147 license = with lib.licenses; [ artistic1 gpl1Plus ]; 24148 + }; 24149 + }; 24150 + 24151 + Test2ToolsFFI = buildPerlPackage { 24152 + pname = "Test2-Tools-FFI"; 24153 + version = "0.06"; 24154 + src = fetchurl { 24155 + url = "mirror://cpan/authors/id/P/PL/PLICEASE/Test2-Tools-FFI-0.06.tar.gz"; 24156 + hash = "sha256-MA28QKEubG+7y7lv05uQK+bZZXJtrx5qtzuKCv0lLy8="; 24157 + }; 24158 + buildInputs = [ FileShareDirInstall Test2Suite ]; 24159 + propagatedBuildInputs = [ CaptureTiny FFICheckLib FFIPlatypus FileShareDirDist ]; 24160 + meta = { 24161 + homepage = "https://metacpan.org/pod/Test2::Tools::FFI"; 24162 + description = "Tools for testing FFI"; 24163 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 24164 + maintainers = with maintainers; [ tomasajt ]; 24165 + }; 24166 + }; 24167 + 24168 + Test2ToolsMemoryCycle = buildPerlPackage { 24169 + pname = "Test2-Tools-MemoryCycle"; 24170 + version = "0.01"; 24171 + src = fetchurl { 24172 + url = "mirror://cpan/authors/id/P/PL/PLICEASE/Test2-Tools-MemoryCycle-0.01.tar.gz"; 24173 + hash = "sha256-U1s9ylQqMyUVEq3ktafb6+PESNg/iA0ZjkPcEnl5aYs="; 24174 + }; 24175 + buildInputs = [ Test2Suite ]; 24176 + propagatedBuildInputs = [ DevelCycle PadWalker ]; 24177 + meta = { 24178 + homepage = "https://metacpan.org/pod/Test2::Tools::MemoryCycle"; 24179 + description = "Check for memory leaks and circular memory references"; 24180 + license = with lib.licenses; [ artistic1 gpl1Plus ]; 24181 + maintainers = with maintainers; [ tomasajt ]; 23848 24182 }; 23849 24183 }; 23850 24184