You are not logged in.

#1 2020-11-17 02:37:23

sentientc
Member
Registered: 2020-11-05
Posts: 7

PKGBUILD review request: eccodes-git

Hi all,
Newbie here. I copied from https://aur.archlinux.org/eccodes.git and made
https://aur.archlinux.org/eccodes-git.git
I am not sure how to set this "_attnum", and I added git clone https://github.com/ecmwf/ecbuild.git to "srcdir".
I do not know if there is a better way to do this.
Regards,
sc

Offline

#2 2020-11-17 05:29:33

Awebb
Member
Registered: 2010-05-06
Posts: 6,275

Re: PKGBUILD review request: eccodes-git

404 - Page Not Found
Sorry, the page you've requested does not exist.

Note: Git clone URLs are not meant to be opened in a browser.
To clone the Git repository of eccodes-git, run git clone https://aur.archlinux.org/eccodes-git.git.
Click here to return to the eccodes-git details page.

:-)

EDIT:

First of all, there is a package source but you've got a git package:

https://github.com/ecmwf/eccodes-git/ar … 0.0.tar.gz

That shouldn't happen.

Have you read this? https://wiki.archlinux.org/index.php/VC … guidelines

Here is a very simple example: https://aur.archlinux.org/cgit/aur.git/ … letion-git

Last edited by Awebb (2020-11-17 05:33:37)

Offline

#3 2020-11-17 07:13:48

sentientc
Member
Registered: 2020-11-05
Posts: 7

Re: PKGBUILD review request: eccodes-git

Hi,
Yes, I did not read the guidelines. Sorry about that. I made some changes and it will probably get the "most recent annotated tag" and skip the md4sum thing.
https://aur.archlinux.org/packages/eccodes-git/
Is this pkgbuild ok now?
Thanks,
sc

Offline

#4 2020-11-17 08:47:30

a821
Member
Registered: 2012-10-31
Posts: 381

Re: PKGBUILD review request: eccodes-git

Some issues I can see at a glance

line 17: The git repo will be named "eccodes" anyway, so you don't need to rename it.

lines 26-28: get rid of those lines. You do not need to clone again the repo (I guess you forgot to remove them).

Edit:
line 36: it sets INSTALL_DATAROOTDIR /usr/share/eccodes-git/definitions and not to /usr/share/eccodes/definitions as I would have expected. Is this correct?
Also. add "eccodes" to `conflict` and `provides` arrays.

Last edited by a821 (2020-11-17 08:55:51)

Offline

#5 2020-11-17 09:02:54

sentientc
Member
Registered: 2020-11-05
Posts: 7

Re: PKGBUILD review request: eccodes-git

Hi,
I see. line 17 is renaming. I copied from the wiki without knowing what it do.
for lines 26-28. this "eccodes" need "ecbuild" thing in the src directory. I am not sure it is ok if I put it in the "depend" variable as it is not a package.
I may try to put it into depend and make another package for it later tho.
Thanks,
sc

Offline

#6 2020-11-17 09:03:49

loqs
Member
Registered: 2014-03-06
Posts: 17,197

Re: PKGBUILD review request: eccodes-git

@a821 it is cloning a different repo

	git clone https://github.com/ecmwf/ecbuild.git

Needs its own package.

Missing makedepends git.

Please see CMake_package_guidelines

  sed -i 's/image.inmem_.*=.*1;//' src/grib_jasper_encoding.c

Should be drone in prepare.

Offline

#7 2020-11-17 10:26:00

a821
Member
Registered: 2012-10-31
Posts: 381

Re: PKGBUILD review request: eccodes-git

loqs wrote:

@a821 it is cloning a different repo

	git clone https://github.com/ecmwf/ecbuild.git

Needs its own package.

sentientc wrote:

this "eccodes" need "ecbuild" thing in the src directory

I see, I wasn't sure what this "ecbuild" was supposed to be as I just looked at the PKGBUILD. I thought it was a copy and paste error or something (and the first post didn't make it clear).

I agree with @logs that this needs its own package (plus his other comments).

Offline

#8 2020-11-18 03:32:28

sentientc
Member
Registered: 2020-11-05
Posts: 7

Re: PKGBUILD review request: eccodes-git

Hi,
This ecbuild does not need to compile. The github readme says it just need the following steps
1. git clone https://github.com/ecmwf/ecbuild
2. export PATH=$PWD/ecbuild/bin:$PATH
Should I make a package of it?
Regards,
sc

