gcr: add recipe

This commit is contained in:
Gerasim Troeglazov
2022-08-24 23:52:06 +10:00
parent c0b4eba107
commit d77f987b70
3 changed files with 178 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
#!/bin/sh
SYSTEM_DATA_DIR="`finddir B_SYSTEM_DATA_DIRECTORY`"
NONPACKAGED_DATA_DIR="`finddir B_SYSTEM_NONPACKAGED_DATA_DIRECTORY`"
mkdir -p $NONPACKAGED_DATA_DIR/glib-2.0/schemas
cp -nrf $SYSTEM_DATA_DIR/glib-2.0/schemas/* $NONPACKAGED_DATA_DIR/glib-2.0/schemas
glib-compile-schemas $NONPACKAGED_DATA_DIR/glib-2.0/schemas

View File

@@ -0,0 +1,139 @@
SUMMARY="A library for bits of crypto UI and parsing"
DESCRIPTION="GCR is a library for displaying certificates and crypto UI, accessing key stores. \
It also provides the viewer for crypto files on the GNOME desktop.
GCK is a library for accessing PKCS#11 modules like smart cards, in a (G)object oriented way."
HOMEPAGE="https://gitlab.gnome.org/GNOME/gcr"
COPYRIGHT="2010-2022 Stefan Walter
2010-2021 Collabora Ltd
2020 Marco Trevisan"
LICENSE="GNU LGPL v2.1"
REVISION="1"
SOURCE_URI="https://gitlab.gnome.org/GNOME/gcr/-/archive/$portVersion/gcr-$portVersion.tar.gz"
CHECKSUM_SHA256="f25de5063ffe6359c79f86d70a53c2d398db4e256e2de58c2a3bd2e8111b8f11"
PATCHES="gcr-$portVersion.patchset"
ADDITIONAL_FILES="compile-schemas.sh"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
POST_INSTALL_SCRIPTS="
$relativePostInstallDir/compile-schemas.sh
"
PROVIDES="
gcr$secondaryArchSuffix = $portVersion compat >= 3
cmd:gcr_viewer$secondaryArchSuffix
cmd:gcr_ssh_askpass$secondaryArchSuffix
cmd:gcr_prompter$secondaryArchSuffix
lib:libgck_1$secondaryArchSuffix = 0.0.0 compat >= 0
lib:libgcr_3$secondaryArchSuffix = 1.0.0 compat >= 1
lib:libgcr_base_3$secondaryArchSuffix = 1.0.0 compat >= 1
lib:libgcr_ui_3$secondaryArchSuffix = 1.0.0 compat >= 1
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libcairo$secondaryArchSuffix
lib:libgcrypt$secondaryArchSuffix
lib:libgdk_3$secondaryArchSuffix
lib:libgdk_pixbuf_2.0$secondaryArchSuffix
lib:libgio_2.0$secondaryArchSuffix
lib:libglib_2.0$secondaryArchSuffix
lib:libgobject_2.0$secondaryArchSuffix
lib:libgtk_3$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libp11_kit$secondaryArchSuffix
lib:libpango_1.0$secondaryArchSuffix
cmd:gpg$secondaryArchSuffix
cmd:ssh_add
"
PROVIDES_devel="
gcr${secondaryArchSuffix}_devel = $portVersion compat >= 3
devel:libgck_1$secondaryArchSuffix = 0.0.0 compat >= 0
devel:libgcr_3$secondaryArchSuffix = 1.0.0 compat >= 1
devel:libgcr_base_3$secondaryArchSuffix = 1.0.0 compat >= 1
devel:libgcr_ui_3$secondaryArchSuffix = 1.0.0 compat >= 1
"
REQUIRES_devel="
gcr$secondaryArchSuffix == $portVersion base
devel:libcairo$secondaryArchSuffix
devel:libgdk_3$secondaryArchSuffix
devel:libgdk_pixbuf_2.0$secondaryArchSuffix
devel:libgcrypt$secondaryArchSuffix
devel:libgio_2.0$secondaryArchSuffix
devel:libglib_2.0$secondaryArchSuffix
devel:libgobject_2.0$secondaryArchSuffix
devel:libgtk_3$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libp11_kit$secondaryArchSuffix
devel:libpango_1.0$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libgcrypt$secondaryArchSuffix
devel:libglib_2.0$secondaryArchSuffix
devel:libgtk_3$secondaryArchSuffix
devel:libp11_kit$secondaryArchSuffix
devel:libxml2$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:find
cmd:gcc$secondaryArchSuffix
cmd:gtkdocize
cmd:gpg$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:meson
cmd:pkg_config$secondaryArchSuffix
cmd:ssh_add
"
BUILD()
{
CFLAGS="-D_BSD_SOURCE" \
LDFLAGS="-lbsd -lgnu -lnetwork" \
meson build \
--buildtype=release \
--prefix="$prefix" \
--libdir="$libDir" \
--includedir="$includeDir" \
--bindir="$binDir" \
--libexecdir="$binDir" \
--datadir="$dataDir" \
--localedir="$dataDir/locale" \
-Dsystemd=disabled \
-Dssh_agent=false \
-Dgtk_doc=false \
-Dintrospection=false
ninja -C build
}
INSTALL()
{
ninja install -C build
# remove mime and schemas cache
rm -rf $dataDir/mime/{aliases,generic-icons,globs,globs2,icons,magic}
rm -rf $dataDir/mime/{mime.cache,subclasses,treemagic,types,version,XMLnamespaces}
rm -rf $dataDir/glib-2.0/schemas/gschemas.compiled
# copy postinstall script
mkdir -p $postInstallDir
cp -f $portDir/additional-files/compile-schemas.sh $postInstallDir
chmod -v a+rx $postInstallDir/compile-schemas.sh
prepareInstalledDevelLibs \
libgcr-3 \
libgcr-base-3 \
libgcr-ui-3 \
libgck-1
ln -s $developLibDir/libgcr-3.so.* $libDir
fixPkgconfig
# devel package
packageEntries devel \
$developDir
}

View File

@@ -0,0 +1,31 @@
From 45fcbb93926ab47dfb96cf41f079bb2aac490dce Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Mon, 22 Aug 2022 15:30:50 +1000
Subject: Fix build
diff --git a/gcr/test-secure-memory.c b/gcr/test-secure-memory.c
index 2b9061c..0c703e2 100644
--- a/gcr/test-secure-memory.c
+++ b/gcr/test-secure-memory.c
@@ -55,6 +55,9 @@ extern int egg_secure_warnings;
static gsize
get_rlimit_memlock (void)
{
+#ifdef __HAIKU__
+ return 0;
+#else
struct rlimit memlock;
/* If the test program is running as a privileged user, it is
@@ -83,6 +86,7 @@ get_rlimit_memlock (void)
}
return memlock.rlim_cur;
+#endif
}
static void
--
2.36.1