Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add to the AUR #20

Open
deter0 opened this issue Jul 26, 2022 · 29 comments
Open

Add to the AUR #20

deter0 opened this issue Jul 26, 2022 · 29 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@deter0
Copy link
Owner

deter0 commented Jul 26, 2022

No description provided.

@deter0 deter0 added enhancement New feature or request help wanted Extra attention is needed labels Aug 22, 2022
@alba4k
Copy link
Contributor

alba4k commented Aug 23, 2022

I can do this

The PKGBUILD would probably look like this:

# Maintainer: alba4k <blaskoazzolaaaron@gmail.com>
pkgname=xborder-git
pkgver=3.0.r48.68cb3bf
pkgrel=1
pkgdesc="Active window border replacement for window managers. "
arch=(x86_64)
url="https://github.com/deter0/xborder"
license=('Unlicense')
makedepends=(git)
depends=('python-cairo' 'libwnck3' 'gtk3')
source=("git+$url")
md5sums=('SKIP')

pkgver() {
    cd xborder
    printf "$(cat version.txt).r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
    cd xborder
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"
    install -Dm644 README.md "$pkgdir/usr/share/doc/${pkgname}/README.md"
    chmod +x xborders
    install -Dm644 xborders "$pkgdir/usr/bin/xborders"
    echo -e "\e[33m\e[1mREMINDER\e[0m: Please add \"role  = 'xborder'\" to the blur-background-exclude section in the configuration file for your compositor!"
}

And the .SRCINFO would look like this:

pkgbase = xborder-git
        pkgdesc = Active window border replacement for window managers.
        pkgver = 3.0.r48.68cb3bf
        pkgrel = 1
        url = https://github.com/deter0/xborder
        arch = x86_64
        license = Unlicense
        makedepends = git
        depends = python-cairo
        depends = libwnck3
        depends = gtk3
        source = git+https://github.com/deter0/xborder
        md5sums = SKIP

pkgname = xborder-git

The main question I'd ask myself is:
@deter0 , would it be OK for you if I mantained an AUR package named xborder? I'm currently using the description you provided for the github repository? please also double check the package version (I'm currently using version.txt and adding some git info)

Also, I'm currently using gtk3 as dependency for archlinux, since I guess that what most people probably already have installed. Should I use something else? Should I maybe add some architectures other than arm64? Any other reccomendations? For what I'm concerned, the package could go online even like this.

It would also maybe be better to curl the single files from raw.githubusercontent.com, and remove the git make dependency, but it's way easier like this

@deter0
Copy link
Owner Author

deter0 commented Aug 23, 2022

Yes it would be great if you maintained it! Yes the package version will always be package.txt. But could you rename it xborders naming it xborder was a mistake and I changed it. Yes gtk3 is fine. I don't know about multiple architectures, how would that work? Also git is fine, anyone who has installed arch linux probably has git installed, it is needed for installing a bunch of stuff so it shouldn't be a problem

@alba4k
Copy link
Contributor

alba4k commented Aug 24, 2022