Offline

#9 2020-11-18 06:41:31

a821
Member
Registered: 2012-10-31
Posts: 381

Re: PKGBUILD review request: eccodes-git

You could try to add the other repo to the `sources` and symlink. Something like this

...
source=("git+$url#branch=master"
        "git+https://github.com/ecmwf/ecbuild")
md5sums=(SKIP SKIP)
...
prepare() {
    cd "${pkgname%-git}"
    ln -sf ../ecbuild .
    sed -i 's/image.inmem_.*=.*1;//' src/grib_jasper_encoding.c
    mkdir -p build
}
...
build() {
    cd "${pkgname%-git}/build"
    [ -x /usr/bin/aec ] && has_aec=1 || has_aec=0 # <- I'm not really sure about this
    cmake [ options go here ]
    make
}
...

this is completely untested and may have missed something...

Last edited by a821 (2020-11-18 06:41:55)

Offline

#10 2020-11-18 21:53:55

loqs
Member
Registered: 2014-03-06
Posts: 17,197

Re: PKGBUILD review request: eccodes-git

ecbuild-git PKGBUILD

pkgname=ecbuild-git
pkgver=3.4.1.r0.gd4347cf
pkgrel=1
pkgdesc="A CMake-based build system"
arch=('any')
url="https://github.com/ecmwf/ecbuild"
license=('APACHE')
makedepends=('git' 'cmake')
source=("$pkgname::git+https://github.com/ecmwf/ecbuild.git")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cmake -B build -S $pkgname  \
        -DCMAKE_BUILD_TYPE='None' \
        -DCMAKE_INSTALL_PREFIX='/usr' \
        -Wno-dev
  make -C build
}

package() {
  make -C build DESTDIR="$pkgdir" install
}

eccodes-git PKGBUILD

# Maintainer: simon chou <sentientcatgmaildotcom>
# Contributor: Graziano Giuliani <graziano.giuliani@poste.it>
pkgname=eccodes-git
pkgver=2020.10.1.r0.g929aee77
pkgrel=1
pkgdesc="ECMWF decoding library for GRIB, BUFR and GTS"
arch=('x86_64')
url="https://github.com/ecmwf/eccodes"
license=('Apache')
depends=('libaec' 'libpng' 'python3' 'netcdf' 'jasper' 'openjpeg')
makedepends=('gcc-fortran' 'python' 'python-numpy' 'cmake' 'git' 'ecbuild-git')
conflicts=('grib_api' 'libbufr-ecmwf')
source=("$pkgname::git+$url#branch=master")
md5sums=('SKIP')

prepare() {
  cd $pkgname
  sed -i 's/image.inmem_.*=.*1;//' src/grib_jasper_encoding.c
}

pkgver() {
  cd $pkgname
  git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cmake -B build -S $pkgname \
        -DCMAKE_BUILD_TYPE=production \
        -DCMAKE_INSTALL_PREFIX='/usr' \
        -DCMAKE_INSTALL_DATAROOTDIR=/usr/share/$pkgname/definitions \
        -DCMAKE_INSTALL_DATADIR=/usr/share \
        -DENABLE_AEC=TRUE \
        -DENABLE_PNG=TRUE \
        -DENABLE_ECCODES_THREADS=1 \
        -DPYTHON_EXECUTABLE=/usr/bin/python3 \
        -Wno-dev
  make -C build
}

package() {
  make -C build DESTDIR="$pkgdir" install
}

If libaec was not present at build time it was being flagged as not found during build so I added I changed it to depends.
Similarly for jasper.

Offline

#11 2020-11-19 02:20:26

sentientc
Member
Registered: 2020-11-05
Posts: 7

Re: PKGBUILD review request: eccodes-git

Hi,

I have made the changes according to loqs to eccodes-git.

# Maintainer: simon chou <sentientcatgmaildotcom>
# Contributor: Graziano Giuliani <graziano.giuliani@poste.it>
pkgname=eccodes-git
pkgver=2020.10.1.r0.g929aee77
pkgrel=1
pkgdesc="ECMWF decoding library for GRIB, BUFR and GTS"
arch=('x86_64')
url="https://github.com/ecmwf/${pkgname%-git}"
license=('Apache')
depends=('openjpeg' 'libpng' 'python3' 'netcdf' 'libaec')
makedepends=('gcc-fortran' 'python' 'python-numpy' 'cmake' 'ecbuild-git')
conflicts=('grib_api' 'libbufr-ecmwf')
source=("eccodes::git+$url#branch=master")
md5sums=('SKIP')
prepare() {
          cd "${pkgname%-git}"
          sed -i 's/image.inmem_.*=.*1;//' src/grib_jasper_encoding.c
          mkdir -p build
}

