alistair7 / imlib2-jxl

JPEG XL loader for imlib2
BSD 3-Clause "New" or "Revised" License
9 stars 2 forks source link

Arch PKGBUILD #1

Closed DavidBuchanan314 closed 3 years ago

DavidBuchanan314 commented 3 years ago

I wrote the following PKGBUILD to make installation easier on Arch:

# Maintainer: TODO

# Basde on PKGBUILD-git - https://github.com/jamesan/linux-templates/blob/master/PKGBUILD-git
# template for writing a PKGBUILD file with a git VCS source

# Copyright 2014 James An

# THIS PROGRAM is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

_pkgname=imlib2-jxl
pkgname="$_pkgname-git"
pkgver=r8.baa0155
pkgrel=1
pkgdesc="JPEG XL loader for imlib2"
arch=('any')
url="https://github.com/alistair7/$_pkgname"
license=('BSD')
depends=()
makedepends=('git' 'imlib2' 'libjxl' 'lcms2')
provides=("$_pkgname")
conflicts=("$_pkgname")
options=()
install=
source=("$_pkgname"::"git+https://github.com/alistair7/$_pkgname.git")
md5sums=('SKIP')

pkgver() {
    cd "$_pkgname"
    (
        set -o pipefail
        git describe --long --tag | sed -r 's/([^-]*-g)/r\1/;s/-/./g' ||
        printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
    )
}

build() {
    cd "$_pkgname"
    make
}

package() {
    cd "$_pkgname"
    install -Dm 644 jxl.so $pkgdir`pkg-config imlib2 --variable=libdir`/imlib2/loaders/jxl.so
}

I based this off a GPL-licensed template. To be honest, I'm not sure the GPL license really matters for such a trivial file - if you wanted to relicense it, I personally wouldn't mind. Consider my modifications to the template to be permissively licensed.

alistair7 commented 3 years ago

Thanks! I'll happily adopt that. (Or send me a PR if you want your name on the commit :) ) As far as I'm concerned it can stay GPL'd - shouldn't be an issue as it's separate from the rest of the code.

At some point I'll tag a v0.1 release so that it doesn't have to hang off a random commit.

zielony12 commented 3 years ago

nice

DavidBuchanan314 commented 3 years ago

@alistair7 I'm too lazy to PR, feel free to manually merge it :)

dllud commented 2 years ago

@DavidBuchanan314 thanks a lot for the PKGBUILD. I see that you did not add it to AUR. Any reason why?

IMHO the PKGBUILD would sit better in AUR than here in the project repo. Better keep packaging de-coupled from the source code, as done virtually everywhere.

dllud commented 2 years ago

@alistair7 I see that you're maintaining the PKGBUILD (e.g. 0ec7c482b248c1bcea12b574e1f0838a0afe5bec). As such, could you please add it to AUR? That would make it much easier to install and keep up-to-date, as we can then use an AUR helper.

You could add both a versioned package (imlib2-jxl) and a git one (imlib2-jxl-git).

I was thinking about adding them to AUR myself but I guess it would be counterproductive as you're maintaining the PKGBUILD.

alistair7 commented 2 years ago

I am accidentally maintaining a PKGBUILD, and I agree that AUR is where it belongs. So with the small caveat that I don't really know what I'm doing, I'll add a package there.

dllud commented 2 years ago

Nice. Thanks @alistair7 !

IMO you should remove the PKGBUILD from the source code once in AUR.

It should be easy for you to put them in AUR. The current PKGBUILDs require just a few modifications. E.g.:

You'll find loads of examples in AUR itself and in the Arch Wiki docs. If you would like to, I can review the PKGBUILDs, for instance once you push the first version to AUR.