lmao, I just realized I forgot a dependency on python (minor issue, since it would still be installed with python-pycairo, but it doesn't hurt to leave it explicit)

I will get it upstream as soon as possible, which will probably mean saturday

as for multiple architectures, it should be fine with python, but it would need testing, so I'll leave x64 atm

@ZappaBoy
Copy link
Contributor

ZappaBoy commented Aug 24, 2022

I'm very sorry, I read this issue too late. I thought no one had thought of it yet.

I have already added the project to the AUR as xborder-git.
I was just creating an issue to ask if anyone else would like to be a maintainer before reading this.

@deter0 @alba4k I can disown the package if some of you are interested so you can get the maintainer status on the package. Otherwise, you can create another AUR package as xborder but I think that is a bit useless.

@alba4k
Copy link
Contributor

alba4k commented Aug 24, 2022

problem is, now we can't rename it

@ZappaBoy
Copy link
Contributor

problem is, now we can't rename it

I don't think you need to rename it: following the AUR guidelines the package name is correct due to the build being made directly from the source.

When I created the package on the AUR I precisely thought of not naming it xborder as there might be actual releases in the future and the name would be up to that.

@alba4k
Copy link
Contributor

alba4k commented Aug 24, 2022

what I mean is: @deter0 was asking to name it xborders-git, plural

@ZappaBoy
Copy link
Contributor

what I mean is: @deter0 was asking to name it xborders-git, plural

I understand now, however, if you think that is required I can create a deletion request from the AUR.

@deter0
Copy link
Owner Author

deter0 commented Aug 24, 2022

I mean it's not that big of a deal, xborder-git is fine. But there are some problems with the package
image

@deter0
Copy link
Owner Author

deter0 commented Aug 24, 2022

Maybe I can do a fix to find version.txt somewhere else, but it would be better to fix the AUR package instead of patch it

@ZappaBoy
Copy link
Contributor

I mean it's not that big of a deal, xborder-git is fine. But there are some problems with the package image

This is related to this line:

version_file = open(our_location + "/version.txt", "r")

Is not a problem with the AUR package. I mean In the PKGBUILD I can move the version.txt in /usr/bin so the command --version works but the /usr/bin directory is intended for the executables, not for other files.

You should change the way you print the version or change the directory in which version.txt is read.
My advice is to insert it directly in the code (xborders) instead of in the version.txt file.

However, as I said I can disown the package and leave it to you.

@deter0
Copy link
Owner Author

deter0 commented Aug 24, 2022

Yes can you tell me how to become maintainer of the package?

@ZappaBoy
Copy link
Contributor

Yes can you tell me how to become maintainer of the package?

I think that the best way is to initially add you as a co-maintainer and after that, I will promote you as a maintainer or simply disown the package so you will become the only maintainer.
I can also add @alba4k if is needed and if you agree I can remain co-maintainer to support the package.

So I need to know which is your AUR username.

@alba4k
Copy link
Contributor

alba4k commented Aug 25, 2022

would be fine for me, not really my decision

I can mantain this if needed, would really not be an issue on my side

https://aur.archlinux.org/account/alba4k

@ZappaBoy
Copy link
Contributor

would be fine for me, not really my decision

I can mantain this if needed, would really not be an issue on my side

https://aur.archlinux.org/account/alba4k

Added. I think more is better.

@ZappaBoy
Copy link
Contributor

ZappaBoy commented Aug 25, 2022

Maybe I can do a fix to find version.txt somewhere else, but it would be better to fix the AUR package instead of patch it

Offtopic
If you want to keep the version.txt file my advice is to place it in ~/.config/xborders/ along with the config.json.
This is exactly what I've done to exec xborders on startup using i3:

# Last line in ~/.config/i3/config
exec --no-startup-id xborders --config $HOME/.config/xborder/config.json --disable-version-warning

@seocamo
Copy link

seocamo commented Aug 25, 2022

--disable-version-warning dont work, it still notify me with ERROR: xborders couldn*t get latest version!
so that is not a fix for this, can the version.txt and the update_ignore.txt be move to .cache/xborder/

@deter0
Copy link
Owner Author

deter0 commented Aug 25, 2022

For version.txt can't we place it in ~/.local/share/xborders and all other files needed?

@deter0
Copy link
Owner Author

deter0 commented Aug 25, 2022

package() {
	cd xborder
	mkdir $pkgdir/opt/xborders -p
        install -Dm644 * $pkgdir/opt/xborders -v

	printf "#!/bin/sh\npython3 /opt/xborders/xborders \$@\n" >> xborders-ln
	chmod +x xborders-ln
	install -Dm+xr xborders-ln "$pkgdir/usr/bin/xborders"
}

Can we not do something like this?

@deter0
Copy link
Owner Author

deter0 commented Aug 25, 2022

I tested it seems fine, only problem would be when I create files in the xborders directory. I only do this for ignoring version update notification, but I can just check if we're installed by AUR to disable the updates.

@alba4k
Copy link
Contributor

alba4k commented Aug 27, 2022

checking if installed by aur would be easily done by putting a echo aur > /opt/xborders/source and checking the file content, or something similar (e.g. toch /opt/xborders/aur)

or, better but slower, using libalpm, but I'm not sure how we would go on that in python, maybe it would just be worth it to directly run pacman -Q xborders-git and check if the package seems to be installed (since pacman is really fast, this shouldn't take more than ~10ms, and just when launching, so it should be fairly acceptable. using alpm wouldn't result in a huge performance gain)

@deter0
Copy link
Owner Author

deter0 commented Aug 27, 2022

Can we not check the path of executable? and if it's in /opt/ we can determine its installed by AUR

@alba4k
Copy link
Contributor

alba4k commented Aug 27, 2022

we could, but I often put stuff in /opt when it would belong there, even if I didn't install it trough the package manager (since that's where it would belong)

I doubt someone would crete something like a file named aur just because

@ZappaBoy
Copy link
Contributor

ZappaBoy commented Aug 28, 2022

Sorry but I don't understand why you need a file to store the version. Why you can't simply create a constant directly in the script?

@alba4k
Copy link
Contributor

alba4k commented Aug 28, 2022

you mean by modifying in the pkgbuild?

@ZappaBoy
Copy link
Contributor

ZappaBoy commented Aug 28, 2022

you mean by modifying in the pkgbuild?

No, I mean in the xborders script.
Simply changing from this:

xborder/xborders

Lines 48 to 55 in fa50c90

def get_version():
our_location = os.path.dirname(os.path.abspath(__file__))
version_file = open(our_location + "/version.txt", "r")
our_version_string = version_file.read()
version_file.close()
return float(our_version_string)

To this:

VERSION = 3.1
...
def get_version():
    return VERSION

And completely remove the version.txt file.

I created a pull request if you agree with my solution: #35

@alba4k
Copy link
Contributor

alba4k commented Aug 29, 2022

then yes, obviously

I mean how would be go on detecting if the script was installed from the aur or not?

@ZappaBoy
Copy link
Contributor

ZappaBoy commented Aug 29, 2022

then yes, obviously

I mean how would be go on detecting if the script was installed from the aur or not?

Why do you need to know that?

@alba4k
Copy link
Contributor

alba4k commented Aug 30, 2022

as mentioned by @deter0 , most people install packages out of the aur trough an aur helper, so it might be useful to avoid checking for updates if the program is already being managed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants