Date: Thursday, April 6, 2023 @ 17:50:02
Author: felixonmars
Revision: 1440093
archrelease: copy trunk to community-staging-x86_64
Added:
lhapdf/repos/community-staging-x86_64/
lhapdf/repos/community-staging-x86_64/PKGBUILD
(from rev 1440092, lhapdf/trunk/PKGBUILD)
lhapdf/repos/community-staging-x86_64/fix_installed_pdf_permissions.patch
(from rev 1440092, lhapdf/trunk/fix_installed_pdf_permissions.patch)
lhapdf/repos/community-staging-x86_64/lhapdf.install
(from rev 1440092, lhapdf/trunk/lhapdf.install)
-------------------------------------+
PKGBUILD | 55 ++++++++++++++++++++++++++++++++++
fix_installed_pdf_permissions.patch | 30 ++++++++++++++++++
lhapdf.install | 11 ++++++
3 files changed, 96 insertions(+)
Copied: lhapdf/repos/community-staging-x86_64/PKGBUILD (from rev 1440092,
lhapdf/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD (rev 0)
+++ community-staging-x86_64/PKGBUILD 2023-04-06 17:50:02 UTC (rev 1440093)
@@ -0,0 +1,55 @@
+# Maintainer: Konstantin Gizdov <arch at kge dot pw>
+# Contributor: Frank Siegert <frank dot siegert at googlemail dot com>
+# Contributor: JP-Ellis <josh at jpellis dot me>
+pkgname=lhapdf
+pkgver=6.5.3
+pkgrel=2
+pkgdesc="A particle physics tool for evaluating PDFs from discretised data
files"
+arch=('x86_64')
+url="https://lhapdf.hepforge.org/"
+license=('GPL3')
+makedepends=('cython')
+depends=('python-numpy')
+install=lhapdf.install
+source=("https://www.hepforge.org/archive/lhapdf/LHAPDF-${pkgver}.tar.gz"
+ 'fix_installed_pdf_permissions.patch')
+b2sums=('2dd1b5b94523c0cadac2b63d3dcbc73c5d621463ec9a0e6736b40cb24f6f4da744cf74484b6a5cfb1cfc10054171858dfb3968b22da565747d9b0d00cb3f545c'
+
'c875018d666331588051adc394b24c40321d78573ec33ef9312ea8779eeb6cf15ea845a5267d4dc6530cc82050e782affc908b9a6727aa3125b9f0086f1917a2')
+
+prepare() {
+ cd "${srcdir}/LHAPDF-${pkgver}"
+
+ # add in correct flags
+ sed '/linkargs =/a linkargs += " '"${LDFLAGS} ${LTOFLAGS}"' "' -i
wrappers/python/build.py.in
+ # installed PDFs must respect system permissions and ownership structure
+ patch -Np1 -i "${srcdir}/fix_installed_pdf_permissions.patch"
+}
+
+build() {
+ cd "${srcdir}/LHAPDF-${pkgver}"
+ export CXXFLAGS="$CFLAGS" # do not define _GLIBCXX_ASSERTIONS
+ autoreconf -i
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --runstatedir=/run \
+ --datarootdir=/usr/share/${pkgname} \
+ --datadir=/usr/share/${pkgname} \
+ --docdir=/usr/share/doc/${pkgname} \
+ --pdfdir=/usr/share/${pkgname}/LHAPDF \
+ --localedir=/usr/share/locale
+ # for some reason Python build fails otherwise
+ export RIVET_LOCAL=ON
+ make
+}
+
+check() {
+ cd "${srcdir}/LHAPDF-${pkgver}"
+ make -k check
+}
+
+package() {
+ cd "${srcdir}/LHAPDF-${pkgver}"
+ make DESTDIR="${pkgdir}/" install
+}
Copied:
lhapdf/repos/community-staging-x86_64/fix_installed_pdf_permissions.patch (from
rev 1440092, lhapdf/trunk/fix_installed_pdf_permissions.patch)
===================================================================
--- community-staging-x86_64/fix_installed_pdf_permissions.patch
(rev 0)
+++ community-staging-x86_64/fix_installed_pdf_permissions.patch
2023-04-06 17:50:02 UTC (rev 1440093)
@@ -0,0 +1,30 @@
+diff --color -aur LHAPDF-6.5.2-old/bin/lhapdf LHAPDF-6.5.2-new/bin/lhapdf
+--- LHAPDF-6.5.2-old/bin/lhapdf 2022-08-19 17:25:17.896370763 +0300
++++ LHAPDF-6.5.2-new/bin/lhapdf 2022-08-19 17:26:41.193035357 +0300
+@@ -169,8 +169,26 @@
+
+ tarpath = os.path.join(dest_dir, tar_filename)
+ try:
++ import stat
+ import tarfile
++ stat_info = os.stat(tarpath)
++ # we only really care if destination is world readable
++ world_readable = bool(stat_info.st_mode & stat.S_IROTH)
++ file_mode = 0o644 if world_readable else 0o640
++ dir_mode = 0o755 if world_readable else 0o750
++ # load PDF tar file
+ tar_file = tarfile.open(tarpath, "r:gz")
++ for tar_info in tar_file.getmembers():
++ # adjust tar file properties
++ tar_info.uid = 0
++ tar_info.gid = 0
++ tar_info.uname = ""
++ tar_info.gname = ""
++ if tar_info.isfile():
++ tar_info.mode = file_mode
++ if tar_info.isdir():
++ tar_info.mode = dir_mode
++ # extract PDF tar file
+ tar_file.extractall(dest_dir)
+ tar_file.close()
+ except:
Copied: lhapdf/repos/community-staging-x86_64/lhapdf.install (from rev 1440092,
lhapdf/trunk/lhapdf.install)
===================================================================
--- community-staging-x86_64/lhapdf.install (rev 0)
+++ community-staging-x86_64/lhapdf.install 2023-04-06 17:50:02 UTC (rev
1440093)
@@ -0,0 +1,11 @@
+post_install() {
+ echo 'PDF sets are stored in /usr/share/lhapdf/LHAPDF'
+ echo 'You can download PDF sets with the "lhapdf" command like so:'
+ echo ' $ lhapdf ls'
+ echo ' # sudo lhapdf install CT10'
+}
+
+post_upgrade() {
+ echo 'To update your PDF sets, please run:'
+ echo ' # lhapdf install $(lhapdf list --outdated)'
+}