Antonio Rojas pushed to branch main at Arch Linux / Packaging / Packages / 
spglib


Commits:
d5f226ca by Antonio Rojas at 2024-08-23T23:21:14+02:00
Use python tooling to build python bindings

Fixes 
https://gitlab.archlinux.org/archlinux/packaging/packages/spglib/-/issues/2

- - - - -


2 changed files:

- .SRCINFO
- PKGBUILD


Changes:

=====================================
.SRCINFO
=====================================
@@ -1,7 +1,7 @@
 pkgbase = spglib
        pkgdesc = C library for finding and handling crystal symmetries
        pkgver = 2.5.0
-       pkgrel = 1
+       pkgrel = 2
        url = https://spglib.readthedocs.io/en/latest/
        arch = x86_64
        license = BSD-3-Clause
@@ -9,12 +9,15 @@ pkgbase = spglib
        makedepends = gcc-fortran
        makedepends = git
        makedepends = gtest
-       makedepends = python
+       makedepends = python-build
+       makedepends = python-installer
        makedepends = python-numpy
+       makedepends = python-scikit-build-core
+       makedepends = python-setuptools-scm
        depends = glibc
        optdepends = gcc-libs: Fortran interface
        optdepends = python-numpy: Python interface
        source = git+https://github.com/spglib/spglib#tag=v2.5.0
-       sha256sums = 
8d4da6ebdf02a78de85e2d52c6829ec93dcad0fcd6d7892f94820ff80da01ebf
+       sha256sums = 
570b46d69e46d17dc0e8bc35c358df36334a8b08977791ee00cb9e48b31932b0
 
 pkgname = spglib


=====================================
PKGBUILD
=====================================
@@ -2,7 +2,7 @@
 
 pkgname=spglib
 pkgver=2.5.0
-pkgrel=1
+pkgrel=2
 pkgdesc='C library for finding and handling crystal symmetries'
 arch=(x86_64)
 url='https://spglib.readthedocs.io/en/latest/'
@@ -12,12 +12,15 @@ makedepends=(cmake
              gcc-fortran
              git
              gtest
-             python
-             python-numpy)
+             python-build
+             python-installer
+             python-numpy
+             python-scikit-build-core
+             python-setuptools-scm)
 optdepends=('gcc-libs: Fortran interface'
             'python-numpy: Python interface')
 source=(git+https://github.com/spglib/spglib#tag=v$pkgver)
-sha256sums=('8d4da6ebdf02a78de85e2d52c6829ec93dcad0fcd6d7892f94820ff80da01ebf')
+sha256sums=('570b46d69e46d17dc0e8bc35c358df36334a8b08977791ee00cb9e48b31932b0')
 
 prepare() {
   sed -e 's|TARGET Spglib_symspg|0|' -i $pkgname/python/CMakeLists.txt # Don't 
duplicate shared libs in python tree
@@ -26,12 +29,15 @@ prepare() {
 build() {
   cmake -B build -S $pkgname \
     -DCMAKE_INSTALL_PREFIX=/usr \
-    -DSPGLIB_WITH_Fortran=ON \
-    -DSPGLIB_WITH_Python=ON
+    -DSPGLIB_WITH_Fortran=ON
   cmake --build build
+  cd $pkgname
+  python -m build --wheel --no-isolation
 }
 
 package() {
   DESTDIR="$pkgdir" cmake --install build
-  install -Dm644 $pkgname/COPYING "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+  cd $pkgname
+  python -m installer --destdir="$pkgdir" dist/*.whl
+  install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
 }



View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/spglib/-/commit/d5f226ca7a8eee9df35f9d174b745669f8d9a963

-- 
View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/spglib/-/commit/d5f226ca7a8eee9df35f9d174b745669f8d9a963
You're receiving this email because of your account on gitlab.archlinux.org.


Reply via email to