Pakku
- A Package Manager for Raku
Because TMTOWTDI
When she become a fully grown butterfly. currently Pakku
is at larva.0 version and growing. She can do basic stuff but still little clumsy!
Light as a ๐ฆ, Colorful as a ๐ฆ
Pakku
installs herself in a custom CompUnit::Repository
outside of Raku
's default repos.
Requires git
to be available in $PATH
git clone https://github.com/hythm7/Pakku.git cd Pakku # install to home directory ./tools/install-pakku.raku # or to different destination # ./tools/install-pakku.raku --dest=/path/to/pakku # if you prefer a ready to use distribution: # wget https://github.com/hythm7/Pakku/raw/master/distribution/Pakku-larva.0.txz # tar xf Pakku-larva.0.txz # Pakku location: .pakku/bin/pakku
- Add distribution
- Remove distribution
- List distribution
- Build distribution
- Test distribution
- Download distribution
Pakku
is shy butterfly, she is a bug of little words, So every Pakku
command result will be one of:
Ofun
- Desired operation completed successfullyNofun
- Desired operation did not complete successfullyAll Good
- Nothing to be done (eg. removing uninstalled distribution)
Of course unless Pakku
panicked and she doesn't know what to do, then you will be greeted with an Exception
However Pakku
can be really talkative when need be. She suggests her new friends set the verbosity level to at least info
specially when adding a Distribution
with many dependencies or multiple Distribution
s at once.
Add distribution
pakku add MyModule pakku add nodeps MyModule pakku add notest MyModule pakku add into /opt/MyApp MyModule pakku add force into home MyModule1 MyModule2 Options: deps โ add dependencies nodeps โ dont add dependencies deps requires โ add required dependencies only deps recommends โ add required and recommended dependencies deps only โ add dependencies only build โ build distribution nobuild โ bypass build test โ test distribution notest โ bypass test force โ force add distribution even if installed noforce โ no force into <repo> โ add distribution to repo <home site vendor core /path/to/MyApp>
Remove distribution
pakku remove MyModule Options: from <repo> โ remove distribution from provided repo only
List distribution
pakku list pakku list MyModule pakku list local MyModule pakku list remote MyModule pakku list details MyModule pakku list repo home pakku list repo /opt/MyApp MyModule Options: local โ list local remote โ list remote details โ list details repo <name> โ list repo
Build distribution
pakku build MyModule pakku build .
Test distribution
pakku test MyModule pakku test ./MyModule
Pakku Options
pakku update add MyModule pakku noupdate add MyModule pakku dont add MyModule pakku nopretty add MyModule pakku verbose trace add MyModule pakku pretty please remove MyModule Options: update โ update ecosystem to get latest before adding distribution pretty โ colorfull butterfly nopretty โ no color dont โ do everything but dont do it verbose <level> โ verbose level <silent trace debug info warn error fatal> please โ be nice to the butterfly, she will be nice to you (TBD)
Check distribution (download)
pakku check MyModule
Print Help
pakku pakku add pakku help pakku help list pakku help help
Most of Pakku
commands and options can be written in shorter form, for example:
add โ a update โ u noupdate โ nu silent โ ยซS 0ยป remove โ r pretty โ p nopretty โ np trace โ ยซT 1ยป list โ l deps โ d nodeps โ nd debug โ ยซD 2ยป build โ b force โ f noforce โ nf info โ ยซI 3ยป test โ t verbose โ v details โ d warn โ ยซW 4ยป check โ c local โ l local โ l error โ ยซE 5ยป help โ h remote โ r remote โ r fatal โ ยซF 6ยป
So this is a valid Pakku
command:
pakku nu vD a f nt MyModule
Did I mention that the below are Pakku
commands as well?
pakku ๐ โณ โ ๐ ๐จ MyModule pakku ๐ ๐ฆ โ MyModule pakku โช ๐ pakku โ
Can you guess what they do? A full list is here,You can add you favourite ones too if you like.
All options can be set in command line or in the config file pakku.cnf in installtion dir. Config file example is provided below:
### Pakku Config # <pakku> # update # update ecosystem # pretty # colors # verbose info # < 0 1 2 3 4 5 6 > # dont # dont do it (dry run) # # <add> # deps # add deps as well < deps nodeps only requires recommends > # build # build < build nobuild > # test # test < test notest > # force # force install < force noforce > # into home # install into specific repo # # <remove> # from home # remove from specific repo # # <list> # local # local dists # remote # remote dists # details # list details # # custom Log colors, also override unicode # if symbols not showing # <log> # trace name T: # debug name D: # info name I: # warn name W: # error name E: # fatal name F: # # trace color reset # debug color green # info color blue # warn color yellow # error color magenta # fatal color red # Add your own source provided it contains # a valid list of distributions meta files <source> https://raw.githubusercontent.com/hythm7/raku-ecosystem/master/resources/ecosystem.json
Pakku
ecosystem source is a github file that contains available modules in p6c
and cpan
. Its LTA, slow and doesn't scale well (needs to download the file and parse it).
Ideally there need to be an online Recommendation Manager service which can be used by Raku
's package managers to send a request for a Distribution
and get back json
contains the Distribution
's META
along with it's dependencies.
Working on such online Recommendation Manager will take time and I wanted to release Pakku
sooner. I might work on such Recommendation Manager after Pakku
becomes little more stable.
-
%?RESOURCES
is not available inside a custom repo during the testing phase, might cause test failure for some modules, see here for more info. as temporary workaround you can bypass tests if it failed in custom repo installation. -
There is version of
File::Directory::Tree:ver<0.000.001>
in the ecosystem it'ssource-url
points to a different versionFile::Directory::Tree:ver<*>
, This causes an issue forPakku
ifFile::Directory::Tree:ver<*>
is already installed, firstPakku
will see a different version, but when getsource-url
and start installing an error will be thrown that this version is already installed. as a temp workaround useforce
- Write more tests
- Fix bugs
- Redo things if a better way revealed to me
- Improve the performance to live up to the motto
Currently Pakku
Works on GNU/Linux, Unfortunately I don't have access to Windows or Mac machine to test and make it compatible with different Operating Systems. However, PRs are very welcome :)
Thanks to Panda
and Zef
, for Pakku
inspiration.
also Thanks for the nice #perl6
and #raku
community.
Haytham Elganiny elganiny.haytham at gmail.com
Copyright 2019 Haytham Elganiny
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.