George Hu pushed to branch main at Arch Linux / Packaging / Packages / klayout


Commits:
5554786e by Torleif Skår at 2025-10-04T15:40:45+08:00
Add Python modules as a separate package `python-klayout`

- - - - -


2 changed files:

- .SRCINFO
- PKGBUILD


Changes:

=====================================
.SRCINFO
=====================================
@@ -1,10 +1,18 @@
 pkgbase = klayout
-       pkgdesc = High Performance Layout Viewer And Editor. Support of GDS and 
OASIS files.
        pkgver = 0.30.4
        pkgrel = 1
        url = https://www.klayout.de
        arch = x86_64
-       license = GPL
+       license = GPL-3.0-or-later
+       source = http://www.klayout.org/downloads/source/klayout-0.30.4.tar.bz2
+       source = klayoutEditor.desktop
+       source = klayoutViewer.desktop
+       sha512sums = 
81f7339b1fe150e8d0a19dc3df8666682ffe1a40ce054f02d541be3add1ec0c85d414ef371a129c2de85ad44bd77f37644ecadbf35ed2013116f084831ab8914
+       sha512sums = 
bc6c7621e5cda754509a86664fb3e7ecd15f577dec712f4b0c52c9a7455ba692043a67145f5bf143d8fdc502b84e4212303906d62107537eefb4bebe57b2ffe1
+       sha512sums = 
37a3bbb06ab155c1c22e3990cf160383570e8ea945dbf4964bc94b6fd4e6321627d31071a29d3dbeafc9e2fc406b6905761e299bfccdfe0a35663f2021624f4f
+
+pkgname = klayout
+       pkgdesc = High Performance Layout Viewer And Editor. Support of GDS and 
OASIS files.
        depends = libgit2
        depends = qt6-base
        depends = qt6-tools
@@ -13,11 +21,8 @@ pkgbase = klayout
        depends = qt6-5compat
        depends = python
        depends = ruby
-       source = http://www.klayout.org/downloads/source/klayout-0.30.4.tar.bz2
-       source = klayoutEditor.desktop
-       source = klayoutViewer.desktop
-       sha512sums = 
81f7339b1fe150e8d0a19dc3df8666682ffe1a40ce054f02d541be3add1ec0c85d414ef371a129c2de85ad44bd77f37644ecadbf35ed2013116f084831ab8914
-       sha512sums = 
bc6c7621e5cda754509a86664fb3e7ecd15f577dec712f4b0c52c9a7455ba692043a67145f5bf143d8fdc502b84e4212303906d62107537eefb4bebe57b2ffe1
-       sha512sums = 
37a3bbb06ab155c1c22e3990cf160383570e8ea945dbf4964bc94b6fd4e6321627d31071a29d3dbeafc9e2fc406b6905761e299bfccdfe0a35663f2021624f4f
+       optdepends = python-klayout: Python bindings for KLayout
 
-pkgname = klayout
+pkgname = python-klayout
+       pkgdesc = Python bindings for KLayout
+       depends = klayout


=====================================
PKGBUILD
=====================================
@@ -1,14 +1,13 @@
 # Contributor: Lars Boettcher <[email protected]>
 # Maintainer: Aaron Ali <[email protected]>
 
-pkgname=klayout
+pkgbase=klayout
+pkgname=("klayout" "python-klayout")
 pkgver=0.30.4
 pkgrel=1
-pkgdesc="High Performance Layout Viewer And Editor. Support of GDS and OASIS 
files."
 arch=('x86_64')
 url="https://www.klayout.de";
-license=('GPL')
-depends=('libgit2' 'qt6-base' 'qt6-tools' 'qt6-multimedia' 'qt6-svg' 
'qt6-5compat' 'python' 'ruby')
+license=('GPL-3.0-or-later')
 source=(http://www.klayout.org/downloads/source/klayout-$pkgver.tar.bz2
         klayoutEditor.desktop klayoutViewer.desktop)
 
sha512sums=('81f7339b1fe150e8d0a19dc3df8666682ffe1a40ce054f02d541be3add1ec0c85d414ef371a129c2de85ad44bd77f37644ecadbf35ed2013116f084831ab8914'
@@ -22,7 +21,11 @@ build() {
     -qmake qmake6
 }
 
-package() {
+package_klayout() {
+  pkgdesc="High Performance Layout Viewer And Editor. Support of GDS and OASIS 
files."
+  depends=('libgit2' 'qt6-base' 'qt6-tools' 'qt6-multimedia' 'qt6-svg' 
'qt6-5compat' 'python' 'ruby')
+  optdepends=('python-klayout: Python bindings for KLayout')
+
   install -D -m 644 klayoutEditor.desktop 
"$pkgdir"/usr/share/applications/klayoutEditor.desktop
   install -D -m 644 klayoutViewer.desktop 
"$pkgdir"/usr/share/applications/klayoutViewer.desktop
   cd klayout-$pkgver
@@ -30,6 +33,22 @@ package() {
   install -D -m 755 bin-release/{klayout,strm*} -t "$pkgdir"/usr/bin/
   install -d "$pkgdir"/usr/lib/"$pkgname"/
   cp -a bin-release/* "$pkgdir"/usr/lib/"$pkgname"/
-  # remove binaries from /usr/lib/
-  rm "$pkgdir"/usr/lib/"$pkgname"/{strm*,klayout}
+
+  # Remove ELF executables and Python modules
+  rm -r "$pkgdir"/usr/lib/"$pkgname"/{strm*,klayout,pymod}
+}
+
+package_python-klayout() {
+  pkgdesc="Python bindings for KLayout"
+  depends=('klayout')
+
+  local site="$(python -c 'import site; print(site.getsitepackages()[0])')"
+  install -d "$pkgdir/$site"
+
+  cd klayout-$pkgver
+  cp -a bin-release/pymod/klayout "$pkgdir/$site/"
+
+  # pya is included for compatibility reasons, but will be deprecated in the 
future
+  # See upstream: https://github.com/KLayout/klayout/issues/2072
+  cp -a bin-release/pymod/pya "$pkgdir/$site/"
 }



View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/klayout/-/commit/5554786ee334f3d0a7ffb8fbf6a0766238d968e9

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


Reply via email to