{"id":19640462,"url":"https://github.com/kentnl/gentoo-util-virtualdepend","last_synced_at":"2026-06-21T02:32:06.124Z","repository":{"id":21725079,"uuid":"25046726","full_name":"kentnl/Gentoo-Util-VirtualDepend","owner":"kentnl","description":"Hard-coded replacements for perl-core/ dependencies and dependencies with odd names in Gentoo","archived":false,"fork":false,"pushed_at":"2017-03-19T05:23:04.000Z","size":444,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-09T18:57:43.372Z","etag":null,"topics":["perl"],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kentnl.png","metadata":{"files":{"readme":"README.mkdn","changelog":"Changes","contributing":"CONTRIBUTING.pod","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-10T17:54:53.000Z","updated_at":"2018-03-02T16:44:05.000Z","dependencies_parsed_at":"2022-08-17T16:25:23.663Z","dependency_job_id":null,"html_url":"https://github.com/kentnl/Gentoo-Util-VirtualDepend","commit_stats":null,"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentnl%2FGentoo-Util-VirtualDepend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentnl%2FGentoo-Util-VirtualDepend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentnl%2FGentoo-Util-VirtualDepend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentnl%2FGentoo-Util-VirtualDepend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kentnl","download_url":"https://codeload.github.com/kentnl/Gentoo-Util-VirtualDepend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240947648,"owners_count":19883030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["perl"],"created_at":"2024-11-11T14:05:51.401Z","updated_at":"2026-06-21T02:32:06.117Z","avatar_url":"https://github.com/kentnl.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nGentoo::Util::VirtualDepend - Hard-coded replacements for perl-core/ dependencies and dependencies with odd names in Gentoo\n\n# VERSION\n\nversion 0.003024\n\n# SYNOPSIS\n\n    use Gentoo::Util::VirtualDepend;\n\n    my $v = Gentoo::Util::VirtualDepend-\u003enew();\n\n    # somewhere in complex dependency resolution\n\n    my $cpan_module = spooky_function();\n    my $gentoo_dependency;\n\n    if ( $v-\u003ehas_module_override( $cpan_module ) ) {\n      $gentoo_dependency = $v-\u003eget_module_override( $cpan_module );\n    } else {\n      # do it the hard way.\n    }\n\nIf you're trying to be defensive and you're going to map the modules to distributions\nthe hard way ( trust me, the code is really ugly ), then you may instead want\n\n    if ( $v-\u003ehas_dist_override( $cpan_dist ) ) {\n      $gentoo_dependency = $v-\u003eget_dist_override( $cpan_dist );\n    } else {\n      # fallback to using dev-perl/Foo-Bar\n    }\n\nWhich basically serves as a distribution name translator.\n\n## WHY YOU WANT TO DO THAT\n\nWell ...\n\n     { requires =\u003e { Foo =\u003e 1.0 }}\n\n     Foo is in Bar\n\n     Foo 1.0 could have been shipped in in Bar-1.0, Bar-0.5, or Bar-2.0 for all you know.\n\nThat's the unfortunate reality of `CPAN` dependencies.\n\nSo if you naively map\n\n    Foo-1.0 → \u003e=dev-lang/Bar-1.0\n\nYou might get breakage if `Foo 1.0` didn't ship till `Bar-2.0`, and the user has `Bar-1.0` → Shower of sparks.\n\n# DESCRIPTION\n\nThis module serves as a low level glue layer for the handful of manual mappings\nthat are needed in Gentoo due to things not strictly tracking upstream.\n\n`CPANPLUS::Dist::Gentoo` has similar logic to this, but not as simple ( or for that matter, usable without `CPANPLUS` )\n\nThis module is not intended to be used entirely on its own, but as a short-circuit before calling\ncomplicated `MetaCPAN` code.\n\n# METHODS\n\n## has\\_module\\_override\n\n    $v-\u003ehas_module_override( $module )\n\nReturns true if there is a known mapping for `$module` in `Gentoo` that is unusual and may require translation.\n\nWill return true for anything that is either a `virtual` or has an unusual\nname translation separating it from `CPAN`.\n\n## get\\_module\\_override\n\n    $v-\u003eget_module_override( $module )\n\nReturns a `Gentoo` dependency atom corresponding to `$module` if there is a known mapping for `$module`.\n\nFor instance,\n\n    $v-\u003eget_module_override('ExtUtils::MakeMaker')\n\nEmits:\n\n    virtual/perl-ExtUtilsMakeMaker\n\nIf `ExtUtils::MakeMaker` is one day de-cored (Hah!, dreams are free) then\n`has_module_override` will return false, and that instructs you to go back\nto assuming it is in `dev-perl/`\n\n## has\\_dist\\_override\n\n    $v-\u003ehas_dist_override( $distname )\n\nSimilar to `has_module_override` but closer to the dependency spec.\n\nWill return true for anything that is either a `virtual` or has an unusual\nname translation separating it from `CPAN`.\n\n## get\\_dist\\_override\n\n    $v-\u003eget_dist_override( $distname )\n\nSimilar to `get_module_override` but closer to the dependency spec.\n\nFor instance:\n\n    $v-\u003eget_dist_override('PathTools')\n\nEmits:\n\n    virtual/perl-File-Spec\n\nBecause `Gentoo` is quirky like that.\n\n## has\\_gentoo\\_package\n\n    $v-\u003ehas_gentoo_package( 'virtual/perl-Test-Simple' )\n\nDetermines if the data file has entries mapping to `virtual/perl-Test-Simple`.\n\nThis is mostly for internal consistency tests/maintenance.\n\n## get\\_dists\\_in\\_gentoo\\_package\n\n    my @list = $v-\u003eget_dists_in_gentoo_package( 'virtual/perl-Test-Simple' )\n\nReturns a list of `CPAN` Distributions that map to this dependency.\n\n## get\\_modules\\_in\\_gentoo\\_package\n\n    my @list = $v-\u003eget_modules_in_gentoo_package( 'virtua/perl-Test-Simple' )\n\nReturns a list of modules that map to this dependency.\n\n## get\\_known\\_gentoo\\_packages\n\n    my @list = $v-\u003eget_known_gentoo_packages\n\nReturns a list of Gentoo packages for which there are known overrides.\n\n## get\\_known\\_dists\n\n    my @list = $v-\u003eget_known_dists\n\nReturns a list of `CPAN` Distributions for which there are known overrides\n\n## get\\_known\\_modules\n\n    my @list = $v-\u003eget_known_modules\n\nReturn a list of `CPAN` Modules for which there are known overrides\n\n## module\\_is\\_perl\n\nThis function determines if it is \"safe\" to assume availability\nof a given module ( or a given module and version ) without needing to\nstipulate either a virtual or a `CPAN` dependency.\n\n    -\u003emodule_is_perl( $module )\n    -\u003emodule_is_perl( $module, $min_version )\n    -\u003emodule_is_perl( \\%config, $module, $min_version )\n\nRules:\n\n- If the module is present in the override map, then it is deemed **NOT**\navailable from `Perl`, because you should be using the override instead.\n- If the module is missing on any version in the range specified, then it is\n**NOT** available from `Perl`, and you must depend on a virtual or some other\ndependency you can source.\n- If the module is marked _deprecated_ on any version in the range specified,\nthen it is assumed **NOT** available in `Perl` ( due to likely deprecation warnings\nand imminent need to start adapting )\n- If a minimum version is specified, and _any_ version of `Perl` in the range\nspecified does not satisfy that minimum, then it is assumed **NOT** available in\n`Perl` ( due to the inherent need to manually solve the issue via a virtual or a\nminimum `Perl` dependency )\n- If a minimum version is specified, and _any_ version of `Perl` in the range\nspecified is an explicit `undef`, then it is assumed **NOT** available in `Perl`,\nbecause clearly, one version of `Perl` having `undef` and another having an\nexplicit version, and needing only one of the two requires a manual dependency\nresolution.\n\nExamples:\n\n- Determine if `strict` is _implicitly_ available.\n\n        if ( $v-\u003emodule_is_perl( 'strict' ) ) {\n\n- Determine if `strict` version `1.09` is available.\n\n        if ( $v-\u003emodule_is_perl( 'strict' =\u003e '1.09' ) ) {\n\n    This will of course return `undef` unless `min_perl` is at least `5.21.7`.\n\n    Thus, if your support range is 5.18.0 to 5.20, and somebody stipulates that minimum,\n    you will have to declare a dependency on `Perl` 5.21.7.\n\n    Even if your support range is 5.18.0 to 5.22.0, you will still have to declare a\n    dependency on 5.21.7 instead of assuming its presence.\n\n- Determine if `strict` version `1.09` is available on X to Y `Perls`.\n\n    For most code where the support range is fixed, this will be unnecessary,\n    and changing the defaults via `-\u003enew( min_perl =\u003e ... , max_perl =\u003e ... )`\n    should be sufficient.\n\n    However:\n\n        if( $v-\u003emodule_is_perl( { min_perl =\u003e '5.21.7', max_perl =\u003e '5.21.9' }, 'strict', '1.09' ) ) {\n            # true\n        }\n\n# ATTRIBUTES\n\n## max\\_perl\n\n    -\u003enew( max_perl =\u003e '5.20.2' )\n    -\u003emax_perl # 5.20.2\n\nStipulates the default maximum `Perl` for [`module_is_perl`](#module_is_perl).\n\n## min\\_perl\n\n    -\u003enew( min_perl =\u003e '5.20.2' )\n    -\u003emin_perl # 5.20.2\n\nStipulates the default minimum `Perl` for [`module_is_perl`](#module_is_perl).\n\n# AUTHOR\n\nKent Fredric \u003ckentnl@cpan.org\u003e\n\n# COPYRIGHT AND LICENSE\n\nThis software is copyright (c) 2017 by Kent Fredric \u003ckentfredric@gmail.com\u003e.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentnl%2Fgentoo-util-virtualdepend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkentnl%2Fgentoo-util-virtualdepend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentnl%2Fgentoo-util-virtualdepend/lists"}