Some time we face special cases for download source code...
For example we might need to clone and checkout a repo for build,
or the source tar ball has a name like MY_PROJECT_NAME_0_18_9.tar.gz
or we have to build-repackage deb,rpm, AppImage etc...
Other case we have to create a package.desktop or when we download package-version.tar.?z and extract it, we dont see a folder package-version to cd in and build but we see direclty project's files-fodlers.
All these not often happens, but happens.
athos can face most of these cases, but in order to do it pkg.ini has to mention them.
Examples:
- To git clone and git url in SRCURL and mention that
COMPRESS=git
If you also want to git checout then add one lineGITCHEK="12345qwer4321sdfg"
- If source name is something like
MY_PROJECT_NAME_0_18_9.tar.gz
then in SRCNAM type all this ugly nameSRCNAM=MY_PROJECT_NAME_0_18_9
and ofcource inCOMPRESS=tar.gz
- For deb, rpm etc mention in
COMPRESS="deb"
and if needed also add one lineBIN_PKG=YES
BIN_PKG=YES
needed for sure when try build a package whichsource.tar.?z*
after extracted output provide directly the files/folders of source.- For package.desktop things are very simple just create a desktop_entry function and call it in pkg build, example:
desktop_entry() {
mkdir -p "$PKG"/usr/share/applications
cat <<EOF > "$PKG"/usr/share/applications/aegisub.desktop
[Desktop Entry]
Version=1.0
Name=Aegisub
GenericName=Subtitle Editor
Comment=Aegisub AppImage repackage
Type=Application
PATH=/usr/local/bin/aegisub/usr/bin
Exec=sh -c "LD_LIBRARY_PATH=/usr/local/bin/aegisub/usr/lib /usr/local/bin/aegisub/usr/bin/aegisub $SHELL"
Icon=/usr/share/icons/hicolor/48x48/apps/aegisub.png
Terminal=false
Categories=AudioVideo;AudioVideoEditing;
StartupNotify=true
MimeType=application/x-srt;text/plain;text/x-ass;text/x-microdvd;text/x-ssa;
StartupWMClass=aegisub
EOF
}
desktop_entry
There is also one more very special case you probably never will need it but in some cases we are not allowed to download using wget or any other terminal command. But we can download from browser... Some remote repos yes do it :(
For this case there is an option that make athos to interact remote as browser agent.
So add in your pkg.ini these lines:
AGENT=ON
# If AGENT is ON Define the download agent or special wget option...
DOWNLOAD_AGENT () {
wget -O "aegisub-v3.3.3-x86-64.AppImage" "$SRCURL" \
--header="Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \
--header="Accept-Language: en-US,en;q=0.5" \
--user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0"
}
If you can understand what this command do then you can modify it for your needs... As I said probably you will never face it.
For the history SRCURL for the above example was this:
SRCURL="https://ocs-dl.fra1.cdn.digitaloceanspaces.com/data/files/1683370141/aegisub-v3.3.3-x86-64.AppImage?response-content-disposition=attachment%3B%2520aegisub-v3.3.3-x86-64.AppImage&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=RWJAQUNCHT7V2NCLZ2AL%2F20241103%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241103T200807Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=7e13176b2e7def3ea861cdac150e55fc851b556a888c3ac26e1b3341c4eafb68"