forked from semios/ports
feat: add linux kernel initramfs and related tools
Signed-off-by: sisungo <[email protected]>
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
import os
|
||||
|
||||
from lib import rust
|
||||
from lib.make import *
|
||||
|
||||
|
||||
version("0.1.0-alpha.2")
|
||||
description("Linux device userspace daemon.")
|
||||
maintainer("sisungo <[email protected]>")
|
||||
source_url("https://gitea.semilabs.org/semios/lxdeviced/archive/0.1.0-alpha.2.tar.gz")
|
||||
|
||||
builddep("shortcut/rust")
|
||||
|
||||
|
||||
def build():
|
||||
rust.build()
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
PKGCONF_LIBUDEV="""
|
||||
prefix=/
|
||||
exec_prefix=/
|
||||
libdir=
|
||||
includedir=
|
||||
|
||||
Name: libudev
|
||||
Description: Udev library -- compatible, powered by lxdeviced
|
||||
Version: 260
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -ludev
|
||||
"""
|
||||
|
||||
|
||||
def pack(composer):
|
||||
composer.makedirs("share/device")
|
||||
composer.add_dir("misc/rules", "share/device/rules")
|
||||
oldpwd = os.getcwd()
|
||||
os.chdir(rust.artifacts_dir())
|
||||
composer.makedir("bin")
|
||||
composer.addfile("lxdeviced", "bin/lxdeviced")
|
||||
composer.addfile("device", "bin/device")
|
||||
os.chdir(oldpwd)
|
||||
|
||||
def pack_libudev(composer):
|
||||
oldpwd = os.getcwd()
|
||||
os.chdir(rust.artifacts_dir())
|
||||
composer.makedir("lib")
|
||||
composer.addfile("libudev.so", "lib/libudev.so")
|
||||
os.chdir(oldpwd)
|
||||
|
||||
def pack_libudev_dev(composer):
|
||||
oldpwd = os.getcwd()
|
||||
composer.makedir("include")
|
||||
composer.addfile("libcompat/udev/include/libudev.h", "include/libudev.h")
|
||||
composer.makedirs("lib/pkgconfig")
|
||||
pkgconf = PKGCONF_LIBUDEV.replace("libdir=", f"libdir={get_prefix('lxdeviced-libudev')}/lib")
|
||||
pkgconf = PKGCONF_LIBUDEV.replace("includedir=", f"includedir={get_prefix('lxdeviced-libudev-dev')}/include")
|
||||
with open(f"{composer.workdir}/bundle/lib/pkgconfig/libudev.pc", "wt+") as file:
|
||||
file.write(pkgconf)
|
||||
os.chdir(oldpwd)
|
||||
|
||||
|
||||
package("lxdeviced")
|
||||
on_pack(pack)
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("lxdeviced-libudev")
|
||||
on_pack(pack_libudev)
|
||||
dep("semi-libc @same-arch")
|
||||
|
||||
package("lxdeviced-libudev-dev")
|
||||
on_pack(pack_libudev_dev)
|
||||
dep("lxdeviced-libudev (same)")
|
||||
Reference in New Issue
Block a user