forked from semios/ports
Compare commits
2
Commits
| Author | SHA256 | Date | |
|---|---|---|---|
|
|
367985bc61 | ||
|
|
f2c2fa93c9 |
@@ -16,6 +16,7 @@ _key_links = "links"
|
|||||||
_key_dependencies = "dependencies"
|
_key_dependencies = "dependencies"
|
||||||
_key_recommendations = "recommendations"
|
_key_recommendations = "recommendations"
|
||||||
_key_provides = "provides"
|
_key_provides = "provides"
|
||||||
|
_key_configure = "configure"
|
||||||
|
|
||||||
_current_pkgname: str = _key_global
|
_current_pkgname: str = _key_global
|
||||||
_pkginfo: dict[str, dict[str, typing.Any]] = {
|
_pkginfo: dict[str, dict[str, typing.Any]] = {
|
||||||
@@ -25,6 +26,7 @@ _pkginfo: dict[str, dict[str, typing.Any]] = {
|
|||||||
_key_maintainers: [],
|
_key_maintainers: [],
|
||||||
_key_provides: [],
|
_key_provides: [],
|
||||||
_key_recommendations: [],
|
_key_recommendations: [],
|
||||||
|
_key_configure: [],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
_supported_arch: typing.Callable[[str], bool] = lambda x: True
|
_supported_arch: typing.Callable[[str], bool] = lambda x: True
|
||||||
@@ -87,6 +89,12 @@ def provide(s: str):
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def configure_script(s: str):
|
||||||
|
_pkginfo[_current_pkgname][_key_configure] += [
|
||||||
|
os.path.realpath(s)
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def _translate_dep_spec(s: str) -> str:
|
def _translate_dep_spec(s: str) -> str:
|
||||||
return (
|
return (
|
||||||
s.replace("(same)", "(same-version) @same-arch")
|
s.replace("(same)", "(same-version) @same-arch")
|
||||||
|
|||||||
@@ -25,6 +25,15 @@ class PkgComposer:
|
|||||||
json.dump(link, f)
|
json.dump(link, f)
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
|
|
||||||
|
def add_configure(self, path: str, name: str = None):
|
||||||
|
if name is None:
|
||||||
|
name = os.path.basename(path)
|
||||||
|
configuredir = self.workdir + "/configure/"
|
||||||
|
dstpath = configuredir + name
|
||||||
|
os.makedirs(configuredir, exist_ok=True)
|
||||||
|
shutil.copy2(path, dstpath)
|
||||||
|
os.chmod(dstpath, 0o755)
|
||||||
|
|
||||||
def compose(self):
|
def compose(self):
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
[ "${ACTION}" = "remove" ] && exit 0
|
||||||
|
command -v certutil >/dev/null 2>&1 || exit 0
|
||||||
|
|
||||||
|
certutil refresh
|
||||||
@@ -27,4 +27,6 @@ def pack(composer):
|
|||||||
|
|
||||||
package("ca-certificates")
|
package("ca-certificates")
|
||||||
arch_any()
|
arch_any()
|
||||||
|
configure_script("configure/refresh")
|
||||||
|
recommend("certutil")
|
||||||
on_pack(pack)
|
on_pack(pack)
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
from lib import cpp
|
|
||||||
from lib.make import *
|
|
||||||
|
|
||||||
version("1.3.6")
|
|
||||||
description("Ogg container format libraries")
|
|
||||||
maintainer("sisungo <[email protected]>")
|
|
||||||
source_url("https://downloads.xiph.org/releases/ogg/libogg-1.3.6.tar.xz")
|
|
||||||
|
|
||||||
builddep("shortcut/c")
|
|
||||||
builddep("shortcut/autotools")
|
|
||||||
|
|
||||||
|
|
||||||
def build():
|
|
||||||
cpp.configure(
|
|
||||||
[
|
|
||||||
"--prefix=/",
|
|
||||||
f"--libdir={get_prefix('libogg')}/lib",
|
|
||||||
f"--includedir={get_prefix('libogg-dev')}/include",
|
|
||||||
]
|
|
||||||
)
|
|
||||||
cpp.make()
|
|
||||||
cpp.make_install()
|
|
||||||
|
|
||||||
|
|
||||||
on_build(build)
|
|
||||||
|
|
||||||
package("libogg")
|
|
||||||
dep("semi-libc @same-arch")
|
|
||||||
cpp.use_auto_pack(["lib"])
|
|
||||||
|
|
||||||
package("libogg-dev")
|
|
||||||
dep("libogg (same)")
|
|
||||||
cpp.use_auto_pack(["dev"])
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
from lib import cpp
|
|
||||||
from lib.make import *
|
|
||||||
|
|
||||||
version("1.3.7")
|
|
||||||
description("Reference implementation of the Ogg Vorbis audio format.")
|
|
||||||
maintainer("sisungo <[email protected]>")
|
|
||||||
source_url("https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.7.tar.gz")
|
|
||||||
|
|
||||||
builddep("shortcut/c")
|
|
||||||
builddep("shortcut/autotools")
|
|
||||||
builddep("libogg-dev @target")
|
|
||||||
|
|
||||||
|
|
||||||
def build():
|
|
||||||
cpp.configure(
|
|
||||||
[
|
|
||||||
"--prefix=/",
|
|
||||||
f"--libdir={get_prefix('libvorbis')}/lib",
|
|
||||||
f"--includedir={get_prefix('libvorbis-dev')}/include",
|
|
||||||
"--disable-oggtest",
|
|
||||||
]
|
|
||||||
)
|
|
||||||
cpp.make()
|
|
||||||
cpp.make_install()
|
|
||||||
|
|
||||||
|
|
||||||
on_build(build)
|
|
||||||
|
|
||||||
package("libvorbis")
|
|
||||||
dep("semi-libc @same-arch")
|
|
||||||
cpp.use_auto_pack(["lib"])
|
|
||||||
|
|
||||||
package("libvorbis-dev")
|
|
||||||
dep("libvorbis (same)")
|
|
||||||
cpp.use_auto_pack(["dev"])
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
import os
|
|
||||||
import shutil
|
|
||||||
|
|
||||||
from lib.make import *
|
|
||||||
from lib import cpp
|
|
||||||
|
|
||||||
|
|
||||||
version("1.6.0")
|
|
||||||
description("a library to encode and decode images in WebP format")
|
|
||||||
maintainer("sisungo <[email protected]>")
|
|
||||||
source_url("https://github.com/webmproject/libwebp/archive/refs/tags/v1.6.0.tar.gz")
|
|
||||||
|
|
||||||
builddep("shortcut/c")
|
|
||||||
builddep("shortcut/cmake")
|
|
||||||
|
|
||||||
|
|
||||||
def split_libsharpyuv():
|
|
||||||
os.makedirs("sharpyuv/libdev/pkgconfig")
|
|
||||||
os.makedirs("sharpyuv/lib")
|
|
||||||
os.makedirs("sharpyuv/include")
|
|
||||||
os.rename("lib/pkgconfig/libsharpyuv.pc", "sharpyuv/libdev/pkgconfig/libsharpyuv.pc")
|
|
||||||
os.system("mv lib/libsharpyuv* sharpyuv/lib/")
|
|
||||||
os.rename("include/webp/sharpyuv", "sharpyuv/include/sharpyuv")
|
|
||||||
with open("sharpyuv/libdev/pkgconfig/libsharpyuv.pc", "r") as pcf:
|
|
||||||
pc = pcf.read()
|
|
||||||
pc = pc.replace(get_prefix("libwebp"), get_prefix("libsharpyuv"))
|
|
||||||
pc = pc.replace(f"{get_prefix('libwebp-dev')}/include/webp", f"{get_prefix('libsharpyuv-dev')}/include")
|
|
||||||
with open("sharpyuv/libdev/pkgconfig/libsharpyuv.pc", "wt+") as pcf:
|
|
||||||
pcf.write(pc)
|
|
||||||
|
|
||||||
|
|
||||||
def build():
|
|
||||||
cpp.cmake([
|
|
||||||
"-DBUILD_SHARED_LIBS=1",
|
|
||||||
f"-DCMAKE_INSTALL_LIBDIR={get_prefix('libwebp')}/lib",
|
|
||||||
f"-DCMAKE_INSTALL_BINDIR={get_prefix('libwebp-tools')}/bin",
|
|
||||||
f"-DCMAKE_INSTALL_INCLUDEDIR={get_prefix('libwebp-dev')}/include",
|
|
||||||
])
|
|
||||||
cpp.ninja()
|
|
||||||
if os.path.exists("../cpp_install"):
|
|
||||||
shutil.rmtree("../cpp_install")
|
|
||||||
cpp.ninja_install()
|
|
||||||
split_libsharpyuv()
|
|
||||||
|
|
||||||
on_build(build)
|
|
||||||
|
|
||||||
|
|
||||||
def pack_libsharpyuv(composer):
|
|
||||||
composer.add_dir("sharpyuv/lib", "lib")
|
|
||||||
|
|
||||||
def pack_libsharpyuv_dev(composer):
|
|
||||||
composer.add_dir("sharpyuv/libdev", "lib")
|
|
||||||
composer.add_dir("sharpyuv/include", "include")
|
|
||||||
|
|
||||||
package("libsharpyuv")
|
|
||||||
description("Library for sharp RGB to YUV conversion")
|
|
||||||
dep("semi-libc @same-arch")
|
|
||||||
on_pack(pack_libsharpyuv)
|
|
||||||
|
|
||||||
package("libsharpyuv-dev")
|
|
||||||
description("Library for sharp RGB to YUV conversion")
|
|
||||||
dep("libsharpyuv (same)")
|
|
||||||
dep("semi-libc-dev @same-arch")
|
|
||||||
on_pack(pack_libsharpyuv_dev)
|
|
||||||
|
|
||||||
package("libwebp")
|
|
||||||
dep("semi-libc @same-arch")
|
|
||||||
dep("libsharpyuv (same)")
|
|
||||||
cpp.use_auto_pack(["lib"])
|
|
||||||
|
|
||||||
package("libwebp-tools")
|
|
||||||
dep("libwebp (same)")
|
|
||||||
cpp.use_auto_pack(["bin"])
|
|
||||||
|
|
||||||
package("libwebp-dev")
|
|
||||||
dep("libwebp (same)")
|
|
||||||
dep("libsharpyuv-dev (same)")
|
|
||||||
dep("semi-libc-dev @same-arch")
|
|
||||||
cpp.use_auto_pack(["dev"])
|
|
||||||
@@ -123,6 +123,9 @@ def cmd_build_package(package: str):
|
|||||||
}
|
}
|
||||||
composer.write_manifest(manifest)
|
composer.write_manifest(manifest)
|
||||||
composer.write_links(pkginfo[lib.make._key_links])
|
composer.write_links(pkginfo[lib.make._key_links])
|
||||||
|
for i in pkginfo[lib.make._key_configure]:
|
||||||
|
composer.add_configure(i)
|
||||||
|
|
||||||
composer.compose()
|
composer.compose()
|
||||||
|
|
||||||
# Build success
|
# Build success
|
||||||
|
|||||||
Reference in New Issue
Block a user