This repository has been archived by the owner on May 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpkgbuild.py
76 lines (60 loc) · 2.49 KB
/
pkgbuild.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env python3
"""
This file is part of the MusiKernel project, Copyright MusiKernel Team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
"""
import hashlib
import os
PKGBUILD_TEMPLATE = """# Maintainer: Jeff Hubbard <[email protected]>
_realname={major_version}
pkgname="${{MINGW_PACKAGE_PREFIX}}-${{_realname}}"
pkgver={minor_version}
pkgrel=1
pkgdesc="DAWs/hosts, instrument and effect plugins, and a new approach to audio development. (mingw-w64)"
arch=('any')
url="http://www.github.com/j3ffhubb/musikernel"
license=("GPL")
makedepends=("${{MINGW_PACKAGE_PREFIX}}-gcc" "${{MINGW_PACKAGE_PREFIX}}-pkg-config")
depends=("${{MINGW_PACKAGE_PREFIX}}-gcc-libs"
"${{MINGW_PACKAGE_PREFIX}}-rubberband"
"${{MINGW_PACKAGE_PREFIX}}-portaudio"
"${{MINGW_PACKAGE_PREFIX}}-portmidi"
"${{MINGW_PACKAGE_PREFIX}}-libsndfile"
"${{MINGW_PACKAGE_PREFIX}}-fftw"
"${{MINGW_PACKAGE_PREFIX}}-python3-numpy"
"${{MINGW_PACKAGE_PREFIX}}-libvorbis"
"${{MINGW_PACKAGE_PREFIX}}-python3-pyqt5")
source=("https://github.com/j3ffhubb/musikernel/archive/{major_version}.zip")
md5sums=('{zip_md5sum}')
build() {{
#export PATH="${{MINGW_PREFIX}}:$PATH"
cd "${{srcdir}}/musikernel-{major_version}/src"
CC=${{MINGW_PREFIX}}/bin/gcc.exe make mingw
}}
package() {{
#export PATH="${{MINGW_PREFIX}}:$PATH"
cd "${{srcdir}}/musikernel-{major_version}/src"
make PREFIX=${{MINGW_PREFIX}} DESTDIR="$pkgdir" install_non_linux
}}
"""
CWD = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(CWD, "..", "src", "minor-version.txt")) as fh:
MINOR_VERSION = fh.read().strip()
with open(os.path.join(CWD, "..", "src", "major-version.txt")) as fh:
MAJOR_VERSION = fh.read().strip()
file_name = os.path.join(CWD, "{major_version}.zip".format(
major_version=MAJOR_VERSION))
with open(file_name, "rb") as fh:
MD5_ZIP = hashlib.md5(fh.read()).hexdigest()
PKGBUILD = os.path.join(CWD, "PKGBUILD")
with open(PKGBUILD, "w") as fh:
tmp_str = PKGBUILD_TEMPLATE.format(
major_version=MAJOR_VERSION, minor_version=MINOR_VERSION,
zip_md5sum=MD5_ZIP)
fh.write(tmp_str)