summaryrefslogtreecommitdiff
path: root/print/libcups
diff options
context:
space:
mode:
authormaya <maya@pkgsrc.org>2020-05-16 18:07:56 +0000
committermaya <maya@pkgsrc.org>2020-05-16 18:07:56 +0000
commit15f934703811ca7ea2597a1a98fd3be70937ad3b (patch)
tree93bb568c0f3905918338cad9a15a518d50f20e46 /print/libcups
parent2b1f794bc3075706c87b7df68f4dd8bf5d0b9248 (diff)
downloadpkgsrc-15f934703811ca7ea2597a1a98fd3be70937ad3b.tar.gz
Split cups-base in two: libcups and the printer daemon.
The intention with this change is to make it easier to enable CUPS support by default in places, without requiring the daemon (which might conflict with other printing setups). Bump cups-base PKGREVISION and make it depend on libcups.
Diffstat (limited to 'print/libcups')
-rw-r--r--print/libcups/DESCR14
-rw-r--r--print/libcups/Makefile75
-rw-r--r--print/libcups/PLIST30
-rw-r--r--print/libcups/buildlink3.mk33
-rw-r--r--print/libcups/options.mk66
5 files changed, 218 insertions, 0 deletions
diff --git a/print/libcups/DESCR b/print/libcups/DESCR
new file mode 100644
index 00000000000..2827c489cfb
--- /dev/null
+++ b/print/libcups/DESCR
@@ -0,0 +1,14 @@
+The Common UNIX Printing System provides a portable printing layer for
+UNIX operating systems. It has been developed by Easy Software Products
+to promote a standard printing solution for all UNIX vendors and users.
+CUPS provides the System V and Berkeley command-line interfaces.
+
+CUPS uses the Internet Printing Protocol (IETF-IPP) as the basis for
+managing print jobs and queues. The Line Printer Daemon (LPD, RFC1179)
+and AppSocket protocols are also supported with reduced functionality.
+
+CUPS adds network printer browsing and PostScript Printer Description
+("PPD")-based printing options to support real world applications under
+UNIX.
+
+This package consists of the library used for talking to CUPS.
diff --git a/print/libcups/Makefile b/print/libcups/Makefile
new file mode 100644
index 00000000000..1042022f75b
--- /dev/null
+++ b/print/libcups/Makefile
@@ -0,0 +1,75 @@
+# $NetBSD: Makefile,v 1.1 2020/05/16 18:07:56 maya Exp $
+
+.include "../../print/cups/Makefile.common"
+
+PKGNAME= libcups-${CUPS_VERS}
+MASTER_SITES= ${MASTER_SITE_GITHUB:=apple/}
+
+MAINTAINER= sbd@NetBSD.org
+COMMENT= Common UNIX Printing System library
+
+DISTINFO_FILE?= ${.CURDIR}/../../print/cups-base/distinfo
+PATCHDIR?= ${.CURDIR}/../../print/cups-base/patches
+
+GITHUB_PROJECT= cups
+GITHUB_RELEASE= v${PKGVERSION_NOREV}
+
+CONFLICTS+= LPRng-[0-9]* LPRng-core-[0-9]*
+
+WRKSRC= ${WRKDIR}/${DISTNAME:S/-source//}
+UNLIMIT_RESOURCES= datasize memorysize
+USE_LANGUAGES= c c++ # pdftops is a C++ application
+USE_LIBTOOL= yes
+USE_PKGLOCALEDIR= yes
+USE_TOOLS+= aclocal autoconf automake gmake pkg-config
+GNU_CONFIGURE= yes
+CONFIGURE_ARGS+= --localedir=${PREFIX}/${PKGLOCALEDIR}/locale
+CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFBASEDIR}
+CONFIGURE_ARGS+= --localstatedir=${VARBASE}
+CONFIGURE_ARGS+= --with-cachedir=${CUPS_CACHE:Q}
+CONFIGURE_ARGS+= --with-docdir=${PREFIX}/share/doc/cups
+CONFIGURE_ARGS+= --with-serverbindir=${PREFIX}/libexec/cups
+CONFIGURE_ARGS+= --with-components=libcups
+CONFIGURE_ARGS+= --enable-libpaper
+CONFIGURE_ARGS+= --enable-ssl
+
+CONFIGURE_ENV+= DSOFLAGS=${LDFLAGS:M*:Q}
+
+.include "../../mk/bsd.prefs.mk"
+.include "options.mk"
+
+# Explicitly disable epoll on illumos, it is provided for Linux compat only.
+CONFIGURE_ENV.SunOS+= ac_cv_func_epoll_create=no
+
+LIBS+= ${BUILDLINK_LDADD.iconv}
+
+# Avoid the following error when compiling with clang.
+# /usr/local/bin/ld: /usr/lib/crt1.o: relocation R_X86_64_32 against `_DYNAMIC'
+# can not be used when making a shared object; recompile with -fPIC
+BUILDLINK_TRANSFORM.FreeBSD+= rm:-Wl,-pie
+
+PKG_SYSCONFSUBDIR= cups
+CUPS_CACHE= ${VARBASE}/cache/cups
+
+.if !empty(OPSYS:MNetBSD) && !empty(MACHINE_ARCH:Mpowerpc)
+SUBST_CLASSES+= piefix
+SUBST_FILES.piefix= Makedefs.in
+SUBST_MESSAGE.piefix= Removing PIE flags
+SUBST_SED.piefix= -e 's|@PIEFLAGS@||g'
+SUBST_STAGE.piefix= pre-configure
+.endif
+
+pre-configure:
+ cd ${WRKSRC} && aclocal && autoconf
+
+.include "../../converters/libiconv/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../graphics/tiff/buildlink3.mk"
+.include "../../print/libpaper/buildlink3.mk"
+.include "../../security/gnutls/buildlink3.mk"
+.include "../../textproc/libunistring/buildlink3.mk"
+.include "../../mk/curses.buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/print/libcups/PLIST b/print/libcups/PLIST
new file mode 100644
index 00000000000..8f536549830
--- /dev/null
+++ b/print/libcups/PLIST
@@ -0,0 +1,30 @@
+@comment $NetBSD: PLIST,v 1.1 2020/05/16 18:07:56 maya Exp $
+bin/cups-config
+include/cups/adminutil.h
+include/cups/array.h
+include/cups/backend.h
+include/cups/cups.h
+include/cups/dir.h
+include/cups/file.h
+include/cups/http.h
+include/cups/ipp.h
+include/cups/language.h
+include/cups/ppd.h
+include/cups/pwg.h
+include/cups/raster.h
+include/cups/sidechannel.h
+include/cups/transcode.h
+include/cups/versioning.h
+lib/libcups.la
+lib/libcupsimage.la
+share/locale/ca/cups_ca.po
+share/locale/cs/cups_cs.po
+share/locale/de/cups_de.po
+share/locale/en/cups_en.po
+share/locale/es/cups_es.po
+share/locale/fr/cups_fr.po
+share/locale/it/cups_it.po
+share/locale/ja/cups_ja.po
+share/locale/pt_BR/cups_pt_BR.po
+share/locale/ru/cups_ru.po
+share/locale/zh_CN/cups_zh_CN.po
diff --git a/print/libcups/buildlink3.mk b/print/libcups/buildlink3.mk
new file mode 100644
index 00000000000..8d9f644e638
--- /dev/null
+++ b/print/libcups/buildlink3.mk
@@ -0,0 +1,33 @@
+# $NetBSD: buildlink3.mk,v 1.1 2020/05/16 18:07:56 maya Exp $
+
+BUILDLINK_TREE+= libcups
+
+.if !defined(LIBCUPS_BUILDLINK3_MK)
+LIBCUPS_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libcups+= libcups>=1.1.19nb3
+BUILDLINK_ABI_DEPENDS.libcups+= libcups>=2.3.1nb3
+BUILDLINK_PKGSRCDIR.libcups?= ../../print/libcups
+
+pkgbase := libcups
+.include "../../mk/pkg-build-options.mk"
+
+.if !empty(PKG_BUILD_OPTIONS.libcups:Mkerberos)
+.include "../../mk/krb5.buildlink3.mk"
+.endif
+
+.if !empty(PKG_BUILD_OPTIONS.libcups:Mdnssd)
+.include "../../net/mDNSResponder/buildlink3.mk"
+.endif
+
+.if ${OPSYS} != "Darwin" && !empty(PKG_BUILD_OPTIONS.libcups:Mavahi)
+.include "../../net/avahi/buildlink3.mk"
+.endif
+
+.include "../../converters/libiconv/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../graphics/tiff/buildlink3.mk"
+.include "../../security/gnutls/buildlink3.mk"
+.endif # LIBCUPS_BUILDLINK3_MK
+
+BUILDLINK_TREE+= -libcups
diff --git a/print/libcups/options.mk b/print/libcups/options.mk
new file mode 100644
index 00000000000..5dd0dd8b804
--- /dev/null
+++ b/print/libcups/options.mk
@@ -0,0 +1,66 @@
+# $NetBSD: options.mk,v 1.1 2020/05/16 18:07:56 maya Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.libcups
+PKG_SUPPORTED_OPTIONS= acl dnssd kerberos tcpwrappers
+PKG_SUGGESTED_OPTIONS= dnssd kerberos
+
+.if defined(PKG_OPTIONS.cups)
+PKG_LEGACY_OPTIONS+= ${PKG_OPTIONS.cups}
+PKG_OPTIONS_DEPRECATED_WARNINGS+= \
+ "Deprecated variable PKG_OPTIONS.cups used, use ${PKG_OPTIONS_VAR} instead."
+.endif
+
+.if ${OPSYS} != "Darwin"
+# CUPS on Darwin does not support DBus and libusb
+PKG_SUPPORTED_OPTIONS+= avahi dbus
+PKG_SUGGESTED_OPTIONS+= dbus
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Macl)
+CONFIGURE_ARGS+= --enable-acl
+.else
+CONFIGURE_ARGS+= --disable-acl
+.endif
+
+.if !empty(PKG_OPTIONS:Mavahi)
+.include "../../net/avahi/buildlink3.mk"
+CONFIGURE_ARGS+= --enable-avahi
+.else
+CONFIGURE_ARGS+= --disable-avahi
+.endif
+
+.if !empty(PKG_OPTIONS:Mdbus)
+. include "../../sysutils/dbus/buildlink3.mk"
+CONFIGURE_ARGS+= --enable-dbus
+.else
+CONFIGURE_ARGS+= --disable-dbus
+.endif
+
+.if !empty(PKG_OPTIONS:Mdnssd)
+.include "../../net/mDNSResponder/buildlink3.mk"
+CONFIGURE_ARGS+= --enable-dnssd
+.else
+CONFIGURE_ARGS+= --disable-dnssd
+.endif
+
+.if !empty(PKG_OPTIONS:Mkerberos)
+.include "../../mk/krb5.buildlink3.mk"
+CONFIGURE_ARGS+= --enable-gssapi
+.else
+CONFIGURE_ARGS+= --disable-gssapi
+# https://github.com/apple/cups/issues/4947
+SUBST_CLASSES+= nokerb
+SUBST_STAGE.nokerb= post-build
+SUBST_SED.nokerb+= -e '\%<Policy kerberos>%,\%</Policy>%s/^/\#/'
+SUBST_FILES.nokerb+= conf/cupsd.conf
+SUBST_MESSAGE.nokerb= Commenting out kerberos section in config.
+.endif
+
+.if !empty(PKG_OPTIONS:Mtcpwrappers)
+.include "../../security/tcp_wrappers/buildlink3.mk"
+CONFIGURE_ARGS+= --enable-tcp-wrappers
+.else
+CONFIGURE_ARGS+= --disable-tcp-wrappers
+.endif