pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
mk: Add libseccomp builtin
Module Name: pkgsrc-wip
Committed By: Dan Cîrnaț <cirnatdan%pkgsrc.org@localhost>
Pushed By: cirnatdan
Date: Mon Apr 19 21:36:43 2021 +0200
Changeset: 42418307171ba8b7c19f5deda2803b33863c99bc
Added Files:
mk/libseccomp.buildlink3.mk
mk/libseccomp.builtin.mk
Log Message:
mk: Add libseccomp builtin
libseccomp is a Linux-only dependency for some software like
gnome-desktop. There's currently no pkgsrc package for libseccomp
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=42418307171ba8b7c19f5deda2803b33863c99bc
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
mk/libseccomp.buildlink3.mk | 19 +++++++++++++++++++
mk/libseccomp.builtin.mk | 44 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+)
diffs:
diff --git a/mk/libseccomp.buildlink3.mk b/mk/libseccomp.buildlink3.mk
new file mode 100644
index 0000000000..f7ad996085
--- /dev/null
+++ b/mk/libseccomp.buildlink3.mk
@@ -0,0 +1,19 @@
+# $NetBSD: readline.buildlink3.mk,v 1.6 2019/09/02 02:23:02 rillig Exp $
+#
+# This Makefile fragment can be used to check for builtin libseccomp
+# on Linux
+
+LIBSECCOMP_BUILDLINK3_MK:= ${LIBSECCOMP_BUILDLINK3_MK}+
+.include "../../mk/bsd.fast.prefs.mk"
+
+.if !empty(LIBSECCOMP_BUILDLINK3_MK:M+)
+
+CHECK_BUILTIN.libseccomp:= yes
+.include "libseccomp.builtin.mk"
+CHECK_BUILTIN.libseccomp:= no
+
+BUILDLINK_TREE+= libseccomp -libseccomp
+BUILDLINK_BUILTIN_MK= "../../wip/mk/libseccomp.builtin.mk"
+BUILDLINK_LDADD.libseccomp= -lseccomp
+
+.endif # LIBSECCOMP_BUILDLINK3_MK
diff --git a/mk/libseccomp.builtin.mk b/mk/libseccomp.builtin.mk
new file mode 100644
index 0000000000..440d0e3cbe
--- /dev/null
+++ b/mk/libseccomp.builtin.mk
@@ -0,0 +1,44 @@
+# $NetBSD$
+#
+
+BUILTIN_PKG:= libseccomp
+
+BUILTIN_FIND_LIBS:= seccomp
+BUILTIN_FIND_HEADERS_VAR:= H_SECCOMP
+BUILTIN_FIND_HEADERS.H_SECCOMP= seccomp.h seccomp-syscalls.h
+
+BUILTIN_FIND_PKGCONFIG_FILES_VAR= LIBSECCOMP
+BUILTIN_FIND_PKGCONFIG_FILES.LIBSECCOMP= libseccomp.pc
+
+.include "../../mk/buildlink3/bsd.builtin.mk"
+
+.if empty(H_SECCOMP:M__nonexistent__) && \
+ !empty(BUILTIN_LIB_FOUND.seccomp:M[yY][eE][sS])
+IS_BUILTIN.libseccomp= yes
+BUILTIN_LIBNAME.libseccomp= seccomp
+BUILTIN_INCDIRS.libseccomp= ${H_SECCOMP:H}
+.else
+IS_BUILTIN.libseccomp= no
+.endif
+
+MAKEVARS+= IS_BUILTIN.libseccomp
+
+.if !defined(USE_BUILTIN.libseccomp)
+USE_BUILTIN.libseccomp= ${IS_BUILTIN.libseccomp}
+.endif
+
+CHECK_BUILTIN.libseccomp?= no
+.if empty(CHECK_BUILTIN.libseccomp:M[Nn][Oo])
+. if !empty(USE_BUILTIN.libseccomp:M[Yy][Ee][Ss])
+BUILDLINK_LIBNAME.libseccomp= ${BUILTIN_LIBNAME.libseccomp}
+BUILDLINK_INCDIRS.libseccomp= ${BUILTIN_INCDIRS.libseccomp}
+. endif
+
+BUILDLINK_TARGETS+= buildlink-libseccomp
+.PHONY: buildlink-libseccomp
+buildlink-libseccomp:
+ ${RUN}
+ ${MKDIR} ${BUILDLINK_DIR}/lib/pkgconfig
+ ${LN} -s /usr/lib/pkgconfig/libseccomp.pc ${BUILDLINK_DIR}/lib/pkgconfig/libseccomp.pc
+
+.endif #CHECK_BUILTIN.libseccomp
Home |
Main Index |
Thread Index |
Old Index