pkgver() {
          cd "${pkgname%-git}"
          git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cmake -B build -S ${pkgname%-git} \
        -DCMAKE_BUILD_TYPE=production \        -DENABLE_AEC=TRUE \
        -DCMAKE_INSTALL_PREFIX='/usr' \
        -DCMAKE_INSTALL_DATAROOTDIR=/usr/share/${pkgname%-git}/definitions \
        -DCMAKE_INSTALL_DATADIR=/usr/share \
        -DENABLE_PNG=TRUE \
        -DENABLE_ECCODES_THREADS=1 \
        -DPYTHON_EXECUTABLE=/usr/bin/python3 \
        -Wno-dev
    make -C build
}

package() {
  make -C build DESTDIR="$pkgdir" install
}

@loqs can I submit another package for ecbuild-git and put you as contributor?
@a821 i will test this code eventually but I think i will go with loqs' method as ecbuild is used on other ecmwf packages.

Regards and thanks,
sc

Offline

#12 2020-11-19 02:29:11

loqs
Member
Registered: 2014-03-06
Posts: 17,197

Re: PKGBUILD review request: eccodes-git

sentientc wrote:

@loqs can I submit another package for ecbuild-git and put you as contributor?

Thanks for the credit that would be great.

One minor niggle with the eccodes-git

prepare() {
          cd "${pkgname%-git}"
          sed -i 's/image.inmem_.*=.*1;//' src/grib_jasper_encoding.c
          mkdir -p build
}

You can drop the `mkdir -p build` as `cmake -B build` will create the build directory if needed.

Offline

#13 2020-11-19 05:29:10

sentientc
Member
Registered: 2020-11-05
Posts: 7

Re: PKGBUILD review request: eccodes-git

Hi,
About that, maybe i forgot to update or something but i have to have that "mkdir -p build" part to have successful "makepkg -si".
Regards,
sc

Offline

#14 2020-11-19 05:57:01

loqs
Member
Registered: 2014-03-06
Posts: 17,197

Re: PKGBUILD review request: eccodes-git

I had to make two changes for the package to build in a clean chroot,  as well as the option removal of mkdir.
Missing makedepends git and -DCMAKE_BUILD_TYPE=production \        -DENABLE_AEC=TRUE \  caused
CMake Error: The source directory "/build/eccodes-git/src/ " does not exist.
diff of changes I made:

diff --git a/PKGBUILD b/PKGBUILD
index dff94a9..7d80efe 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,14 +8,13 @@ arch=('x86_64')
 url="https://github.com/ecmwf/${pkgname%-git}"
 license=('Apache')
 depends=('openjpeg' 'libpng' 'python3' 'netcdf' 'libaec')
-makedepends=('gcc-fortran' 'python' 'python-numpy' 'cmake' 'ecbuild-git')
+makedepends=('gcc-fortran' 'python' 'python-numpy' 'cmake' 'ecbuild-git' 'git')
 conflicts=('grib_api' 'libbufr-ecmwf')
 source=("eccodes::git+$url#branch=master")
 md5sums=('SKIP')
 prepare() {
           cd "${pkgname%-git}"
           sed -i 's/image.inmem_.*=.*1;//' src/grib_jasper_encoding.c
-          mkdir -p build
 }
 
 pkgver() {
@@ -25,7 +24,8 @@ pkgver() {
 
 build() {
   cmake -B build -S ${pkgname%-git} \
-        -DCMAKE_BUILD_TYPE=production \        -DENABLE_AEC=TRUE \
+        -DCMAKE_BUILD_TYPE=production \
+        -DENABLE_AEC=TRUE \
         -DCMAKE_INSTALL_PREFIX='/usr' \
         -DCMAKE_INSTALL_DATAROOTDIR=/usr/share/${pkgname%-git}/definitions \
         -DCMAKE_INSTALL_DATADIR=/usr/share \

Offline

#15 2020-11-19 08:23:04

sentientc
Member
Registered: 2020-11-05
Posts: 7

Re: PKGBUILD review request: eccodes-git

Hi,
Ok, I think I made the changes. This time my makepkg -si working fine without the mkdir thing.
Thanks,
sc

Offline

Board footer

Powered by FluxBB