Alien-Xrepo
view release on metacpan or search on metacpan
- `toolchain`
Specify a toolchain (e.g., `llvm`, `zig`, `mingw`).
- `toolchain_host`
Specify the host toolchain for cross-compilation.
- `vs`, `vs_toolset`, `vs_sdkver`
Visual Studio toolset/SDK selection (e.g., `--vs=2017`, `--vs_toolset=14.0`).
- `ndk`
The Android NDK directory.
- `sdk`
The SDK directory of a cross-toolchain.
- `mingw`
```
Lists installed packages (optionally filtered by a Lua pattern). Returns the output lines as a list.
## `download( ... )`
```perl
$repo->download( 'zlib', undef, outputdir => './dl', shallow => 1 ); # Downloads the latest version
```
Only downloads the package source archives without building them. `outputdir` selects the destination directory (default `packages`). Supports `force`, `shallow`, and the standard `%options`.
## `import_pkg( ... )`
```perl
$repo->import_pkg( 'zlib', undef, packagedir => './packages' ); # Latest zlib version
$repo->import_pkg( 'libfake', '1.0.x' ); # A particular version of this fake lib
```
Imports pre-downloaded package archives into the local cache. `packagedir` selects the source directory.
## `export( ... )`
```perl
$repo->export( 'zlib', undef, packagedir => './packages', shallow => 1 ); # Export the latest version
```
Exports installed package files for offline use. `packagedir` selects the destination directory.
## `env( [ ..., [ ... ] ] )`
```perl
$repo->env( 'bash', bind => 'zlib' ); # run a program inside the package env
$repo->env( undef, show => 1 ); # only print the environment
```
Sets up the package environment and either prints it (`show`) or executes `$program` (default `shell`) inside it. `bind` selects which environment config or package to bind, `list` lists global configs, and `add`/`remove` manage global environment co...
## `list_repo()`
```perl
my @repos = $repo->list_repo();
```
Lists all configured remote repositories (as output lines).
## `uninstall( ..., [ ... ] )`
$repo->uninstall('freetype'); # remove one package
$repo->uninstall('zl*', all => 1); # every variant matching the pattern
$repo->uninstall('fontconfig', force => 1); # remove even if still depended upon
```
Note that this edits the shared store. Unlike a builder's prune, which slims the `share` directory a distribution ships, `uninstall` frees space in the store you manage yourself.
# Third-party Package Managers
`xrepo` can install from external package managers instead of (or alongside) the official `xmake-repo`. You select the manager with a package-spec namespace and every `Alien::Xrepo` method takes it verbatim:
```perl
# Vcpkg, Homebrew/Linuxbrew, Conan
my $zlib = $repo->install( 'vcpkg::zlib' );
my $zlib = $repo->install( 'brew::zlib' );
my $zlib = $repo->install( 'conan::zlib/1.2.11' );
# Pacman (archlinux/msys2), Clib, Dub, Cargo, Conda, apt
$repo->install( 'pacman::libcurl' );
$repo->install( 'dub::log 0.4.3' );
lib/Alien/Xrepo.pod view on Meta::CPAN
=item C<toolchain>
Specify a toolchain (e.g., C<llvm>, C<zig>, C<mingw>).
=item C<toolchain_host>
Specify the host toolchain for cross-compilation.
=item C<vs>, C<vs_toolset>, C<vs_sdkver>
Visual Studio toolset/SDK selection (e.g., C<--vs=2017>, C<--vs_toolset=14.0>).
=item C<ndk>
The Android NDK directory.
=item C<sdk>
The SDK directory of a cross-toolchain.
=item C<mingw>
lib/Alien/Xrepo.pod view on Meta::CPAN
my @installed = $repo->scan( 'libpng' );
my @all = $repo->scan();
Lists installed packages (optionally filtered by a Lua pattern). Returns the output lines as a list.
=head2 C<download( ... )>
$repo->download( 'zlib', undef, outputdir => './dl', shallow => 1 ); # Downloads the latest version
Only downloads the package source archives without building them. C<outputdir> selects the destination directory (default C<packages>). Supports C<force>, C<shallow>, and the standard C<%options>.
=head2 C<import_pkg( ... )>
$repo->import_pkg( 'zlib', undef, packagedir => './packages' ); # Latest zlib version
$repo->import_pkg( 'libfake', '1.0.x' ); # A particular version of this fake lib
Imports pre-downloaded package archives into the local cache. C<packagedir> selects the source directory.
=head2 C<export( ... )>
$repo->export( 'zlib', undef, packagedir => './packages', shallow => 1 ); # Export the latest version
Exports installed package files for offline use. C<packagedir> selects the destination directory.
=head2 C<env( [ ..., [ ... ] ] )>
$repo->env( 'bash', bind => 'zlib' ); # run a program inside the package env
$repo->env( undef, show => 1 ); # only print the environment
Sets up the package environment and either prints it (C<show>) or executes C<$program> (default C<shell>) inside it. C<bind> selects which environment config or package to bind, C<list> lists global configs, and C<add>/C<remove> manage global environ...
=head2 C<list_repo()>
my @repos = $repo->list_repo();
Lists all configured remote repositories (as output lines).
=head2 C<uninstall( ..., [ ... ] )>
$repo->uninstall( 'zlib' );
lib/Alien/Xrepo.pod view on Meta::CPAN
my $repo = Alien::Xrepo->new;
$repo->uninstall('freetype'); # remove one package
$repo->uninstall('zl*', all => 1); # every variant matching the pattern
$repo->uninstall('fontconfig', force => 1); # remove even if still depended upon
Note that this edits the shared store. Unlike a builder's prune, which slims the C<share> directory a distribution ships, C<uninstall> frees space in the store you manage yourself.
=head1 Third-party Package Managers
C<xrepo> can install from external package managers instead of (or alongside) the official C<xmake-repo>. You select the manager with a package-spec namespace and every C<Alien::Xrepo> method takes it verbatim:
# Vcpkg, Homebrew/Linuxbrew, Conan
my $zlib = $repo->install( 'vcpkg::zlib' );
my $zlib = $repo->install( 'brew::zlib' );
my $zlib = $repo->install( 'conan::zlib/1.2.11' );
# Pacman (archlinux/msys2), Clib, Dub, Cargo, Conda, apt
$repo->install( 'pacman::libcurl' );
$repo->install( 'dub::log 0.4.3' );
( run in 0.975 second using v1.01-cache-2.11-cpan-e623d60df62 )