forked from semios/ports
@@ -0,0 +1,62 @@
|
||||
import subprocess
|
||||
|
||||
from lib import arch, cpp
|
||||
from lib.make import *
|
||||
|
||||
VERSION = "5.48"
|
||||
|
||||
version(VERSION)
|
||||
description("utility to infer file type and information")
|
||||
maintainer("sisungo <[email protected]>")
|
||||
source_git("https://github.com/file/file.git", "FILE5_48")
|
||||
|
||||
builddep("shortcut/c")
|
||||
builddep("shortcut/autotools")
|
||||
builddep(f"libz-dev @{arch.get_target()}")
|
||||
builddep(f"libzstd-dev @{arch.get_target()}")
|
||||
builddep(f"liblzma-dev @{arch.get_target()}")
|
||||
builddep(f"libbzip2-dev @{arch.get_target()}")
|
||||
|
||||
|
||||
def build():
|
||||
subprocess.run(["autoreconf", "-fiv"], check=True)
|
||||
cpp.configure([
|
||||
"--prefix=/",
|
||||
f"--libdir={get_prefix('libmagic')}/lib",
|
||||
f"--includedir={get_prefix('libmagic-dev')}/include",
|
||||
f"--bindir={get_prefix('file')}/bin",
|
||||
f"--datadir={get_prefix('file-magic-db')}/share",
|
||||
])
|
||||
cpp.make()
|
||||
cpp.make_install()
|
||||
|
||||
|
||||
on_build(build)
|
||||
|
||||
|
||||
def pack_magic_db(composer):
|
||||
composer.makedir("share")
|
||||
composer.add_dir("share/misc")
|
||||
|
||||
|
||||
package("file-magic-db")
|
||||
arch_any()
|
||||
on_pack(pack_magic_db)
|
||||
|
||||
|
||||
package("libmagic")
|
||||
dep("semi-libc @same-arch")
|
||||
dep("file-magic-db (same-version) @any")
|
||||
dep("libz @same-arch")
|
||||
dep("libzstd @same-arch")
|
||||
dep("liblzma @same-arch")
|
||||
dep("libbzip2 @same-arch")
|
||||
cpp.use_auto_pack(["lib"])
|
||||
|
||||
package("libmagic-dev")
|
||||
dep("libmagic (same)")
|
||||
cpp.use_auto_pack(["dev"])
|
||||
|
||||
package("file")
|
||||
dep("libmagic (same)")
|
||||
cpp.use_auto_pack(["bin"])
|
||||
Reference in New Issue
Block a user