Merge branch 'master' of github.com:BioArchLinux/Packages

This commit is contained in:
BioArchLinuxBot 2022-08-10 22:05:01 +08:00
commit 3a9afa6632
4 changed files with 21 additions and 100 deletions

View file

@ -1,35 +1,19 @@
#!/usr/bin/env python3
from lilaclib import *
def apply_patch(filename, patch,reverse=False):
rev="-R" if reverse else ""
patch_proc = subprocess.Popen(
["patch", "-p1", rev, filename], stdin=subprocess.PIPE, text=True)
patch_proc.communicate(patch)
# for our server, we have to use make -j6, but it should not appears in the PKGBUILD
def pre_build():
update_pkgver_and_pkgrel(_G.newver.lstrip('v'))
run_cmd(['updpkgsums'])
apply_patch('PKGBUILD', PATCH)
for line in edit_file('PKGBUILD'):
if line.strip() == 'make':
line = line + ' -j6'
print(line)
def post_build():
apply_patch('PKGBUILD', PATCH, reverse=True)
for line in edit_file('PKGBUILD'):
if line.endswith('make -j6'):
line = line[:-4]
print(line)
git_add_files('PKGBUILD')
git_commit()
PATCH = r"""
diff --git a/BioArchLinux/libsbml/PKGBUILD b/BioArchLinux/libsbml/PKGBUILD
index 2cf9189a0..e19634ec2 100644
--- a/BioArchLinux/libsbml/PKGBUILD
+++ b/BioArchLinux/libsbml/PKGBUILD
@@ -34,7 +34,7 @@ build() {
-DENABLE_FBC=ON \
-DENABLE_GROUPS=ON
- make
+ make -j6
}
package() {
"""

View file

@ -1,38 +1,17 @@
#!/usr/bin/env python3
from lilaclib import *
def apply_patch(filename, patch, reverse=False):
rev = "-R" if reverse else ""
patch_proc = subprocess.Popen(
["patch", "-p1", rev, filename], stdin=subprocess.PIPE, text=True)
patch_proc.communicate(patch)
# we use 5 threads in BioArchLinux, but it should not be pushed to aur.
def pre_build():
for line in edit_file('PKGBUILD'):
if line.startswith('_pkgver='):
line = f'_pkgver={_G.newver}'
elif line.startswith('build()'):
line += '\n' + 'export MAKE="make -j5"'
print(line)
update_pkgver_and_pkgrel(_G.newver.replace(':', '.').replace('-', '.'))
apply_patch('PKGBUILD', PATCH)
def post_build():
apply_patch('PKGBUILD', PATCH, reverse=True)
run_cmd(['sh', '-c', "sed -i '/export MAKE/d' PKGBUILD"])
git_pkgbuild_commit()
update_aur_repo()
PATCH = r"""
diff --git b/BioArchLinux/r-metabma/PKGBUILD a/BioArchLinux/r-metabma/PKGBUILD
index e1ec269a6..65298aefc 100644
--- b/BioArchLinux/r-metabma/PKGBUILD
+++ a/BioArchLinux/r-metabma/PKGBUILD
@@ -36,6 +36,8 @@ source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz")
sha256sums=('330bccb4b2297bc3a8b7291197c5e978b90b002907f762ede40f2d3e383367da')
build() {
+ # restrict the usage of memory and cpu, 1 threads usually consumes 2 GiB memory.
+ export MAKE="make -j5"
R CMD INSTALL ${_pkgname}_${_pkgver}.tar.gz -l "${srcdir}"
}
"""

View file

@ -1,39 +1,17 @@
#!/usr/bin/env python3
from lilaclib import *
def apply_patch(filename, patch, reverse=False):
rev = "-R" if reverse else ""
patch_proc = subprocess.Popen(
["patch", "-p1", rev, filename], stdin=subprocess.PIPE, text=True)
patch_proc.communicate(patch)
# we use 5 threads in BioArchLinux, but it should not be pushed to aur.
def pre_build():
for line in edit_file('PKGBUILD'):
if line.startswith('_pkgver='):
line = f'_pkgver={_G.newver}'
elif line.startswith('build()'):
line += '\n' + 'export MAKE="make -j5"'
print(line)
update_pkgver_and_pkgrel(_G.newver.replace(':', '.').replace('-', '.'))
apply_patch('PKGBUILD', PATCH)
def post_build():
apply_patch('PKGBUILD', PATCH, reverse=True)
run_cmd(['sh', '-c', "sed -i '/export MAKE/d' PKGBUILD"])
git_pkgbuild_commit()
update_aur_repo()
PATCH = r"""
diff --git b/BioArchLinux/r-openmx/PKGBUILD a/BioArchLinux/r-openmx/PKGBUILD
index 65c28dbe3..7c7930728 100644
--- b/BioArchLinux/r-openmx/PKGBUILD
+++ a/BioArchLinux/r-openmx/PKGBUILD
@@ -46,6 +46,8 @@ source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz")
sha256sums=('65c50ce09f9c006b41b7311ec05eba3ae77926d84fb44e3905905208404826ed')
build() {
+ # restrict the usage of cpu. Usage of RAM is OK.
+ export MAKE="make -j5"
R CMD INSTALL ${_pkgname}_${_pkgver}.tar.gz -l "${srcdir}"
}
"""

View file

@ -1,37 +1,17 @@
#!/usr/bin/env python3
from lilaclib import *
def apply_patch(filename, patch, reverse=False):
rev = "-R" if reverse else ""
patch_proc = subprocess.Popen(
["patch", "-p1", rev, filename], stdin=subprocess.PIPE, text=True)
patch_proc.communicate(patch)
# we use 5 threads in BioArchLinux, but it should not be pushed to aur.
def pre_build():
for line in edit_file('PKGBUILD'):
if line.startswith('_pkgver='):
line = f'_pkgver={_G.newver}'
elif line.startswith('build()'):
line += '\n' + 'export MAKE="make -j5"'
print(line)
update_pkgver_and_pkgrel(_G.newver.replace(':', '.').replace('-', '.'))
apply_patch('PKGBUILD', PATCH)
def post_build():
apply_patch('PKGBUILD', PATCH, reverse=True)
run_cmd(['sh', '-c', "sed -i '/export MAKE/d' PKGBUILD"])
git_pkgbuild_commit()
update_aur_repo()
PATCH = r"""
diff --git b/BioArchLinux/r-rstanarm/PKGBUILD a/BioArchLinux/r-rstanarm/PKGBUILD
index 9c805af05..46fe828f1 100644
--- b/BioArchLinux/r-rstanarm/PKGBUILD
+++ a/BioArchLinux/r-rstanarm/PKGBUILD
@@ -46,6 +46,8 @@ source=("https://cran.r-project.org/src/contrib/${_pkgname}_${_pkgver}.tar.gz")
sha256sums=('e9f2d3761b8e4f14a6690beb633b08633cba7269ac8b969aedaa12844d1a32a7')
build() {
+ # restrict the usage of memory and cpu, 1 threads usually consumes 2 GiB memory.
+ export MAKE="make -j5"
R CMD INSTALL ${_pkgname}_${_pkgver}.tar.gz -l "${srcdir}"
}
"""