101 lines
2.6 KiB
Python
101 lines
2.6 KiB
Python
import os
|
|
|
|
from lib.make import *
|
|
from lib import cpp, arch
|
|
|
|
|
|
version("2.4.19")
|
|
description("The current standards-based, open source printing system developed by OpenPrinting for Linux® and other Unix®-like operating systems.")
|
|
maintainer("sisungo <[email protected]>")
|
|
source_url("https://github.com/OpenPrinting/cups/releases/download/v2.4.19/cups-2.4.19-source.tar.gz")
|
|
|
|
builddep("shortcut/c++")
|
|
builddep("shortcut/autotools")
|
|
builddep("aws-lc-dev @target")
|
|
builddep("libdbus-dev @target")
|
|
builddep("linux-pam-dev @target")
|
|
builddep("libusb-dev @target")
|
|
builddep("pkgconf @target")
|
|
builddep("linux-dev @target")
|
|
|
|
|
|
def build():
|
|
cpp.configure([
|
|
"--prefix=/",
|
|
f"--includedir={get_prefix('cups-dev')}/include",
|
|
f"--bindir={get_prefix('cups')}/bin",
|
|
f"--sbindir={get_prefix('cups')}/bin",
|
|
f"--datadir={get_prefix('cups')}/share",
|
|
f"--libdir={get_prefix('cups')}/lib",
|
|
"--sysconfdir=/var/config",
|
|
"--enable-libusb",
|
|
"--with-cups-user=_cups",
|
|
"--with-cups-group=_lp",
|
|
"--with-system-groups=wheel",
|
|
])
|
|
cpp.make()
|
|
cpp.make_install([f"BUILDROOT={os.getcwd()}/../cpp_install"])
|
|
|
|
on_build(build)
|
|
|
|
|
|
def fix_libdir():
|
|
with open("lib/pkgconfig/cups.pc") as fd:
|
|
content = fd.read()
|
|
content = content.replace(f"libdir={get_prefix('cups')}/lib", f"libdir={get_prefix('libcups')}/lib")
|
|
os.remove("lib/pkgconfig/cups.pc")
|
|
with open("lib/pkgconfig/cups.pc", "wt+") as fd:
|
|
fd.write(content)
|
|
|
|
def pack_libcups(composer):
|
|
composer.makedir("lib")
|
|
composer.add("lib/libcups.so.2")
|
|
composer.add("lib/libcups.so")
|
|
|
|
def pack_libcupsimage(composer):
|
|
composer.makedir("lib")
|
|
composer.add("lib/libcupsimage.so.2")
|
|
composer.add("lib/libcupsimage.so")
|
|
|
|
def pack_dev(composer):
|
|
fix_libdir()
|
|
composer.makedir("lib")
|
|
composer.add("lib/pkgconfig")
|
|
composer.add("include")
|
|
|
|
def pack_cups(composer):
|
|
composer.add("bin")
|
|
composer.makedir("lib")
|
|
composer.add("lib/cups")
|
|
composer.makedir("share")
|
|
composer.add("share/cups")
|
|
composer.add("var/config", "share/config")
|
|
|
|
def pack_docs(composer):
|
|
composer.makedir("share")
|
|
composer.add("share/man")
|
|
|
|
package("libcups")
|
|
dep("libssl @same-arch")
|
|
dep("libcrypto @same-arch")
|
|
dep("semi-libc @same-arch")
|
|
on_pack(pack_libcups)
|
|
|
|
package("libcupsimage")
|
|
dep("libcups (same)")
|
|
on_pack(pack_libcupsimage)
|
|
|
|
package("cups-dev")
|
|
dep("libcups (same)")
|
|
dep("libcupsimage (same)")
|
|
dep("aws-lc-dev @same-arch")
|
|
on_pack(pack_dev)
|
|
|
|
package("cups")
|
|
dep("libcups (same)")
|
|
dep("libcupsimage (same)")
|
|
on_pack(pack_cups)
|
|
|
|
package("cups-docs")
|
|
on_pack(pack_docs)
|