Added builder python-virtualenv
This commit is contained in:
parent
dfeaea2efc
commit
1f24fdea45
|
@ -1,8 +1,15 @@
|
|||
.vscode
|
||||
.venv
|
||||
|
||||
# Package builds
|
||||
**/builds/**/src
|
||||
**/builds/**/pkg
|
||||
|
||||
# Python
|
||||
*.pyc
|
||||
|
||||
# Debian builds
|
||||
*.deb
|
||||
|
||||
# AUR repositories
|
||||
**/aur_repo
|
||||
|
|
13
build.py
13
build.py
|
@ -51,10 +51,17 @@ class DebianBuilder:
|
|||
package["sources"]["x86_64"]["md5sum"] = md5sum(source_x86_64)
|
||||
|
||||
|
||||
BUILDERS = {"debian": DebianBuilder}
|
||||
class PythonVirtualenvBuilder:
|
||||
template = "PKGBUILD.python-virtualenv.j2"
|
||||
|
||||
print(huepy.run(f"Using {package['builder']} builder"))
|
||||
builder = BUILDERS[package["builder"]]()
|
||||
def update_package_definition(self, package):
|
||||
pass
|
||||
|
||||
|
||||
BUILDERS = {"debian": DebianBuilder, "python-virtualenv": PythonVirtualenvBuilder}
|
||||
|
||||
print(huepy.run(f"Using {package['builder']['type']} builder"))
|
||||
builder = BUILDERS[package["builder"]["type"]]()
|
||||
builder.update_package_definition(package)
|
||||
|
||||
print(huepy.run("Generating PKGBUILD"))
|
||||
|
|
|
@ -9,7 +9,8 @@ optdepends = ["nautilus: For nautilus integration"]
|
|||
conflicts = ["cloudstation-beta", "cloudstation-3.0", "cloudstation-drive"]
|
||||
arch = ["i686", "x86_64"]
|
||||
|
||||
builder = "debian"
|
||||
[builder]
|
||||
type = "debian"
|
||||
|
||||
[sources.i686]
|
||||
url = "https://global.download.synology.com/download/Tools/SynologyDriveClient/{version}-{build_number}/Ubuntu/Installer/i686/synology-drive-client-{build_number}.i686.deb"
|
||||
|
|
|
@ -13,6 +13,7 @@ conflicts=('{{ conflicts|join("' '") }}')
|
|||
source=()
|
||||
md5sums=()
|
||||
|
||||
{% block sources %}
|
||||
{% if "i686" in arch %}
|
||||
source_i686=({{ sources.i686.url }})
|
||||
md5sums_i686=('{{ sources.i686.md5sum }}')
|
||||
|
@ -22,5 +23,6 @@ md5sums_i686=('{{ sources.i686.md5sum }}')
|
|||
source_x86_64=({{ sources.x86_64.url }})
|
||||
md5sums_x86_64=('{{ sources.x86_64.md5sum }}')
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block operations%}{% endblock %}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
{% extends "PKGBUILD.base.j2" %}
|
||||
|
||||
{% block sources %}{% endblock %}
|
||||
|
||||
{% block operations %}
|
||||
prepare() {
|
||||
mkdir -p "$srcdir/{{ name }}"
|
||||
cd "$srcdir/{{ name }}" || exit
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install {{ builder.packages|join(" ") }}
|
||||
}
|
||||
|
||||
package() {
|
||||
mkdir "$pkgdir/opt"
|
||||
cp -r "$srcdir/{{ name }}" "$pkgdir/opt/{{ name }}"
|
||||
cd "$pkgdir/" || exit
|
||||
mkdir -p usr/local/bin
|
||||
{% for binary in builder.binaries -%}
|
||||
ln -s "$prgdir/opt/{{ name }}/venv/bin/{{ binary }}" "$pkgdir/usr/local/bin/{{ binary }}"
|
||||
{%- endfor %}
|
||||
|
||||
}
|
||||
{% endblock %}
|
Loading…
Reference in New Issue