forked from semios/ports
Compare commits
| Author | SHA256 | Date | |
|---|---|---|---|
|
|
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,38 +0,0 @@
|
|||||||
from lib import cpp
|
|
||||||
from lib.make import *
|
|
||||||
|
|
||||||
|
|
||||||
version("1.0.16")
|
|
||||||
description("The Free Implementation of the Unicode Bidirectional Algorithm.")
|
|
||||||
maintainer("sisungo <[email protected]>")
|
|
||||||
source_url("https://github.com/fribidi/fribidi/releases/download/v1.0.16/fribidi-1.0.16.tar.xz")
|
|
||||||
|
|
||||||
builddep("shortcut/c")
|
|
||||||
builddep("shortcut/autotools")
|
|
||||||
|
|
||||||
|
|
||||||
def build():
|
|
||||||
cpp.configure([
|
|
||||||
f"--libdir={get_prefix('libfribidi')}/lib",
|
|
||||||
f"--bindir={get_prefix('fribidi')}/bin",
|
|
||||||
f"--includedir={get_prefix('libfribidi-dev')}/include",
|
|
||||||
"--disable-deprecated",
|
|
||||||
])
|
|
||||||
cpp.make()
|
|
||||||
cpp.make_install()
|
|
||||||
|
|
||||||
on_build(build)
|
|
||||||
|
|
||||||
|
|
||||||
package("libfribidi")
|
|
||||||
dep("semi-libc @same-arch")
|
|
||||||
cpp.use_auto_pack(["lib"])
|
|
||||||
|
|
||||||
package("fribidi")
|
|
||||||
dep("libfribidi (same)")
|
|
||||||
cpp.use_auto_pack(["bin"])
|
|
||||||
|
|
||||||
package("libfribidi-dev")
|
|
||||||
dep("libfribidi (same)")
|
|
||||||
dep("semi-libc-dev @same-arch")
|
|
||||||
cpp.use_auto_pack(["dev"])
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
import glob
|
|
||||||
import os
|
|
||||||
import shutil
|
|
||||||
|
|
||||||
from lib.make import *
|
|
||||||
from lib import cpp
|
|
||||||
|
|
||||||
|
|
||||||
version("14.3.1")
|
|
||||||
description("HarfBuzz text shaping engine")
|
|
||||||
maintainer("sisungo <[email protected]>")
|
|
||||||
source_url("https://github.com/harfbuzz/harfbuzz/releases/download/14.3.1/harfbuzz-14.3.1.tar.xz")
|
|
||||||
|
|
||||||
builddep("shortcut/meson")
|
|
||||||
builddep("shortcut/c++")
|
|
||||||
builddep("glib-dev @target")
|
|
||||||
builddep("libicu4c-dev @target")
|
|
||||||
builddep("libcairo-dev @target")
|
|
||||||
builddep("gobject-introspection @target")
|
|
||||||
builddep("glib-tools")
|
|
||||||
|
|
||||||
|
|
||||||
def fix_pc(newpkgname):
|
|
||||||
path = f"lib/pkgconfig/harfbuzz-{newpkgname}.pc"
|
|
||||||
with open(path, 'r') as file:
|
|
||||||
content = file.read()
|
|
||||||
content = content.replace(
|
|
||||||
"-I${includedir}/harfbuzz",
|
|
||||||
f"-I${{includedir}}/harfbuzz -I{get_prefix(f'libharfbuzz-{newpkgname}-dev')}/include/harfbuzz"
|
|
||||||
)
|
|
||||||
content = content.replace("-L${libdir}", f"-L${{libdir}} -L{get_prefix(f'libharfbuzz-{newpkgname}')}/lib")
|
|
||||||
with open(path, 'wt+') as file:
|
|
||||||
file.write(content)
|
|
||||||
|
|
||||||
|
|
||||||
def build():
|
|
||||||
cpp.meson_setup([
|
|
||||||
"--prefix=/",
|
|
||||||
f"--libdir={get_prefix('libharfbuzz')}/lib",
|
|
||||||
f"--includedir={get_prefix('libharfbuzz-dev')}/include",
|
|
||||||
f"-Dcmakepackagedir={get_prefix('libharfbuzz-dev')}/lib/cmake",
|
|
||||||
"-Dglib=disabled",
|
|
||||||
"-Dgobject=enabled",
|
|
||||||
"-Dcairo=enabled",
|
|
||||||
"-Dicu=enabled",
|
|
||||||
"-Dfreetype=enabled",
|
|
||||||
"-Dintrospection=enabled",
|
|
||||||
"-Dtests=disabled",
|
|
||||||
])
|
|
||||||
cpp.meson_compile()
|
|
||||||
if os.path.exists("../cpp_install"):
|
|
||||||
shutil.rmtree("../cpp_install")
|
|
||||||
cpp.meson_install()
|
|
||||||
os.mkdir("include/gir")
|
|
||||||
os.rename("share/gir-1.0", "include/gir/gir-1.0")
|
|
||||||
fix_pc("gobject")
|
|
||||||
|
|
||||||
on_build(build)
|
|
||||||
|
|
||||||
|
|
||||||
def pack_glob(composer, globs, excluded_kw=[]):
|
|
||||||
for iglob in globs:
|
|
||||||
for i in glob.glob(iglob):
|
|
||||||
if any(excluded_pattern in i for excluded_pattern in excluded_kw):
|
|
||||||
continue
|
|
||||||
composer.makedirs(os.path.dirname(i))
|
|
||||||
if os.path.islink(i) or os.path.isfile(i):
|
|
||||||
composer.addfile(i)
|
|
||||||
else:
|
|
||||||
composer.add_dir(i)
|
|
||||||
|
|
||||||
|
|
||||||
package("libharfbuzz")
|
|
||||||
dep("libfreetype @same-arch")
|
|
||||||
dep("libcairo @same-arch")
|
|
||||||
dep("libicu4c @same-arch")
|
|
||||||
dep("libpng @same-arch")
|
|
||||||
dep("libz @same-arch")
|
|
||||||
on_pack(lambda c: pack_glob(c, ["lib/*.so*"], ["gobject"]))
|
|
||||||
|
|
||||||
package("libharfbuzz-dev")
|
|
||||||
dep("libharfbuzz (same)")
|
|
||||||
dep("libfreetype-dev @same-arch")
|
|
||||||
dep("libcairo-dev @same-arch")
|
|
||||||
dep("libicu4c-dev @same-arch")
|
|
||||||
dep("libpng-dev @same-arch")
|
|
||||||
dep("libz-dev @same-arch")
|
|
||||||
on_pack(lambda c: pack_glob(c, ["lib/cmake", "lib/pkgconfig/*", "include/harfbuzz/*"], ["gobject"]))
|
|
||||||
|
|
||||||
package("libharfbuzz-gobject")
|
|
||||||
dep("libharfbuzz (same)")
|
|
||||||
dep("libglib @same-arch")
|
|
||||||
dep("libgobject @same-arch")
|
|
||||||
on_pack(lambda c: pack_glob(c, ["lib/*gobject*", "lib/girepository-1.0"]))
|
|
||||||
|
|
||||||
package("libharfbuzz-gobject-dev")
|
|
||||||
dep("libharfbuzz-gobject (same)")
|
|
||||||
dep("libharfbuzz-dev (same)")
|
|
||||||
dep("glib-dev @same-arch")
|
|
||||||
on_pack(lambda c: pack_glob(c, ["lib/pkgconfig/*gobject*", "include/harfbuzz/*gobject*", "include/gir"]))
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
from lib.make import *
|
|
||||||
from lib import cpp
|
|
||||||
|
|
||||||
|
|
||||||
version("2.5.1")
|
|
||||||
description("The FreeDesktop Shared MIMO Info database and utilities")
|
|
||||||
maintainer("sisungo <[email protected]>")
|
|
||||||
source_url("https://gitlab.freedesktop.org/xdg/shared-mime-info/-/archive/2.5.1/shared-mime-info-2.5.1.tar.gz")
|
|
||||||
|
|
||||||
builddep("shortcut/c++")
|
|
||||||
builddep("shortcut/meson")
|
|
||||||
builddep("libintl-dev @target")
|
|
||||||
builddep("gettext")
|
|
||||||
builddep("libxml2-dev @target")
|
|
||||||
builddep("glib-dev @target")
|
|
||||||
|
|
||||||
|
|
||||||
def build():
|
|
||||||
cpp.meson_setup([
|
|
||||||
f"--prefix={get_prefix('shared-mime-info')}",
|
|
||||||
"-Dbuild-tools=true",
|
|
||||||
"-Dbuild-translations=true",
|
|
||||||
"-Dbuild-tests=false",
|
|
||||||
"-Dbuild-spec=false",
|
|
||||||
])
|
|
||||||
cpp.meson_compile()
|
|
||||||
cpp.meson_install()
|
|
||||||
|
|
||||||
on_build(build)
|
|
||||||
|
|
||||||
|
|
||||||
def pack(composer):
|
|
||||||
composer.makedir("lib")
|
|
||||||
composer.makedir("share")
|
|
||||||
composer.add_dir("share/mime")
|
|
||||||
composer.add_dir("share/pkgconfig", "lib/pkgconfig")
|
|
||||||
composer.add_dir("share/locale")
|
|
||||||
composer.add_dir("bin")
|
|
||||||
|
|
||||||
package("shared-mime-info")
|
|
||||||
dep("libxml2 @same-arch")
|
|
||||||
dep("libglib @same-arch")
|
|
||||||
dep("libcxx @same-arch")
|
|
||||||
on_pack(pack)
|
|
||||||
@@ -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