poetaman/arttime

AUR package

notjedi opened this issue ยท 10 comments

please submit a PKGBUILD to the Arch User Repository if possible.

@notjedi Contributions are welcome, I wouldn't know how to do that. Would you like to contribute to AUR?

The files are already stored in unix directories where they should go, except perhaps license files which need to go somewhere... We can co-ordinate the release of AUR PKGBUILD if you volunteer.

I've added it to the AUR https://aur.archlinux.org/packages/arttime-git

Would be nice if somebody can confirm whether everything works as expected, since I never used the program before and only checked if it starts.

@poetaman myapp-git AUR packages are meant to be rebuild by the user when they want. It automatically fetches the latest git main branch state. A non -git version that is synced with your releases can be added either by somebody else, or (more meaningfully) it can be done through github actions (I can help you with that if you want, let me know)

@deckweiss Thanks! I am traveling today, will be able to test it tomorrow. I wouldn't know anything about AUR, and its systems you talk about. So far I have been keeping the main branch clean, though we can add the GitHub action if you see value in it and feel motivated.

i tried downloading the package from AUR, seems to work fine for me.

@deckweiss Works, though might need two updates. Arttime has some recommended dependencies to be installed:

  1. zsh >= 5.7
  2. extra/libnotify for desktop notifications
  3. core/less for navigation of help pages (default more is less powerful)
  4. core/diffutils for systems where /etc/localtime is not a symlink and arttime needs to guess the timezone, for which it uses cmp. Note: this is odd that it is not in the base system as cmp is anyway mandatory in POSIX.
  5. extra/vorbis-tools for sounds in case user has not installed pulseaudio or pipwire. arttime cares about paplay command, not the underlying daemon. If paplay is not found, it does a fallback on ogg123 of vorbis-tools. I think it might be a good idea to keep this as a fallback dependency.

Arttime's installer does not install any of these dependencies, but prints useful messages for the user for each. Then it's up to the user to install. I am not sure what would be the best strategy for AUR. On one hand I would like least users to have trouble with the app, on the other I would like to keep their disk utilization low. For some reason the installation size for vorbis-tools was high in arch docker image (as it installed a bunch of its own dependencies), while it was extremely tiny on my up-to-date Arch machine. If we can confirm that it's tiny on a reasonable machine, then let's just install vorbis-tools.

Lastly, it would be nice to change the description on AUR page to something like following:

arttime is a feature-rich clock, timer, time manager, ASCII/ANSI/PETSCII/Unicode text-art and animation/storyboard viewer that comes with a library of curated quality text-art. Among other things, it allows you to quickly create your own time management programs and expressive timers. For more information, please visit it's GitHub homepage and wiki.

@poetaman thank you, will fix later!

@poetaman

  • I've added the version to the zsh dependency
  • Added libnotify, diffutils and vorbis-tools as optional dependencies with a description of what they are needed for, so the user can decide themselves whether to install them.
  • less comes preinstalled on arch (as dependency of the base package)

