RyanGreenup / cadmus

Shell Scripts to Facilitate Effective Note Taking
168 stars 7 forks source link

AUR pkg #2

Closed danimateo closed 4 years ago

danimateo commented 4 years ago

Hey, nice repo you have here. What do you think about an AUR pkg? I can try and make it. Some other installers would also be nice.

RyanGreenup commented 4 years ago

Yeah I think an AUR package would be great!

I wanted to actually make one because it would be an easier way than managing all the dependencies but I've just never done it before. (I do use Arch btw :rofl: )

I would love some help with doing that.

I all the code in bin/cadmus script has a global variable script_dir, it then tries to call each other script relative to that directory, I did it that way because it made it more portable.

Also for reference I did today write a quick installer in install.sh which essentially clones the repo to .cadmus, symlinks the binary to ~/.local/bin and then prints out missing dependencies, but I think we should try and get something on AUR.

RyanGreenup commented 4 years ago

Some other notes on this.

I wrote cadmus find and cadmus search alongside cadmus and so they represent generally what I think the code base should look like, everything else I wrote piecemeal over the last 18 months and I intend to clean it up in between classes.

I'm more than open to advice on how to restructure code because my area is Math/DataSci, not so much programming.

RyanGreenup commented 4 years ago

So I started working on a preliminary PKGBUILD here, it's still a WIP and I'm going to copy/paste some of the TODO notes I made in there for discussion sake, I'd love input.

# TODO hmm, the config file would probably have to go in ~/.config/cadmus/config.json for this to work well.
# TODO Need to fix file system permissions error
# TODO I need to have a centralised list of dependencies, currently they are listed in:
#
#    1. README
#    1. Install.sh
#    1. This MakePkg
#        1. up in the depends Array
#        1. here in the depArray warning
# TODO Should I be installing everything to ~/.cadmus or should I throw all the scripts into /usr/bin?
# 
# 
# PROS; the portability is convenient and motivates users to look at the scripts
#         and investigate them
# PROS; the portability means I don't have to package for other distros
# 
# CONS; maybe having the individual scripts in /usr/bin would be simpler to install 
# CONS; maybe having the individual scripts in PATH would be better for users
# 
}
danimateo commented 4 years ago

how about a symlink in .cadmus to /usr/bin? I think it keeps all the pros and cons

RyanGreenup commented 4 years ago

Yeah I think that could work, the only other issues are:

  1. The user doesn't have permission to rm -r ~/.cadmus because pacman put it there
  2. The config would have to be moved anyway.
    1. How would this work for multiple configs

So does it even make sense to have everything in one folder?

Hopefully I'll get some time in a couple of days to play with it some more, but I'll need to have a think about config files like which I'll track in #11, @danimateo I'd love input on #11.

danimateo commented 4 years ago

Yeah check #11 I think it answers this as well

RyanGreenup commented 4 years ago

The config has been moved to ~/.config, so now I just need to play around with the PKGBUILD and we'll be able throw it on AUR.

For the moment it'll all be contained in ~/.cadmus (but for the config) but perhaps as time goes on we can have two branches, portable and installed :shrug:

RyanGreenup commented 4 years ago

cadmus is available on the AUR !! :).

The config will run from ~/.config/cadmus/config.json but the script should generate one and using read -e means there is autocomplete.

@danimateo Can you try and install from AUR and tell me if it all works?

RyanGreenup commented 4 years ago

Actually a user just made a deletion request, I'm not sure why though, I've made a comment on the AUR, one of the reasons was is in no way helpful to the end user so that sucks.

RyanGreenup commented 4 years ago

So it seems that we overlooked the fact that packages cannot land in $HOME, we'll have to modify this.

It appears that /usr/bin is a flat directory so that's not gonna be a simply modification, but, it is in "$PATH so it won't be too difficult to modify the code.

It's just now I'm going to have two branches, one for the makepkg and another for a portable package which is a PITA.

RyanGreenup commented 4 years ago

Hmmm, it seems that we could just use /opt/cadmus and we'd still be within the guidelines.

More over if I make a specific release I won't have to rename either.

RyanGreenup commented 4 years ago

Yeah the makepkg now builds to /opt I like that because it makes it easier for a user to copy the whole directory out and modify it and change it and adopt it.

The source also targets a release so the deletion request should be rejected.

If is deleted I'm definitely not going to go through the effort though, given that my submission was met with hostility rather than enthusiasm it's not something I'm going to waste my time on.