The description of the package is recommended to be 80 characters or less, it is important to use keywords wisely to increase the chances of appearing in relevant search queries.
(The limit is soft, there is a harder limit, where you can not push it to the repos anymore, but I am not sure how many characters that is. Your provided description didn't fly.)

So for now I rewrote it to:

arttime is a clock, timer, time manager and text-art viewer for the terminal (https://github.com/poetaman/arttime/wiki)

If you have any suggestions, let me know :)


just fyi, the reasoning on why I decided to package it the way I did.

I tried to use your installer to install everything to the arch recommended paths. ./install.sh -p /usr/share/ --zcompdir /usr/share/zsh/site-functions

But decided to circumvent it for now, as it modified the users .bashrc / .zshrc file.
AUR packages should generally not modify anything in the users home.
Additionally as it is, the PATH export is broken due to the install process of AUR packages:

A package first gets "installed" to a temporary directory, then packaged as a .pkg file and then installed the same as any other arch package.

# Following line was automatically added by arttime installer
export PATH=/home/deckweiss/Projects/arttime-git-AUR/pkg/arttime-git/usr/local//bin:$PATH

Additionally I have found that there is a hardcoded relational path in the arttime "binary"
exec zsh -fi ${0:a:h}/../share/arttime/src/arttime.zsh "$@"

The outcome for anybody that needs to have an overview in the future:

usr
โ”œโ”€โ”€ bin
โ”‚   โ”œโ”€โ”€ artprint
โ”‚   โ””โ”€โ”€ arttime
โ””โ”€โ”€ share
    โ”œโ”€โ”€ arttime
    โ”‚   โ”œโ”€โ”€ keypoems/...
    โ”‚   โ”œโ”€โ”€ src/...
    โ”‚   โ””โ”€โ”€ textart/...
    โ”œโ”€โ”€ licenses
    โ”‚   โ””โ”€โ”€ arttime/...
    โ””โ”€โ”€ zsh
        โ””โ”€โ”€ site-functions
            โ”œโ”€โ”€ _artprint
            โ””โ”€โ”€ _arttime

@deckweiss Thanks! A few observations/questions:

  1. Is there a reason why the zsh version you selected is >=5.8 instead of >=5.7?
  2. Is there a way to prompt the user to install those dependencies instead of just printing them at the end? My concern is that people are going to miss it as the installer return status is 0. Or perhaps we can be more conservative for smaller dependencies...
  3. Is there a reason why /usr/share for zsh completions vs /usr/local/share for arttime? On both of my Mac and Arch Linux machines zsh -dfi -c 'printf "%s\n" "$fpath[@]"' has /usr/local/share/zsh/site-functions/ by default in fpath.

Description looks good now :)

Yes, the hardcoded relational path was a recent change. As you would know there is no POSIX complaint way to pass options to an interpreter launched by /usr/bin/env (as env considers all that follows as single word). There is a non-standard -S option in recent GNU coreutils and in BSD (which serves macOS too), but it is non-standard. At first I considered adding arttime.zsh to the same bin directory (without chmod +x), but zsh completion framework on one of my machine completes all files in bin directory irrespective of whether they are executable or not. That would have led to confusion for users who use such completion frameworks. Also, unfortunately zsh does not allow shell to become interactive after it has been launched, so at least -i needs to be passed at launch time.

@poetaman Thanks for the feedback

  1. I was sleepy and mistyped, good catch! Will fix.
  2. AUR users are expected to read the PKGBUILD file before installing, but even if they do not, many of the AUR helper utilities either show or prompt the optional dependencies. I think it makes sense to have the dependencies as optional for the following reasons:
  • diffutils might be entirely unnecessary on arch if the only reason is to guess the timezone. /etc/localtime should be always present. I've decided to leave it in just in case somebody intentionally removed the timezone for some reason.
  • vorbis-tools most desktop users would have pulse or pipewire installed.
  • libnotify some people prefer to not have notifications.
  • In all cases, I think arch users often prefer to have no 'bloat' and rather consciously configure the minimal set of optional depenencies that covers their specific needs.
  1. /usr/local/share/zsh/site-functions is in the fpath, but it does not exist on my arch system. Instead all installed programs seem to have their autocompletions in /usr/share/zsh/site-functions so it seemed to fit there better even if the other path would have worked as well. Probably arttime should be moved from /usr/local/{bin, share} to /usr/{bin, share}

Ah! I didn't consider the passing of the arguments for the launch. A way to work around it would be to modify the bin file post install. But it is no big deal anyway as far as I understand.


Edit: I added the discussed changed and also added the license files properly

@deckweiss Awesome, thanks!

To make package management simpler, I have added a new option --noupdaterc to v2.0.0. When passed, it does not update user's *rc file.

Now we can celebrate this by adding the Linux mascot Tux to arttime's repository. If you would like to be in the contributors list, feel free to open a PR with a file named linux or linuxtux in directory share/arttime/textart with following exact contents .

"Custom message for art goes here"
            a8888b.   
           d888888b. 
           8P"YP"Y88 
           8|o||o|88 
           8'    .88 
           8`._.' Y8. 
          d/      `8b. 
         dP   .    Y8b. 
        d8:'  "  `::88b 
       d8"         'Y88b 
      :8P    '      :888 
       8a.   :     _a88P 
     ._/"Yaa_:   .| 88P| 
jgs  \    YP"    `| 8P  `.
a:f  /     \.___.d|    .' 
     `--..__)8888P`._.'