Adding all you need for gtk mingw.

This commit is contained in:
root 2022-06-30 16:02:48 +02:00
parent f589449618
commit 12cd71fa5d
45 changed files with 3752 additions and 0 deletions

View File

@ -0,0 +1,135 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# XXX: atm, libbz2.a is always PIC :(, so it is always built quickly
# (since we're building shared libs) ...
EAPI=7
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/bzip2.gpg
inherit toolchain-funcs multilib-minimal usr-ldscript verify-sig
if [[ ${PVR} != 1.0.8-r1 ]]; then
die "Please remove libbz2.so.1.0 logic from multilib_src_install"
fi
DESCRIPTION="A high-quality data compressor used extensively by Gentoo Linux"
HOMEPAGE="https://sourceware.org/bzip2/"
SRC_URI="https://sourceware.org/pub/${PN}/${P}.tar.gz"
SRC_URI+=" verify-sig? ( https://sourceware.org/pub/${PN}/${P}.tar.gz.sig )"
LICENSE="BZIP2"
SLOT="0/1" # subslot = SONAME
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="static static-libs"
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-bzip2 )"
PATCHES=(
"${FILESDIR}"/${PN}-1.0.4-makefile-CFLAGS.patch
"${FILESDIR}"/${PN}-1.0.8-saneso.patch
"${FILESDIR}"/${PN}-1.0.4-man-links.patch #172986
"${FILESDIR}"/${PN}-1.0.6-progress.patch
"${FILESDIR}"/${PN}-1.0.3-no-test.patch
"${FILESDIR}"/${PN}-1.0.8-mingw.patch #393573
"${FILESDIR}"/${PN}-1.0.8-out-of-tree-build.patch
)
DOCS=( CHANGES README{,.COMPILATION.PROBLEMS,.XML.STUFF} manual.pdf )
HTML_DOCS=( manual.html )
src_prepare() {
default
# - Use right man path
# - Generate symlinks instead of hardlinks
# - pass custom variables to control libdir
sed -i \
-e 's:\$(PREFIX)/man:\$(PREFIX)/share/man:g' \
-e 's:ln -s -f $(PREFIX)/bin/:ln -s -f :' \
-e 's:$(PREFIX)/lib:$(PREFIX)/$(LIBDIR):g' \
Makefile || die
}
bemake() {
emake \
VPATH="${S}" \
CC="$(tc-getCC)" \
AR="$(tc-getAR)" \
RANLIB="$(tc-getRANLIB)" \
"$@"
}
multilib_src_compile() {
bemake -f "${S}"/Makefile-libbz2_so all
# Make sure we link against the shared lib #504648
ln -s libbz2.so.${PV} libbz2.so || die
bemake -f "${S}"/Makefile all LDFLAGS="${LDFLAGS} $(usex static -static '')"
}
multilib_src_test() {
cp "${S}"/sample* "${BUILD_DIR}" || die
bemake -f "${S}"/Makefile check
}
multilib_src_install() {
into /usr
# Install the shared lib manually. We install:
# .x.x.x - standard shared lib behavior
# .x.x - SONAME some distros use #338321
# .x - SONAME Gentoo uses
dolib.so libbz2.so.${PV}
local v
for v in libbz2.so{,.{${PV%%.*},${PV%.*}}} ; do
dosym libbz2.so.${PV} /usr/$(get_libdir)/${v}
done
# Install libbz2.so.1.0 due to accidental soname change in 1.0.7.
# Reference: 98da0ad82192d21ad74ae52366ea8466e2acea24.
# OK to remove one year after 2020-04-11.
if [[ ! -L "${ED}/usr/$(get_libdir)/libbz2.so.1.0" ]]; then
dosym libbz2.so.${PV} "/usr/$(get_libdir)/libbz2.so.1.0"
fi
use static-libs && dolib.a libbz2.a
if multilib_is_native_abi ; then
gen_usr_ldscript -a bz2
dobin bzip2recover.exe
into /
dobin bzip2.exe
fi
}
multilib_src_install_all() {
# `make install` doesn't cope with out-of-tree builds, nor with
# installing just non-binaries, so handle things ourselves.
insinto /usr/include
doins bzlib.h
into /usr
dobin bz{diff,grep,more}
doman *.1
dosym bzdiff /usr/bin/bzcmp
dosym bzdiff.1 /usr/share/man/man1/bzcmp.1
dosym bzmore /usr/bin/bzless
dosym bzmore.1 /usr/share/man/man1/bzless.1
local x
for x in bunzip2 bzcat bzip2recover ; do
dosym bzip2.1 /usr/share/man/man1/${x}.1
done
for x in bz{e,f}grep ; do
dosym bzgrep /usr/bin/${x}
dosym bzgrep.1 /usr/share/man/man1/${x}.1
done
einstalldocs
# move "important" bzip2 binaries to /bin and use the shared libbz2.so
dosym bzip2 /bin/bzcat
dosym bzip2 /bin/bunzip2
}

View File

@ -0,0 +1,9 @@
--- a/Makefile
+++ b/Makefile
@@ -23,5 +23,5 @@
bzlib.o
-all: libbz2.a bzip2 bzip2recover test
+all: libbz2.a bzip2 bzip2recover
bzip2: libbz2.a bzip2.o

View File

@ -0,0 +1,25 @@
--- a/Makefile
+++ b/Makefile
@@ -18,10 +18,9 @@
CC=gcc
AR=ar
RANLIB=ranlib
-LDFLAGS=
BIGFILES=-D_FILE_OFFSET_BITS=64
-CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)
+CFLAGS+=-Wall -Winline $(BIGFILES) $(CPPFLAGS)
# Where you want it installed when you do 'make install'
PREFIX=/usr/local
--- a/Makefile-libbz2_so
+++ b/Makefile-libbz2_so
@@ -24,7 +24,7 @@
SHELL=/bin/sh
CC=gcc
BIGFILES=-D_FILE_OFFSET_BITS=64
-CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES)
+CFLAGS+=-fpic -fPIC -Wall -Winline $(BIGFILES) $(CPPFLAGS)
OBJS= blocksort.o \
huffman.o \

View File

@ -0,0 +1,12 @@
http://bugs.gentoo.org/172986
--- a/Makefile
+++ b/Makefile
@@ -85,4 +85,7 @@
cp -f bzip2.1 $(PREFIX)/share/man/man1
chmod a+r $(PREFIX)/share/man/man1/bzip2.1
+ ln -s -f bzip2.1 $(PREFIX)/share/man/man1/bunzip2.1
+ ln -s -f bzip2.1 $(PREFIX)/share/man/man1/bzcat.1
+ ln -s -f bzip2.1 $(PREFIX)/share/man/man1/bzip2recover.1
cp -f bzlib.h $(PREFIX)/include
chmod a+r $(PREFIX)/include/bzlib.h

View File

@ -0,0 +1,163 @@
Ripped from Mandrake
http://bugs.gentoo.org/82192
--- a/bzip2.1
+++ b/bzip2.1
@@ -235,6 +235,10 @@
Suppress non-essential warning messages. Messages pertaining to
I/O errors and other critical events will not be suppressed.
.TP
+.B \-p \-\-show\-progress
+Show percentage of input\-file done and while compressing show the percentage
+of the original file the new file is.
+.TP
.B \-v --verbose
Verbose mode -- show the compression ratio for each file processed.
Further \-v's increase the verbosity level, spewing out lots of
--- a/bzip2.c
+++ b/bzip2.c
@@ -145,6 +145,7 @@
#include <signal.h>
#include <math.h>
#include <errno.h>
+#include <time.h>
#include <ctype.h>
#include "bzlib.h"
@@ -301,6 +302,7 @@
Char progNameReally[FILE_NAME_LEN];
FILE *outputHandleJustInCase;
Int32 workFactor;
+Char showProgress;
static void panic ( Char* ) NORETURN;
static void ioError ( void ) NORETURN;
@@ -425,6 +427,12 @@
UInt32 nbytes_in_lo32, nbytes_in_hi32;
UInt32 nbytes_out_lo32, nbytes_out_hi32;
Int32 bzerr, bzerr_dummy, ret;
+ double fileSize = 0; /* initialized to make the compiler stop crying */
+ /* double because big files might otherwhise give
+ * overflows. not long long since not all compilers
+ * support that one
+ */
+ time_t startTime, currentTime;
SET_BINARY_MODE(stream);
SET_BINARY_MODE(zStream);
@@ -432,12 +440,21 @@
if (ferror(stream)) goto errhandler_io;
if (ferror(zStream)) goto errhandler_io;
+ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
+ (void)fseek(stream, 0, SEEK_END);
+ fileSize = ftello(stream);
+ rewind(stream);
+ if (verbosity >= 1)
+ fprintf(stderr, "Input-file size: %ld\n", (long)fileSize);
+ }
+
bzf = BZ2_bzWriteOpen ( &bzerr, zStream,
blockSize100k, verbosity, workFactor );
if (bzerr != BZ_OK) goto errhandler;
if (verbosity >= 2) fprintf ( stderr, "\n" );
+ time(&startTime);
while (True) {
if (myfeof(stream)) break;
@@ -446,6 +463,22 @@
if (nIbuf > 0) BZ2_bzWrite ( &bzerr, bzf, (void*)ibuf, nIbuf );
if (bzerr != BZ_OK) goto errhandler;
+ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
+ time(&currentTime);
+
+ if ((currentTime - startTime) > 1) { /* show progress every 2 seconds */
+ double curInPos = ftello(stream);
+ double curOutPos = ftello(zStream);
+
+ startTime = currentTime;
+
+ fprintf(stderr, "%.2f%% done", (curInPos * 100.0) / fileSize);
+ if (srcMode == SM_F2F)
+ fprintf(stderr, ", new size: %.2f%%", (curOutPos * 100.0) / curInPos);
+
+ fprintf(stderr, " \r");
+ }
+ }
}
BZ2_bzWriteClose64 ( &bzerr, bzf, 0,
@@ -526,6 +559,8 @@
UChar unused[BZ_MAX_UNUSED];
Int32 nUnused;
UChar* unusedTmp;
+ double fileSize = 0; /* initialized to make the compiler stop crying */
+ time_t startTime, currentTime;
nUnused = 0;
streamNo = 0;
@@ -533,9 +568,19 @@
SET_BINARY_MODE(stream);
SET_BINARY_MODE(zStream);
+ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
+ off_t dummy = ftello(zStream);
+ (void)fseeko(zStream, 0, SEEK_END);
+ fileSize = ftello(zStream);
+ (void)fseeko(zStream, dummy, SEEK_SET);
+ if (verbosity >= 1)
+ fprintf(stderr, "Input-file size: %ld\n", (long)fileSize);
+ }
+
if (ferror(stream)) goto errhandler_io;
if (ferror(zStream)) goto errhandler_io;
+ time(&startTime);
while (True) {
bzf = BZ2_bzReadOpen (
@@ -551,6 +596,16 @@
if ((bzerr == BZ_OK || bzerr == BZ_STREAM_END) && nread > 0)
fwrite ( obuf, sizeof(UChar), nread, stream );
if (ferror(stream)) goto errhandler_io;
+
+ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
+ time(&currentTime);
+ if ((currentTime - startTime) >= 2) {
+ double curInPos = ftello(zStream);
+ startTime = currentTime;
+
+ fprintf(stderr, "%.2f%% done\r", (curInPos * 100.0) / fileSize);
+ }
+ }
}
if (bzerr != BZ_STREAM_END) goto errhandler;
@@ -1872,6 +1927,7 @@
deleteOutputOnInterrupt = False;
exitValue = 0;
i = j = 0; /* avoid bogus warning from egcs-1.1.X */
+ showProgress = False;
/*-- Set up signal handlers for mem access errors --*/
signal (SIGSEGV, mySIGSEGVorSIGBUScatcher);
@@ -1949,6 +2005,7 @@
case 'k': keepInputFiles = True; break;
case 's': smallMode = True; break;
case 'q': noisy = False; break;
+ case 'p': showProgress = True; break;
case '1': blockSize100k = 1; break;
case '2': blockSize100k = 2; break;
case '3': blockSize100k = 3; break;
@@ -1985,6 +2042,7 @@
if (ISFLAG("--keep")) keepInputFiles = True; else
if (ISFLAG("--small")) smallMode = True; else
if (ISFLAG("--quiet")) noisy = False; else
+ if (ISFLAG("--show-progress")) showProgress = True; else
if (ISFLAG("--version")) license(); else
if (ISFLAG("--license")) license(); else
if (ISFLAG("--exponential")) workFactor = 1; else

View File

@ -0,0 +1,16 @@
make it build for mingw targets
https://bugs.gentoo.org/393573
--- a/bzlib.h
+++ b/bzlib.h
@@ -81,6 +81,9 @@ typedef
/* windows.h define small to char */
# undef small
# endif
+# ifndef WINAPI
+# define WINAPI
+# endif
# ifdef BZ_EXPORT
# define BZ_API(func) WINAPI func
# define BZ_EXTERN extern

View File

@ -0,0 +1,76 @@
--- bzip2-1.0.8/Makefile
+++ bzip2-1.0.8/Makefile
@@ -54,7 +54,6 @@
check: test
test: bzip2
- @cat words1
./bzip2 -1 < sample1.ref > sample1.rb2
./bzip2 -2 < sample2.ref > sample2.rb2
./bzip2 -3 < sample3.ref > sample3.rb2
@@ -67,7 +66,6 @@
cmp sample1.tst sample1.ref
cmp sample2.tst sample2.ref
cmp sample3.tst sample3.ref
- @cat words3
install: bzip2 bzip2recover
if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
@@ -113,25 +111,8 @@
sample1.rb2 sample2.rb2 sample3.rb2 \
sample1.tst sample2.tst sample3.tst
-blocksort.o: blocksort.c
- @cat words0
- $(CC) $(CFLAGS) -c blocksort.c
-huffman.o: huffman.c
- $(CC) $(CFLAGS) -c huffman.c
-crctable.o: crctable.c
- $(CC) $(CFLAGS) -c crctable.c
-randtable.o: randtable.c
- $(CC) $(CFLAGS) -c randtable.c
-compress.o: compress.c
- $(CC) $(CFLAGS) -c compress.c
-decompress.o: decompress.c
- $(CC) $(CFLAGS) -c decompress.c
-bzlib.o: bzlib.c
- $(CC) $(CFLAGS) -c bzlib.c
-bzip2.o: bzip2.c
- $(CC) $(CFLAGS) -c bzip2.c
-bzip2recover.o: bzip2recover.c
- $(CC) $(CFLAGS) -c bzip2recover.c
+%.o: %.c
+ $(CC) $(CFLAGS) -c $<
distclean: clean
--- bzip2-1.0.8/Makefile-libbz2_so
+++ bzip2-1.0.8/Makefile-libbz2_so
@@ -36,24 +36,10 @@
all: $(OBJS)
$(CC) $(LDFLAGS) -shared -Wl,-soname -Wl,libbz2.so.1 -o libbz2.so.1.0.8 $(OBJS)
- $(CC) $(LDFLAGS) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8
- rm -f libbz2.so.1.0
- ln -s libbz2.so.1.0.8 libbz2.so.1.0
+ ln -sf libbz2.so.1.0.8 libbz2.so.1.0
clean:
rm -f $(OBJS) bzip2.o libbz2.so.1.0.8 libbz2.so.1.0 bzip2-shared
-blocksort.o: blocksort.c
- $(CC) $(CFLAGS) -c blocksort.c
-huffman.o: huffman.c
- $(CC) $(CFLAGS) -c huffman.c
-crctable.o: crctable.c
- $(CC) $(CFLAGS) -c crctable.c
-randtable.o: randtable.c
- $(CC) $(CFLAGS) -c randtable.c
-compress.o: compress.c
- $(CC) $(CFLAGS) -c compress.c
-decompress.o: decompress.c
- $(CC) $(CFLAGS) -c decompress.c
-bzlib.o: bzlib.c
- $(CC) $(CFLAGS) -c bzlib.c
+%.o: %.c
+ $(CC) $(CFLAGS) -c $<

View File

@ -0,0 +1,13 @@
--- bzip2-1.0.8/Makefile-libbz2_so
+++ bzip2-1.0.8/Makefile-libbz2_so
@@ -35,8 +35,8 @@
bzlib.o
all: $(OBJS)
- $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS)
- $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8
+ $(CC) $(LDFLAGS) -shared -Wl,-soname -Wl,libbz2.so.1 -o libbz2.so.1.0.8 $(OBJS)
+ $(CC) $(LDFLAGS) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8
rm -f libbz2.so.1.0
ln -s libbz2.so.1.0.8 libbz2.so.1.0

2
app-arch/gzip/Manifest Normal file
View File

@ -0,0 +1,2 @@
DIST gzip-1.12.tar.xz 825548 BLAKE2B 7e2d482c08555f5fb0ff5408c0afe48c61034e9779eed6e3dd8046c847234c0a8a6bc34d49a934a54db0d73033e12c71a228d373551384a4cd663315071637e0 SHA512 116326fe991828227de150336a0c016f4fe932dfbb728a16b4a84965256d9929574a4f5cfaf3cf6bb4154972ef0d110f26ab472c93e62ec9a5fd7a5d65abea24
DIST gzip-1.12.tar.xz.sig 833 BLAKE2B ab7b4a759ef163d67f20773607ba0408ea9f1f7c7c224f43635fc3752acc521b74dbea4ec9ebb58a2f4fa13ecae19e00779b4b56c2cb95976301445beff817aa SHA512 1f4702797f7c5f1873c2f9c2f6210ba23824455d17ee82f50f0bf24240ed5bdf0090cf85338ccf76ba82422f8b4ad3a329d8bbf1350cb094d7bd61aa45550397

View File

@ -0,0 +1,11 @@
--- a/Makefile.in
+++ b/Makefile.in
@@ -926,7 +926,7 @@
rm -f "$$dest" && \
case $@ in \
install-exec-hook) \
- ln "$$source" "$$dest" || $(LN_S) "$$source" "$$dest";; \
+ $(LN_S) "$$source" "$$dest";; \
esac \
) || exit; \
done; \

View File

@ -0,0 +1,50 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/gzip.asc
inherit flag-o-matic verify-sig
DESCRIPTION="Standard GNU compressor"
HOMEPAGE="https://www.gnu.org/software/gzip/"
SRC_URI="mirror://gnu/gzip/${P}.tar.xz
https://alpha.gnu.org/gnu/gzip/${P}.tar.xz"
SRC_URI+=" verify-sig? (
mirror://gnu/gzip/${P}.tar.xz.sig
https://alpha.gnu.org/gnu/gzip/${P}.tar.xz.sig
)"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="pic static"
BDEPEND="verify-sig? ( sec-keys/openpgp-keys-gzip )"
PATCHES=(
"${FILESDIR}/${PN}-1.3.8-install-symlinks.patch"
)
src_configure() {
use static && append-flags -static
# Avoid text relocation in gzip
use pic && export DEFS="NO_ASM"
# bug #663928
econf --disable-gcc-warnings
}
src_install() {
default
docinto txt
dodoc algorithm.doc gzip.doc
# keep most things in /usr, just the fun stuff in /
dodir /bin
mv "${ED}"/usr/bin/gzip.exe "${ED}"/bin/ || die
mv "${ED}"/usr/bin/{gunzip,uncompress,zcat} "${ED}"/bin/ || die
sed -e "s:${EPREFIX}/usr:${EPREFIX}:" -i "${ED}"/bin/gunzip || die
}

View File

@ -0,0 +1,70 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit multilib-minimal toolchain-funcs usr-ldscript
DESCRIPTION="zstd fast compression library"
HOMEPAGE="https://facebook.github.io/zstd/"
SRC_URI="https://github.com/facebook/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="|| ( BSD GPL-2 )"
SLOT="0/1"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="lz4 static-libs +threads"
RDEPEND="app-arch/xz-utils
lz4? ( app-arch/lz4 )"
DEPEND="${RDEPEND}"
src_prepare() {
default
multilib_copy_sources
}
mymake() {
sed -i 's@^.*cp.*$@cp -f $(BUILD_DIR)/zstd.exe zstd.exe; \\@' programs/Makefile
sed -i 's@^\(\s*\).*INSTALL_PROGRAM) zstd.*$@\1$(INSTALL_PROGRAM) zstd.exe $(DESTDIR)$(BINDIR)/zstd.exe@' programs/Makefile
sed -i '/install -m 755/ s/\$(EXT)/.exe/g' contrib/pzstd/Makefile
emake \
CC="$(tc-getCC)" \
CXX="$(tc-getCXX)" \
AR="$(tc-getAR)" \
PREFIX="${EPREFIX}/usr" \
LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
V=1 \
"${@}"
}
multilib_src_compile() {
local libzstd_targets=( libzstd{,.a}$(usex threads '-mt' '') )
mymake -C lib ${libzstd_targets[@]} libzstd.pc
if multilib_is_native_abi ; then
mymake HAVE_LZ4="$(usex lz4 1 0)" zstd
mymake -C contrib/pzstd
fi
}
multilib_src_install() {
mymake -C lib DESTDIR="${D}" install
if multilib_is_native_abi ; then
mymake -C programs DESTDIR="${D}" install
gen_usr_ldscript -a zstd
mymake -C contrib/pzstd DESTDIR="${D}" install
fi
}
multilib_src_install_all() {
einstalldocs
if ! use static-libs; then
find "${ED}" -name "*.a" -delete || die
fi
}

View File

@ -0,0 +1,197 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# The Debian ca-certificates package merely takes the CA database as it exists
# in the nss package and repackages it for use by openssl.
#
# The issue with using the compiled debs directly is two fold:
# - they do not update frequently enough for us to rely on them
# - they pull the CA database from nss tip of tree rather than the release
#
# So we take the Debian source tools and combine them with the latest nss
# release to produce (largely) the same end result. The difference is that
# now we know our cert database is kept in sync with nss and, if need be,
# can be sync with nss tip of tree more frequently to respond to bugs.
# When triaging user reports, refer to our wiki for tips:
# https://wiki.gentoo.org/wiki/Certificates#Debugging_certificate_issues
EAPI=7
PYTHON_COMPAT=( python3_{8..11} )
inherit python-any-r1
if [[ ${PV} == *.* ]] ; then
# Compile from source ourselves.
PRECOMPILED=false
DEB_VER=$(ver_cut 1)
NSS_VER=$(ver_cut 2-)
RTM_NAME="NSS_${NSS_VER//./_}_RTM"
else
# Debian precompiled version.
PRECOMPILED=true
inherit unpacker
fi
DESCRIPTION="Common CA Certificates PEM files"
HOMEPAGE="https://packages.debian.org/sid/ca-certificates"
NMU_PR=""
if ${PRECOMPILED} ; then
SRC_URI="mirror://debian/pool/main/c/${PN}/${PN}_${PV}${NMU_PR:++nmu}${NMU_PR}_all.deb"
else
SRC_URI="mirror://debian/pool/main/c/${PN}/${PN}_${DEB_VER}${NMU_PR:++nmu}${NMU_PR}.tar.xz
https://archive.mozilla.org/pub/security/nss/releases/${RTM_NAME}/src/nss-${NSS_VER}.tar.gz
cacert? (
https://dev.gentoo.org/~whissi/dist/ca-certificates/nss-cacert-class1-class3-r2.patch
)"
fi
LICENSE="MPL-1.1"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
IUSE=""
${PRECOMPILED} || IUSE+=" cacert"
# c_rehash: we run `c_rehash`
# debianutils: we run `run-parts`
CDEPEND="app-misc/c_rehash"
BDEPEND="${CDEPEND}"
if ! ${PRECOMPILED} ; then
BDEPEND+=" ${PYTHON_DEPS}"
fi
DEPEND=""
if ${PRECOMPILED} ; then
DEPEND+=" !<sys-apps/portage-2.1.10.41"
fi
RDEPEND="${CDEPEND}
${DEPEND}"
S=${WORKDIR}
pkg_setup() {
# For the conversion to having it in CONFIG_PROTECT_MASK,
# we need to tell users about it once manually first.
[[ -f "${EPREFIX}"/etc/env.d/98ca-certificates ]] \
|| ewarn "You should run update-ca-certificates manually after etc-update"
if ! ${PRECOMPILED} ; then
python-any-r1_pkg_setup
fi
}
src_unpack() {
if ! ${PRECOMPILED} ; then
default
# Initial 20200601 deb release had bad naming inside the debian source tarball.
DEB_S="${WORKDIR}/${PN}-${DEB_VER}"
DEB_BAD_S="${WORKDIR}/work"
if [[ -d "${DEB_BAD_S}" ]] && [[ ! -d "${DEB_S}" ]] ; then
mv "${DEB_BAD_S}" "${DEB_S}"
fi
fi
# Do all the work in the image subdir to avoid conflicting with source
# dirs in ${WORKDIR}. Need to perform everything in the offset #381937
mkdir -p "image/${EPREFIX}" || die
cd "image/${EPREFIX}" || die
${PRECOMPILED} && unpacker_src_unpack
}
src_prepare() {
cd "image/${EPREFIX}" || die
if ! ${PRECOMPILED} ; then
mkdir -p usr/sbin || die
cp -p "${S}"/${PN}-${DEB_VER}/sbin/update-ca-certificates \
usr/sbin/ || die
if use cacert ; then
pushd "${S}"/nss-${NSS_VER} >/dev/null || die
eapply "${DISTDIR}"/nss-cacert-class1-class3-r2.patch
popd >/dev/null || die
fi
fi
default
eapply -p2 "${FILESDIR}"/${PN}-20150426-root.patch
pushd "${S}/${PN}-${DEB_VER}" >/dev/null || die
eapply "${FILESDIR}"/${PN}-20211016.3.72-no-cryptography.patch
popd >/dev/null || die
local relp=$(echo "${EPREFIX}" | sed -e 's:[^/]\+:..:g')
sed -i \
-e '/="$ROOT/s:ROOT:ROOT'"${EPREFIX}"':' \
-e '/RELPATH="\.\./s:"$:'"${relp}"'":' \
-e 's/openssl rehash/c_rehash/' \
usr/sbin/update-ca-certificates || die
}
src_compile() {
cd "image/${EPREFIX}" || die
if ! ${PRECOMPILED} ; then
local d="${S}/${PN}-${DEB_VER}/mozilla" c="usr/share/${PN}"
# Grab the database from the nss sources.
cp "${S}"/nss-${NSS_VER}/nss/lib/ckfw/builtins/{certdata.txt,nssckbi.h} "${d}" || die
emake -C "${d}"
# Now move the files to the same places that the precompiled would.
mkdir -p etc/ssl/certs \
etc/ca-certificates/update.d \
"${c}"/mozilla \
|| die
if use cacert ; then
mkdir -p "${c}"/cacert.org || die
mv "${d}"/CA_Cert_Signing_Authority.crt \
"${c}"/cacert.org/cacert.org_class1.crt || die
mv "${d}"/CAcert_Class_3_Root.crt \
"${c}"/cacert.org/cacert.org_class3.crt || die
fi
mv "${d}"/*.crt "${c}"/mozilla/ || die
else
mv usr/share/doc/{ca-certificates,${PF}} || die
fi
(
echo "# Automatically generated by ${CATEGORY}/${PF}"
echo "# $(date -u)"
echo "# Do not edit."
cd "${c}" || die
find * -name '*.crt' | LC_ALL=C sort
) > etc/ca-certificates.conf
sh usr/sbin/update-ca-certificates --root "${S}/image" || die
}
src_install() {
cp -pPR image/* "${D}"/ || die
if ! ${PRECOMPILED} ; then
cd ${PN}-${DEB_VER} || die
doman sbin/*.8
dodoc debian/README.* examples/ca-certificates-local/README
fi
echo 'CONFIG_PROTECT_MASK="/etc/ca-certificates.conf"' > 98ca-certificates
doenvd 98ca-certificates
}
pkg_postinst() {
if [[ -d "${EROOT}/usr/local/share/ca-certificates" ]] ; then
# if the user has local certs, we need to rebuild again
# to include their stuff in the db.
# However it's too overzealous when the user has custom certs in place.
# --fresh is to clean up dangling symlinks
"${EROOT}"/usr/sbin/update-ca-certificates --root "${ROOT}"
fi
if [[ -n "$(find -L "${EROOT}"/etc/ssl/certs/ -type l)" ]] ; then
ewarn "Removing the following broken symlinks:"
ewarn "$(find -L "${EROOT}"/etc/ssl/certs/ -type l -printf '%p -> %l\n' -delete)"
fi
}

View File

@ -0,0 +1,49 @@
add a --root option so we can generate with DESTDIR installs
--- a/image/usr/sbin/update-ca-certificates
+++ b/image/usr/sbin/update-ca-certificates
@@ -30,6 +30,8 @@ LOCALCERTSDIR=/usr/local/share/ca-certificates
CERTBUNDLE=ca-certificates.crt
ETCCERTSDIR=/etc/ssl/certs
HOOKSDIR=/etc/ca-certificates/update.d
+ROOT=""
+RELPATH=""
while [ $# -gt 0 ];
do
@@ -59,13 +61,25 @@ do
--hooksdir)
shift
HOOKSDIR="$1";;
+ --root|-r)
+ shift
+ # Needed as c_rehash wants to read the files directly.
+ # This gets us from $CERTSCONF to $CERTSDIR.
+ RELPATH="../../.."
+ ROOT=$(readlink -f "$1");;
--help|-h|*)
- echo "$0: [--verbose] [--fresh]"
+ echo "$0: [--verbose] [--fresh] [--root <dir>]"
exit;;
esac
shift
done
+CERTSCONF="$ROOT$CERTSCONF"
+CERTSDIR="$ROOT$CERTSDIR"
+LOCALCERTSDIR="$ROOT$LOCALCERTSDIR"
+ETCCERTSDIR="$ROOT$ETCCERTSDIR"
+HOOKSDIR="$ROOT$HOOKSDIR"
+
if [ ! -s "$CERTSCONF" ]
then
fresh=1
@@ -94,7 +107,7 @@ add() {
-e 's/,/_/g').pem"
if ! test -e "$PEM" || [ "$(readlink "$PEM")" != "$CERT" ]
then
- ln -sf "$CERT" "$PEM"
+ ln -sf "${RELPATH}${CERT#$ROOT}" "$PEM"
echo "+$PEM" >> "$ADDED"
fi
# Add trailing newline to certificate, if it is missing (#635570)

View File

@ -0,0 +1,27 @@
Remove the dependency on non-portable dev-python/cryptography.
https://bugs.gentoo.org/821706#c4 by Alex Xu
--- a/mozilla/certdata2pem.py
+++ b/mozilla/certdata2pem.py
@@ -28,8 +28,6 @@
import textwrap
import io
-from cryptography import x509
-
objects = []
@@ -122,12 +120,6 @@
if not obj['CKA_LABEL'] in trust or not trust[obj['CKA_LABEL']]:
continue
- cert = x509.load_der_x509_certificate(obj['CKA_VALUE'])
- if cert.not_valid_after < datetime.datetime.now():
- print('!'*74)
- print('Trusted but expired certificate found: %s' % obj['CKA_LABEL'])
- print('!'*74)
-
bname = obj['CKA_LABEL'][1:-1].replace('/', '_')\
.replace(' ', '_')\
.replace('(', '=')\

View File

@ -0,0 +1,40 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit meson xdg
DESCRIPTION="A free software manga reader."
HOMEPAGE="https://gitea.sergiotarxz.freemyip.com"
SRC_URI="https://gitea.sergiotarxz.freemyip.com/sergiotarxz/recuento/archive/main.tar.gz -> recuento-$PV.tar.gz"
S="${WORKDIR}/recuento"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
DEPEND="
>=gui-libs/libadwaita-1.1.0
>=dev-db/sqlite-3.38.0
"
RDEPEND="${DEPEND}"
BDEPEND="
virtual/pkgconfig
>=dev-util/meson-0.60.3
"
src_configure() {
VALAC=/usr/bin/valac-0.56 meson_src_configure
}
src_install() {
meson_src_install
}
pkg_postinst() {
xdg_icon_cache_update
}
pkg_postrm () {
xdg_icon_cache_update
}

View File

@ -0,0 +1,444 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
inherit autotools flag-o-matic multilib-minimal toolchain-funcs
if [[ "${PV}" != "9999" ]]; then
SRC_PV="$(printf "%u%02u%02u%02u" $(ver_rs 1- " "))"
DOC_PV="${SRC_PV}"
# DOC_PV="$(printf "%u%02u%02u00" $(ver_rs 1-3 " "))"
fi
DESCRIPTION="SQL database engine"
HOMEPAGE="https://sqlite.org/"
# On version updates, make sure to read the forum (https://sqlite.org/forum/forum)
# for hints regarding test failures, backports, etc.
if [[ "${PV}" == "9999" ]]; then
SRC_URI=""
else
SRC_URI="https://sqlite.org/2022/${PN}-src-${SRC_PV}.zip
doc? ( https://sqlite.org/2022/${PN}-doc-${DOC_PV}.zip )"
fi
LICENSE="public-domain"
SLOT="3"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="debug doc icu +readline secure-delete static-libs tcl test tools"
if [[ "${PV}" == "9999" ]]; then
PROPERTIES="live"
fi
RESTRICT="!test? ( test )"
if [[ "${PV}" == "9999" ]]; then
BDEPEND=">=dev-lang/tcl-8.6:0
dev-vcs/fossil"
else
BDEPEND="app-arch/unzip
>=dev-lang/tcl-8.6:0"
fi
RDEPEND="sys-libs/zlib:0=[${MULTILIB_USEDEP}]
icu? ( dev-libs/icu:0=[${MULTILIB_USEDEP}] )
readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
tcl? ( dev-lang/tcl:0=[${MULTILIB_USEDEP}] )
tools? ( dev-lang/tcl:0= )"
DEPEND="${RDEPEND}
test? ( >=dev-lang/tcl-8.6:0[${MULTILIB_USEDEP}] )"
if [[ "${PV}" == "9999" ]]; then
S="${WORKDIR}/${PN}"
else
S="${WORKDIR}/${PN}-src-${SRC_PV}"
fi
_fossil_fetch() {
local distdir="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}"
local repo_id="${1}"
local repo_uri="${2}"
local -x FOSSIL_HOME="${HOME}"
mkdir -p "${T}/fossil/${repo_id}" || die
pushd "${T}/fossil/${repo_id}" > /dev/null || die
if [[ -n "${EVCS_OFFLINE}" ]]; then
if [[ ! -f "${distdir}/fossil-src/${repo_id}/${repo_id}.fossil" ]]; then
die "Network activity disabled using EVCS_OFFLINE and clone of repository missing: \"${distdir}/fossil-src/${repo_id}/${repo_id}.fossil\""
fi
else
if [[ ! -f "${distdir}/fossil-src/${repo_id}/${repo_id}.fossil" ]]; then
einfo fossil clone --verbose "${repo_uri}" "${repo_id}.fossil"
fossil clone --verbose "${repo_uri}" "${repo_id}.fossil" || die
echo
else
cp -p "${distdir}/fossil-src/${repo_id}/${repo_id}.fossil" . || die
einfo fossil pull --repository "${repo_id}.fossil" --verbose "${repo_uri}"
fossil pull --repository "${repo_id}.fossil" --verbose "${repo_uri}" || die
echo
fi
(
addwrite "${distdir}"
mkdir -p "${distdir}/fossil-src/${repo_id}" || die
cp -p "${repo_id}.fossil" "${distdir}/fossil-src/${repo_id}/${repo_id}.fossil" || die
)
fi
popd > /dev/null || die
}
_fossil_checkout() {
local distdir="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}"
local repo_id="${1}"
local branch_or_commit="${2}"
local target_directory="${3}"
local -x FOSSIL_HOME="${HOME}"
if [[ ! -f "${distdir}/fossil-src/${repo_id}/${repo_id}.fossil" ]]; then
die "Clone of repository missing: \"${distdir}/fossil-src/${repo_id}/${repo_id}.fossil\""
fi
if [[ ! -f "${T}/fossil/${repo_id}/${repo_id}.fossil" ]]; then
mkdir -p "${T}/fossil/${repo_id}" || die
cp -p "${distdir}/fossil-src/${repo_id}/${repo_id}.fossil" "${T}/fossil/${repo_id}" || die
fi
mkdir "${target_directory}" || die
pushd "${target_directory}" > /dev/null || die
einfo fossil open --quiet "${T}/fossil/${repo_id}/${repo_id}.fossil" "${branch_or_commit}"
fossil open --quiet "${T}/fossil/${repo_id}/${repo_id}.fossil" "${branch_or_commit}" || die
echo
popd > /dev/null || die
}
fossil_fetch() {
local repo_id="${1}"
local repo_uri="${2}"
local target_directory="${3}"
local branch_or_commit="${EFOSSIL_COMMIT:-${EFOSSIL_BRANCH:-trunk}}"
_fossil_fetch "${repo_id}" "${repo_uri}"
_fossil_checkout "${repo_id}" "${branch_or_commit}" "${target_directory}"
}
src_unpack() {
if [[ "${PV}" == "9999" ]]; then
fossil_fetch sqlite https://sqlite.org/src "${WORKDIR}/${PN}"
if use doc; then
fossil_fetch sqlite-doc https://sqlite.org/docsrc "${WORKDIR}/${PN}-doc"
fi
else
default
fi
}
src_prepare() {
eapply_user
eautoreconf
multilib_copy_sources
}
multilib_src_configure() {
local -x CPPFLAGS="${CPPFLAGS}" CFLAGS="${CFLAGS}"
local options=()
options+=(
--enable-load-extension
--enable-threadsafe
)
# Support detection of misuse of SQLite API.
# https://sqlite.org/compile.html#enable_api_armor
append-cppflags -DSQLITE_ENABLE_API_ARMOR
# Support bytecode and tables_used virtual tables.
# https://sqlite.org/compile.html#enable_bytecode_vtab
# https://sqlite.org/bytecodevtab.html
append-cppflags -DSQLITE_ENABLE_BYTECODE_VTAB
# Support column metadata functions.
# https://sqlite.org/compile.html#enable_column_metadata
# https://sqlite.org/c3ref/column_database_name.html
append-cppflags -DSQLITE_ENABLE_COLUMN_METADATA
# Support sqlite_dbpage virtual table.
# https://sqlite.org/compile.html#enable_dbpage_vtab
# https://sqlite.org/dbpage.html
append-cppflags -DSQLITE_ENABLE_DBPAGE_VTAB
# Support dbstat virtual table.
# https://sqlite.org/compile.html#enable_dbstat_vtab
# https://sqlite.org/dbstat.html
append-cppflags -DSQLITE_ENABLE_DBSTAT_VTAB
# Support sqlite3_serialize() and sqlite3_deserialize() functions.
# https://sqlite.org/compile.html#enable_deserialize
# https://sqlite.org/c3ref/serialize.html
# https://sqlite.org/c3ref/deserialize.html
append-cppflags -DSQLITE_ENABLE_DESERIALIZE
# Support comments in output of EXPLAIN.
# https://sqlite.org/compile.html#enable_explain_comments
append-cppflags -DSQLITE_ENABLE_EXPLAIN_COMMENTS
# Support Full-Text Search versions 3, 4 and 5.
# https://sqlite.org/compile.html#enable_fts3
# https://sqlite.org/compile.html#enable_fts3_parenthesis
# https://sqlite.org/compile.html#enable_fts4
# https://sqlite.org/compile.html#enable_fts5
# https://sqlite.org/fts3.html
# https://sqlite.org/fts5.html
append-cppflags -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4
options+=(--enable-fts5)
# Support hidden columns.
append-cppflags -DSQLITE_ENABLE_HIDDEN_COLUMNS
# Support memsys5 memory allocator.
# https://sqlite.org/compile.html#enable_memsys5
# https://sqlite.org/malloc.html#memsys5
append-cppflags -DSQLITE_ENABLE_MEMSYS5
# Support sqlite3_normalized_sql() function.
# https://sqlite.org/c3ref/expanded_sql.html
append-cppflags -DSQLITE_ENABLE_NORMALIZE
# Support sqlite_offset() function.
# https://sqlite.org/compile.html#enable_offset_sql_func
# https://sqlite.org/lang_corefunc.html#sqlite_offset
append-cppflags -DSQLITE_ENABLE_OFFSET_SQL_FUNC
# Support pre-update hook functions.
# https://sqlite.org/compile.html#enable_preupdate_hook
# https://sqlite.org/c3ref/preupdate_count.html
append-cppflags -DSQLITE_ENABLE_PREUPDATE_HOOK
# Support Resumable Bulk Update extension.
# https://sqlite.org/compile.html#enable_rbu
# https://sqlite.org/rbu.html
append-cppflags -DSQLITE_ENABLE_RBU
# Support R*Trees.
# https://sqlite.org/compile.html#enable_rtree
# https://sqlite.org/compile.html#enable_geopoly
# https://sqlite.org/rtree.html
# https://sqlite.org/geopoly.html
append-cppflags -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY
# Support Session extension.
# https://sqlite.org/compile.html#enable_session
# https://sqlite.org/sessionintro.html
append-cppflags -DSQLITE_ENABLE_SESSION
# Support scan status functions.
# https://sqlite.org/compile.html#enable_stmt_scanstatus
# https://sqlite.org/c3ref/stmt_scanstatus.html
# https://sqlite.org/c3ref/stmt_scanstatus_reset.html
append-cppflags -DSQLITE_ENABLE_STMT_SCANSTATUS
# Support sqlite_stmt virtual table.
# https://sqlite.org/compile.html#enable_stmtvtab
# https://sqlite.org/stmt.html
append-cppflags -DSQLITE_ENABLE_STMTVTAB
# Support unknown() function.
# https://sqlite.org/compile.html#enable_unknown_sql_function
append-cppflags -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
# Support unlock notification.
# https://sqlite.org/compile.html#enable_unlock_notify
# https://sqlite.org/c3ref/unlock_notify.html
# https://sqlite.org/unlock_notify.html
append-cppflags -DSQLITE_ENABLE_UNLOCK_NOTIFY
# Support LIMIT and ORDER BY clauses on DELETE and UPDATE statements.
# https://sqlite.org/compile.html#enable_update_delete_limit
# https://sqlite.org/lang_delete.html#optional_limit_and_order_by_clauses
# https://sqlite.org/lang_update.html#optional_limit_and_order_by_clauses
append-cppflags -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT
# Support soundex() function.
# https://sqlite.org/compile.html#soundex
# https://sqlite.org/lang_corefunc.html#soundex
append-cppflags -DSQLITE_SOUNDEX
# Support URI filenames.
# https://sqlite.org/compile.html#use_uri
# https://sqlite.org/uri.html
append-cppflags -DSQLITE_USE_URI
# debug USE flag.
options+=($(use_enable debug))
# icu USE flag.
if use icu; then
# Support ICU extension.
# https://sqlite.org/compile.html#enable_icu
append-cppflags -DSQLITE_ENABLE_ICU
sed -e "s/^TLIBS = @LIBS@/& -licui18n -licuuc/" -i Makefile.in || die "sed failed"
fi
# readline USE flag.
options+=(
--disable-editline
$(use_enable readline)
)
if use readline; then
options+=(--with-readline-inc="-I${ESYSROOT}/usr/include/readline")
fi
# secure-delete USE flag.
if use secure-delete; then
# Enable secure_delete pragma by default.
# https://sqlite.org/compile.html#secure_delete
# https://sqlite.org/pragma.html#pragma_secure_delete
append-cppflags -DSQLITE_SECURE_DELETE
fi
# static-libs USE flag.
options+=($(use_enable static-libs static))
# tcl, test, tools USE flags.
if use tcl || use test || { use tools && multilib_is_native_abi; }; then
options+=(
--enable-tcl
--with-tcl="${ESYSROOT}/usr/$(get_libdir)"
)
else
options+=(--disable-tcl)
fi
if [[ "${ABI}" == "x86" ]]; then
if $(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P -dM - < /dev/null 2> /dev/null | grep -q "^#define __SSE__ 1$"; then
append-cflags -mfpmath=sse
else
append-cflags -ffloat-store
fi
# Skip known-broken test for now
# https://sqlite.org/forum/forumpost/d97caf168f
# https://sqlite.org/forum/forumpost/50f136d91d
if use test ; then
rm test/atof1.test || die
fi
fi
sed -i 's/-DSQLITE_OS_UNIX/-DSQLITE_OS_WIN/' configure
econf "${options[@]}"
# sed -i 's/\(mksourceid\)\$(BEXE)/\1/g' Makefile
sed -i 's/^TEXE =.*$/TEXE = .exe/' Makefile
sed -i 's/^BEXE =.*$/BEXE =/' Makefile
sed -i 's/^.*BUILD_EXEEXT.*$/S["BUILD_EXEEXT"]=""/' config.status
sed -i 's/^.*TARGET_EXEEXT.*$/S["TARGET_EXEEXT"]=".exe"/' config.status
sed -i 's/SQLITE_OS_UNIX/SQLITE_OS_WIN/g' config.status
sed -i 's/^SQLITE_OS_WIN.*0.*$/S["SQLITE_OS_UNIX"]="0"/' config.status
}
multilib_src_compile() {
emake HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}"
if use tools && multilib_is_native_abi; then
emake changeset dbdump dbhash dbtotxt index_usage rbu scrub showdb showjournal showshm showstat4 showwal sqldiff sqlite3_analyzer sqlite3_checker sqlite3_expert sqltclsh
fi
if [[ "${PV}" == "9999" ]] && use doc && multilib_is_native_abi; then
emake tclsqlite3.c
local build_directory="$(pwd)"
build_directory="${build_directory##*/}"
mkdir "${WORKDIR}/${PN}-doc-build" || die
pushd "${WORKDIR}/${PN}-doc-build" > /dev/null || die
emake -f "../${PN}-doc/Makefile" -j1 SRC="../${PN}" BLD="../${build_directory}" DOC="../${PN}-doc" CC="$(tc-getBUILD_CC)" TCLINC="" TCLFLAGS="$($(tc-getBUILD_PKG_CONFIG) --libs tcl) -ldl -lm" base doc
rmdir doc/matrix{/*,} || die
popd > /dev/null || die
fi
}
multilib_src_test() {
if [[ "${EUID}" -eq 0 ]]; then
ewarn "Skipping tests due to root permissions"
return
fi
local -x SQLITE_HISTORY="${T}/sqlite_history_${ABI}"
# e_uri.test tries to open files in /.
# https://bugs.gentoo.org/839798
local SANDBOX_PREDICT=${SANDBOX_PREDICT}
addpredict "/test.db:/ÿ.db"
emake HAVE_TCL="$(usex tcl 1 "")" $(use debug && echo fulltest || echo test)
}
multilib_src_install() {
emake DESTDIR="${D}" HAVE_TCL="$(usex tcl 1 "")" TCLLIBDIR="${EPREFIX}/usr/$(get_libdir)/${P}" install
if use tools && multilib_is_native_abi; then
install_tool() {
if [[ -f ".libs/${1}" ]]; then
newbin ".libs/${1}" "${2}"
else
newbin "${1}" "${2}"
fi
}
install_tool changeset sqlite3-changeset
install_tool dbdump sqlite3-db-dump
install_tool dbhash sqlite3-db-hash
install_tool dbtotxt sqlite3-db-to-txt
install_tool index_usage sqlite3-index-usage
install_tool rbu sqlite3-rbu
install_tool scrub sqlite3-scrub
install_tool showdb sqlite3-show-db
install_tool showjournal sqlite3-show-journal
install_tool showshm sqlite3-show-shm
install_tool showstat4 sqlite3-show-stat4
install_tool showwal sqlite3-show-wal
install_tool sqldiff sqlite3-diff
install_tool sqlite3_analyzer sqlite3-analyzer
install_tool sqlite3_checker sqlite3-checker
install_tool sqlite3_expert sqlite3-expert
install_tool sqltclsh sqlite3-tclsh
unset -f install_tool
fi
}
multilib_src_install_all() {
find "${ED}" -name "*.la" -delete || die
doman sqlite3.1
if use doc; then
if [[ "${PV}" == "9999" ]]; then
pushd "${WORKDIR}/${PN}-doc-build/doc" > /dev/null || die
else
pushd "${WORKDIR}/${PN}-doc-${DOC_PV}" > /dev/null || die
fi
find "(" -name "*.db" -o -name "*.txt" ")" -delete || die
if [[ "${PV}" != "9999" ]]; then
rm search search.d/admin || die
rmdir search.d || die
find -name "*~" -delete || die
fi
(
docinto html
dodoc -r *
)
popd > /dev/null || die
fi
}

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>rust@gentoo.org</email>
<name>Rust Project</name>
</maintainer>
<use>
<flag name="clippy">Install clippy, Rust code linter</flag>
<flag name="rls">Install rls, Rust Language Server (used with IDEs supporting RLS protocol)</flag>
<flag name="rustfmt">Install rustfmt, Rust code formatter</flag>
<flag name="rust-src">Install rust-src, needed by developer tools and for build-std (cross)</flag>
</use>
</pkgmetadata>

View File

@ -0,0 +1,225 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit multilib prefix rust-toolchain toolchain-funcs verify-sig multilib-minimal
MY_P="rust-${PV}"
# curl -L static.rust-lang.org/dist/channel-rust-${PV}.toml 2>/dev/null | grep "xz_url.*rust-src"
MY_SRC_URI="${RUST_TOOLCHAIN_BASEURL%/}/2022-05-19/rust-src-${PV}.tar.xz"
DESCRIPTION="Systems programming language from Mozilla"
HOMEPAGE="https://www.rust-lang.org/"
SRC_URI="$(rust_all_arch_uris ${MY_P})
rust-src? ( ${MY_SRC_URI} )
"
LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
SLOT="stable"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~s390 ~x86"
IUSE="clippy cpu_flags_x86_sse2 doc prefix rls rust-src rustfmt"
DEPEND=""
RDEPEND="
>=app-eselect/eselect-rust-20190311
sys-apps/lsb-release
"
BDEPEND="
prefix? ( dev-util/patchelf )
verify-sig? ( sec-keys/openpgp-keys-rust )
"
REQUIRED_USE="x86? ( cpu_flags_x86_sse2 )"
QA_PREBUILT="
opt/${P}/bin/.*
opt/${P}/lib/.*.so
opt/${P}/libexec/.*
opt/${P}/lib/rustlib/.*/bin/.*
opt/${P}/lib/rustlib/.*/lib/.*
"
# An rmeta file is custom binary format that contains the metadata for the crate.
# rmeta files do not support linking, since they do not contain compiled object files.
# so we can safely silence the warning for this QA check.
QA_EXECSTACK="opt/${P}/lib/rustlib/*/lib*.rlib:lib.rmeta"
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}/usr/share/openpgp-keys/rust.asc"
pkg_pretend() {
if [[ "$(tc-is-softfloat)" != "no" ]] && [[ ${CHOST} == armv7* ]]; then
die "${CHOST} is not supported by upstream Rust. You must use a hard float version."
fi
}
src_unpack() {
# sadly rust-src tarball does not have corresponding .asc file
# so do partial verification
if use verify-sig; then
for f in ${A}; do
if [[ -f ${DISTDIR}/${f}.asc ]]; then
verify-sig_verify_detached "${DISTDIR}/${f}" "${DISTDIR}/${f}.asc"
fi
done
fi
default_src_unpack
echo "${S}"
mv "${WORKDIR}/${MY_P}-$(rust_abi)" "${S}" || die
}
patchelf_for_bin() {
local filetype=$(file -b ${1})
if [[ ${filetype} == *ELF*interpreter* ]]; then
einfo "${1}'s interpreter changed"
patchelf ${1} --set-interpreter ${2} || die
elif [[ ${filetype} == *script* ]]; then
hprefixify ${1}
fi
}
multilib_src_install() {
if multilib_is_native_abi; then
# start native abi install
pushd "${S}" >/dev/null || die
local analysis std
analysis="$(grep 'analysis' ./components)"
std="$(grep 'std' ./components)"
local components="rustc,cargo,${std}"
use doc && components="${components},rust-docs"
use clippy && components="${components},clippy-preview"
use rls && components="${components},rls-preview,${analysis}"
use rustfmt && components="${components},rustfmt-preview"
# Rust component 'rust-src' is extracted from separate archive
if use rust-src; then
einfo "Combining rust and rust-src installers"
mv -v "${WORKDIR}/rust-src-${PV}/rust-src" "${S}" || die
echo rust-src >> ./components || die
components="${components},rust-src"
fi
./install.sh \
--components="${components}" \
--disable-verify \
--prefix="${ED}/opt/${P}" \
--mandir="${ED}/opt/${P}/man" \
--disable-ldconfig \
|| die
rust_target="x86_64-pc-windows-gnu"
cp -vr "${WORKDIR}/rust-${PV}-${rust_target}/rust-std-${rust_target}/lib/rustlib/${rust_target}"\
"${ED}/opt/${P}/lib/rustlib" || die
if use prefix; then
local interpreter=$(patchelf --print-interpreter ${EPREFIX}/bin/bash)
ebegin "Changing interpreter to ${interpreter} for Gentoo prefix at ${ED}/opt/${P}/bin"
find "${ED}/opt/${P}/bin" -type f -print0 | \
while IFS= read -r -d '' filename; do
patchelf_for_bin ${filename} ${interpreter} \; || die
done
eend $?
fi
local symlinks=(
cargo
rustc
rustdoc
rust-gdb
rust-gdbgui
rust-lldb
)
use clippy && symlinks+=( clippy-driver cargo-clippy )
use rls && symlinks+=( rls )
use rustfmt && symlinks+=( rustfmt cargo-fmt )
einfo "installing eselect-rust symlinks and paths"
local i
for i in "${symlinks[@]}"; do
# we need realpath on /usr/bin/* symlink return version-appended binary path.
# so /usr/bin/rustc should point to /opt/rust-bin-<ver>/bin/rustc-<ver>
local ver_i="${i}-bin-${PV}"
ln -v "${ED}/opt/${P}/bin/${i}" "${ED}/opt/${P}/bin/${ver_i}"
dosym "../../opt/${P}/bin/${ver_i}" "/usr/bin/${ver_i}"
done
# symlinks to switch components to active rust in eselect
dosym "../../../opt/${P}/lib" "/usr/lib/rust/lib-bin-${PV}"
dosym "../../../opt/${P}/man" "/usr/lib/rust/man-bin-${PV}"
dosym "../../opt/${P}/lib/rustlib" "/usr/lib/rustlib-bin-${PV}"
dosym "../../../opt/${P}/share/doc/rust" "/usr/share/doc/${P}"
# musl logic can be improved a bit, but fine as is for now
cat <<-_EOF_ > "${T}/50${P}"
LDPATH="${EPREFIX}/usr/lib/rust/lib"
MANPATH="${EPREFIX}/usr/lib/rust/man"
$(use amd64 && usex elibc_musl 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '')
$(use arm64 && usex elibc_musl 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=-crt-static"' '')
_EOF_
doenvd "${T}/50${P}"
# note: eselect-rust adds EROOT to all paths below
cat <<-_EOF_ > "${T}/provider-${P}"
/usr/bin/cargo
/usr/bin/rustdoc
/usr/bin/rust-gdb
/usr/bin/rust-gdbgui
/usr/bin/rust-lldb
/usr/lib/rustlib
/usr/lib/rust/lib
/usr/lib/rust/man
/usr/share/doc/rust
_EOF_
if use clippy; then
echo /usr/bin/clippy-driver >> "${T}/provider-${P}"
echo /usr/bin/cargo-clippy >> "${T}/provider-${P}"
fi
if use rls; then
echo /usr/bin/rls >> "${T}/provider-${P}"
fi
if use rustfmt; then
echo /usr/bin/rustfmt >> "${T}/provider-${P}"
echo /usr/bin/cargo-fmt >> "${T}/provider-${P}"
fi
insinto /etc/env.d/rust
doins "${T}/provider-${P}"
popd >/dev/null || die
#end native abi install
else
local rust_targets
rust_targets="$(rust_abi $(get_abi_CHOST ${v##*.})) x86_64-pc-windows-gnu"
dodir "/opt/${P}/lib/rustlib"
for rust_target in $rust_targets; do
cp -vr "${WORKDIR}/rust-${PV}-${rust_target}/rust-std-${rust_target}/lib/rustlib/${rust_target}"\
"${ED}/opt/${P}/lib/rustlib" || die
done
fi
# BUG: installs x86_64 binary on other arches
rm -f "${ED}/opt/${P}/lib/rustlib/"*/bin/rust-llvm-dwp || die
}
pkg_postinst() {
eselect rust update
elog "Rust installs a helper script for calling GDB now,"
elog "for your convenience it is installed under /usr/bin/rust-gdb-bin-${PV}."
if has_version app-editors/emacs; then
elog "install app-emacs/rust-mode to get emacs support for rust."
fi
if has_version app-editors/gvim || has_version app-editors/vim; then
elog "install app-vim/rust-vim to get vim support for rust."
fi
}
pkg_postrm() {
eselect rust cleanup
}

127
eclass/xdg.eclass Normal file
View File

@ -0,0 +1,127 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: xdg.eclass
# @MAINTAINER:
# freedesktop-bugs@gentoo.org
# @AUTHOR:
# Original author: Gilles Dartiguelongue <eva@gentoo.org>
# @SUPPORTED_EAPIS: 5 6 7 8
# @PROVIDES: xdg-utils
# @BLURB: Provides phases for XDG compliant packages.
# @DESCRIPTION:
# Utility eclass to update the desktop, icon and shared mime info as laid
# out in the freedesktop specs & implementations
inherit xdg-utils
_DEFINE_XDG_SRC_PREPARE=false
case "${EAPI}" in
5|6|7)
# src_prepare is only exported in EAPI < 8.
EXPORT_FUNCTIONS src_prepare
_DEFINE_XDG_SRC_PREPARE=true
;;
8)
;;
*) die "${ECLASS}: EAPI=${EAPI} is not supported" ;;
esac
EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_postrm
# Avoid dependency loop as both depend on glib-2
if [[ ${CATEGORY}/${P} != dev-libs/glib-2.* ]] ; then
_XDG_DEPEND="
"
case "${EAPI}" in
5|6|7)
DEPEND="${_XDG_DEPEND}"
;;
*)
IDEPEND="${_XDG_DEPEND}"
;;
esac
fi
if ${_DEFINE_XDG_SRC_PREPARE}; then
# @FUNCTION: xdg_src_prepare
# @DESCRIPTION:
# Prepare sources to work with XDG standards.
# Note that this function is only defined and exported in EAPIs < 8.
xdg_src_prepare() {
xdg_environment_reset
[[ ${EAPI} != 5 ]] && default
}
fi
# @FUNCTION: xdg_pkg_preinst
# @DESCRIPTION:
# Finds .desktop, icon and mime info files for later handling in pkg_postinst.
# Locations are stored in XDG_ECLASS_DESKTOPFILES, XDG_ECLASS_ICONFILES
# and XDG_ECLASS_MIMEINFOFILES respectively.
xdg_pkg_preinst() {
local f
XDG_ECLASS_DESKTOPFILES=()
while IFS= read -r -d '' f; do
XDG_ECLASS_DESKTOPFILES+=( ${f} )
done < <(cd "${ED}" && find 'usr/share/applications' -type f -print0 2>/dev/null)
XDG_ECLASS_ICONFILES=()
while IFS= read -r -d '' f; do
XDG_ECLASS_ICONFILES+=( ${f} )
done < <(cd "${ED}" && find 'usr/share/icons' -type f -print0 2>/dev/null)
XDG_ECLASS_MIMEINFOFILES=()
while IFS= read -r -d '' f; do
XDG_ECLASS_MIMEINFOFILES+=( ${f} )
done < <(cd "${ED}" && find 'usr/share/mime' -type f -print0 2>/dev/null)
}
# @FUNCTION: xdg_pkg_postinst
# @DESCRIPTION:
# Handle desktop, icon and mime info database updates.
xdg_pkg_postinst() {
if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then
einfo "Doing nothing"
else
debug-print "No .desktop files to add to database"
fi
if [[ ${#XDG_ECLASS_ICONFILES[@]} -gt 0 ]]; then
einfo "Doing nothing"
else
debug-print "No icon files to add to cache"
fi
if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
einfo "Doing nothing"
else
debug-print "No mime info files to add to database"
fi
}
# @FUNCTION: xdg_pkg_postrm
# @DESCRIPTION:
# Handle desktop, icon and mime info database updates.
xdg_pkg_postrm() {
if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then
einfo "Doing nothing"
else
debug-print "No .desktop files to add to database"
fi
if [[ ${#XDG_ECLASS_ICONFILES[@]} -gt 0 ]]; then
einfo "Doing nothing"
else
debug-print "No icon files to add to cache"
fi
if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then
einfo "Doing nothing"
else
debug-print "No mime info files to add to database"
fi
}

View File

@ -0,0 +1,109 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python3_{8..11} )
inherit gnome2 multilib-minimal python-any-r1 rust-toolchain vala
DESCRIPTION="Scalable Vector Graphics (SVG) rendering library"
HOMEPAGE="https://wiki.gnome.org/Projects/LibRsvg https://gitlab.gnome.org/GNOME/librsvg"
LICENSE="LGPL-2+"
SLOT="2"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
IUSE="gtk-doc +introspection +vala"
REQUIRED_USE="
gtk-doc? ( introspection )
vala? ( introspection )
"
RESTRICT="test" # Lots of issues on 32bit builds, 64bit build seems to get into an infinite compilation sometimes, etc.
RDEPEND="
>=x11-libs/cairo-1.16.0[glib,svg,${MULTILIB_USEDEP}]
>=media-libs/freetype-2.9:2[${MULTILIB_USEDEP}]
>=x11-libs/gdk-pixbuf-2.20:2[introspection?,${MULTILIB_USEDEP}]
>=dev-libs/glib-2.50.0:2[${MULTILIB_USEDEP}]
>=media-libs/harfbuzz-2.0.0:=[${MULTILIB_USEDEP}]
>=dev-libs/libxml2-2.9.1-r4:2[${MULTILIB_USEDEP}]
>=x11-libs/pango-1.48.11[${MULTILIB_USEDEP}]
introspection? ( >=dev-libs/gobject-introspection-0.10.8:= )
"
DEPEND="${RDEPEND}
>=virtual/rust-1.56[${MULTILIB_USEDEP}]
${PYTHON_DEPS}
$(python_gen_any_dep 'dev-python/docutils[${PYTHON_USEDEP}]')
gtk-doc? ( dev-util/gi-docgen )
virtual/pkgconfig
vala? ( $(vala_depend) )
dev-libs/gobject-introspection-common
dev-libs/vala-common
"
# dev-libs/gobject-introspection-common, dev-libs/vala-common needed by eautoreconf
QA_FLAGS_IGNORED="
usr/bin/rsvg-convert
usr/lib.*/librsvg.*
"
src_prepare() {
use vala && vala_src_prepare
gnome2_src_prepare
}
multilib_src_configure() {
local myconf=(
--disable-static
--disable-debug
$(multilib_native_use_enable gtk-doc)
$(multilib_native_use_enable introspection)
$(multilib_native_use_enable vala)
--enable-pixbuf-loader
)
if ! multilib_is_native_abi; then
myconf+=(
# Set the rust target, which can differ from CHOST
RUST_TARGET="$(rust_abi)"
# RUST_TARGET is only honored if cross_compiling, but non-native ABIs aren't cross as
# far as C parts and configure auto-detection are concerned as CHOST equals CBUILD
cross_compiling=yes
)
fi
export RUST_TARGET=x86_64-pc-windows-gnu
ECONF_SOURCE=${S} \
gnome2_src_configure "${myconf[@]}"
if multilib_is_native_abi; then
ln -s "${S}"/doc/html doc/html || die
fi
}
multilib_src_compile() {
gnome2_src_compile
}
multilib_src_install() {
gnome2_src_install
}
multilib_src_install_all() {
find "${ED}" -name '*.la' -delete || die
if use gtk-doc; then
mkdir -p "${ED}"/usr/share/gtk-doc/html/ || die
mv "${ED}"/usr/share/doc/Rsvg-2.0 "${ED}"/usr/share/gtk-doc/html/ || die
fi
}
pkg_postinst() {
multilib_foreach_abi gnome2_pkg_postinst
}
pkg_postrm() {
multilib_foreach_abi gnome2_pkg_postrm
}

View File

@ -0,0 +1,211 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..11} )
inherit gnome.org gnome2-utils meson optfeature python-any-r1 virtualx xdg
DESCRIPTION="GTK is a multi-platform toolkit for creating graphical user interfaces"
HOMEPAGE="https://www.gtk.org/ https://gitlab.gnome.org/GNOME/gtk/"
LICENSE="LGPL-2+"
SLOT="4"
IUSE="aqua broadway colord cups examples ffmpeg gstreamer +introspection sysprof test vulkan wayland +X cpu_flags_x86_f16c"
REQUIRED_USE="
test? ( introspection )
"
KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
COMMON_DEPEND="
>=dev-libs/fribidi-0.19.7
>=dev-libs/glib-2.66.0:2
>=media-libs/graphene-1.9.1[introspection?]
>=x11-libs/cairo-1.14[aqua?,glib,svg,X?]
>=x11-libs/gdk-pixbuf-2.30:2[introspection?]
>=x11-libs/pango-1.50.0[introspection?]
media-libs/libpng:0=
media-libs/tiff:0=
>=media-libs/libepoxy-1.4[X(+)?]
media-libs/libjpeg-turbo:0=
>=media-libs/harfbuzz-2.1.0:=
x11-misc/shared-mime-info
colord? ( >=x11-misc/colord-0.1.9:0= )
cups? ( >=net-print/cups-2.0 )
ffmpeg? ( media-video/ffmpeg )
gstreamer? (
>=media-libs/gst-plugins-bad-1.12.3
>=media-libs/gst-plugins-base-1.12.3[opengl]
)
introspection? ( >=dev-libs/gobject-introspection-1.39:= )
vulkan? ( media-libs/vulkan-loader:= )
wayland? (
>=dev-libs/wayland-1.20.0
>=dev-libs/wayland-protocols-1.23
media-libs/mesa[wayland]
>=x11-libs/libxkbcommon-0.2
)
X? (
>=app-accessibility/at-spi2-atk-2.5.3
media-libs/fontconfig
media-libs/mesa[X(+)]
x11-libs/libX11
>=x11-libs/libXi-1.8
x11-libs/libXext
>=x11-libs/libXrandr-1.5
x11-libs/libXcursor
x11-libs/libXfixes
x11-libs/libXdamage
x11-libs/libXinerama
)
"
DEPEND="${COMMON_DEPEND}
sysprof? ( >=dev-util/sysprof-capture-3.40.1:4 )
X? ( x11-base/xorg-proto )
"
RDEPEND="${COMMON_DEPEND}
>=dev-util/gtk-update-icon-cache-3
"
# librsvg for svg icons (PDEPEND to avoid circular dep), bug #547710
PDEPEND="
gnome-base/librsvg
>=x11-themes/adwaita-icon-theme-3.14
"
BDEPEND="
dev-libs/gobject-introspection-common
introspection? (
${PYTHON_DEPS}
$(python_gen_any_dep '
dev-python/pygobject:3[${PYTHON_USEDEP}]
')
)
dev-python/docutils
>=dev-util/gdbus-codegen-2.48
dev-util/glib-utils
>=sys-devel/gettext-0.19.7
virtual/pkgconfig
test? (
dev-libs/glib:2
wayland? ( dev-libs/weston[headless] )
)
"
python_check_deps() {
python_has_version "dev-python/pygobject:3[${PYTHON_USEDEP}]" || return
}
pkg_setup() {
use introspection && python-any-r1_pkg_setup
}
src_prepare() {
default
xdg_environment_reset
# dev-python/docutils installs rst2man.py, not rst2man
sed -i -e "s/'rst2man'/'rst2man.py'/" docs/reference/gtk/meson.build || die
# Nothing should use gtk4-update-icon-cache and an unversioned one is shipped by dev-util/gtk-update-icon-cache
sed -i -e '/gtk4-update-icon-cache/d' tools/meson.build || die
# Workaround RWX ELF sections, https://gitlab.gnome.org/GNOME/gtk/-/issues/4598
sed -i -e 's/^ld =.*/ld = disabler()/g' gtk/meson.build demos/gtk-demo/meson.build demos/widget-factory/meson.build || die
sed -i -e 's/^objcopy =.*/objcopy = disabler()/g' gtk/meson.build demos/gtk-demo/meson.build demos/widget-factory/meson.build || die
}
src_configure() {
local emesonargs=(
# GDK backends
$(meson_use X x11-backend)
$(meson_use wayland wayland-backend)
$(meson_use broadway broadway-backend)
-Dwin32-backend=true
$(meson_use aqua macos-backend)
# Media backends
$(meson_feature ffmpeg media-ffmpeg)
$(meson_feature gstreamer media-gstreamer)
# Print backends
$(meson_feature cups print-cups)
# Optional dependencies
$(meson_feature vulkan)
-Dcloudproviders=disabled # cloudprovider is not packaged in Gentoo yet
$(meson_feature sysprof)
-Dtracker=disabled # tracker3 is not packaged in Gentoo yet
$(meson_feature colord)
# Expected to fail with GCC < 11
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71993
$(meson_feature cpu_flags_x86_f16c f16c)
# Documentation and introspection
-Dgtk_doc=false # we ship pregenerated API docs from tarball
-Dman-pages=true
$(meson_feature introspection)
# Demos and binaries
$(meson_use examples build-examples)
$(meson_use examples demos)
$(meson_use test build-tests)
-Dinstall-tests=false
)
meson_src_configure
}
src_test() {
"${BROOT}${GLIB_COMPILE_SCHEMAS}" --allow-any-name "${S}/gtk" || die
if use X; then
einfo "Running tests under X"
GSETTINGS_SCHEMA_DIR="${S}/gtk" virtx meson_src_test --setup=x11
fi
if use wayland; then
einfo "Running tests under Weston"
export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)"
weston --backend=headless-backend.so --socket=wayland-5 --idle-time=0 &
compositor=$!
export WAYLAND_DISPLAY=wayland-5
GSETTINGS_SCHEMA_DIR="${S}/gtk" meson_src_test --setup=wayland
exit_code=$?
kill ${compositor}
fi
}
src_install() {
meson_src_install
insinto /usr/share/gtk-doc/html
# This will install API docs specific to X11 and wayland regardless of USE flags, but this is intentional
doins -r "${S}"/docs/reference/{gtk/gtk4,gsk/gsk4,gdk/gdk4{,-wayland,-x11}}
}
pkg_preinst() {
xdg_pkg_preinst
gnome2_schemas_savelist
}
pkg_postinst() {
xdg_pkg_postinst
gnome2_schemas_update
if ! has_version "app-text/evince"; then
elog "Please install app-text/evince for print preview functionality."
elog "Alternatively, check \"gtk-print-preview-command\" documentation and"
elog "add it to your settings.ini file."
fi
if use examples ; then
optfeature "syntax highlighting in gtk4-demo" app-text/highlight
fi
}
pkg_postrm() {
xdg_pkg_postrm
gnome2_schemas_update
}

View File

@ -0,0 +1,65 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..11} )
VALA_MIN_API_VERSION="0.52"
inherit gnome.org meson python-any-r1 vala virtualx
DESCRIPTION="Building blocks for modern adaptive GNOME applications"
HOMEPAGE="https://gnome.pages.gitlab.gnome.org/libadwaita/ https://gitlab.gnome.org/GNOME/libadwaita"
LICENSE="LGPL-2.1+"
SLOT="1"
IUSE="+introspection test +vala"
REQUIRED_USE="vala? ( introspection )"
KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
DEPEND="
>=dev-libs/glib-2.66:2
>=gui-libs/gtk-4.5.0:4[introspection?]
dev-libs/fribidi
introspection? ( >=dev-libs/gobject-introspection-1.54:= )
"
RDEPEND="${DEPEND}"
BDEPEND="
${PYTHON_DEPS}
vala? ( $(vala_depend) )
>=dev-util/meson-0.59.0
dev-util/glib-utils
sys-devel/gettext
virtual/pkgconfig
"
src_prepare() {
default
use vala && vala_setup
}
src_configure() {
local emesonargs=(
# Never use gi-docgen subproject
--wrap-mode nofallback
-Dprofiling=false
$(meson_feature introspection)
$(meson_use vala vapi)
-Dgtk_doc=false # we ship pregenerated docs
$(meson_use test tests)
-Dexamples=false
)
meson_src_configure
}
src_test() {
virtx meson_src_test --timeout-multiplier 2
}
src_install() {
meson_src_install
insinto /usr/share/gtk-doc/html
# This will install libadwaita API docs unconditionally, but this is intentional
doins -r "${S}"/doc/libadwaita-1
}

View File

@ -0,0 +1,16 @@
https://bugs.gentoo.org/310157
--- fontconfig-2.10.2-orig/configure.ac
+++ fontconfig-2.10.2/configure.ac
@@ -570,7 +570,11 @@ AC_SUBST(XMLDIR)
# Let people not build/install docs if they don't have docbook
#
-AC_CHECK_PROG(HASDOCBOOK, docbook2html, yes, no)
+AC_ARG_ENABLE(docbook, [ --disable-docbook Don't build documentation],,)
+
+if test x$enable_docbook != xno; then
+ AC_CHECK_PROG(HASDOCBOOK, docbook2html, yes, no)
+fi
AM_CONDITIONAL(USEDOCBOOK, test "x$HASDOCBOOK" = xyes)

View File

@ -0,0 +1,68 @@
--- fontconfig-2.12.3/conf.d/60-latin.conf
+++ fontconfig-2.12.3/conf.d/60-latin.conf
@@ -4,47 +4,50 @@
<alias>
<family>serif</family>
<prefer>
- <family>Bitstream Vera Serif</family>
+ <family>Liberation Serif</family>
<family>DejaVu Serif</family>
<family>Times New Roman</family>
- <family>Thorndale AMT</family>
<family>Luxi Serif</family>
<family>Nimbus Roman No9 L</family>
<family>Nimbus Roman</family>
<family>Times</family>
+ <family>Thorndale AMT</family>
+ <family>Bitstream Vera Serif</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
- <family>Bitstream Vera Sans</family>
+ <family>Liberation Sans</family>
<family>DejaVu Sans</family>
- <family>Verdana</family>
<family>Arial</family>
- <family>Albany AMT</family>
<family>Luxi Sans</family>
<family>Nimbus Sans L</family>
<family>Nimbus Sans</family>
<family>Helvetica</family>
<family>Lucida Sans Unicode</family>
<family>BPG Glaho International</family> <!-- lat,cyr,arab,geor -->
+ <family>Verdana</family>
<family>Tahoma</family> <!-- lat,cyr,greek,heb,arab,thai -->
+ <family>Albany AMT</family>
+ <family>Bitstream Vera Sans</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
- <family>Bitstream Vera Sans Mono</family>
+ <family>Liberation Mono</family>
<family>DejaVu Sans Mono</family>
<family>Inconsolata</family>
<family>Andale Mono</family>
<family>Courier New</family>
- <family>Cumberland AMT</family>
<family>Luxi Mono</family>
<family>Nimbus Mono L</family>
<family>Nimbus Mono</family>
<family>Nimbus Mono PS</family>
<family>Courier</family>
+ <family>Cumberland AMT</family>
+ <family>Bitstream Vera Sans Mono</family>
</prefer>
</alias>
<!--
@@ -65,6 +68,7 @@
<alias>
<family>cursive</family>
<prefer>
+ <family>Comic Neue</family>
<family>ITC Zapf Chancery Std</family>
<family>Zapfino</family>
<family>Comic Sans MS</family>

View File

@ -0,0 +1,313 @@
From 806fd4c2c5164d66d978b0a4c579c157e5cbe766 Mon Sep 17 00:00:00 2001
From: Akira TAGOH <akira@tagoh.org>
Date: Tue, 4 Sep 2018 09:08:37 +0000
Subject: [PATCH] Fix the issue that '~' wasn't extracted to the proper homedir
'~' in the filename was extracted to the home directory name in FcConfigFilename() though,
this behavior was broken by d1f48f11. this change fixes it back to the correct behavior.
https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/110
--- a/src/fccfg.c
+++ b/src/fccfg.c
@@ -2207,17 +2207,19 @@ FcConfigFilename (const FcChar8 *url)
else
file = 0;
}
-
- path = FcConfigGetPath ();
- if (!path)
- return NULL;
- for (p = path; *p; p++)
+ else
{
- file = FcConfigFileExists (*p, url);
- if (file)
- break;
+ path = FcConfigGetPath ();
+ if (!path)
+ return NULL;
+ for (p = path; *p; p++)
+ {
+ file = FcConfigFileExists (*p, url);
+ if (file)
+ break;
+ }
+ FcConfigFreePath (path);
}
- FcConfigFreePath (path);
return file;
}
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -91,6 +91,22 @@ test_bz106632_CFLAGS = \
test_bz106632_LDADD = $(top_builddir)/src/libfontconfig.la
TESTS += test-bz106632
+if !ENABLE_SHARED
+check_PROGRAMS += test-issue110
+test_issue110_CFLAGS = \
+ -I$(top_builddir) \
+ -I$(top_builddir)/src \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/src \
+ -DHAVE_CONFIG_H \
+ -DFONTCONFIG_PATH='"$(BASECONFIGDIR)"' \
+ $(NULL)
+test_issue110_LDADD = \
+ $(top_builddir)/src/libfontconfig.la \
+ $(NULL)
+TESTS += test-issue110
+endif
+
EXTRA_DIST=run-test.sh run-test-conf.sh $(TESTDATA) out.expected-long-family-names out.expected-no-long-family-names
CLEANFILES=out out1 out2 fonts.conf out.expected
--- /dev/null
+++ b/test/test-issue110.c
@@ -0,0 +1,245 @@
+/*
+ * fontconfig/test/test-issue110.c
+ *
+ * Copyright © 2000 Keith Packard
+ * Copyright © 2018 Akira TAGOH
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the author(s) not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. The authors make no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <errno.h>
+#ifndef HAVE_STRUCT_DIRENT_D_TYPE
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+#include <fontconfig/fontconfig.h>
+
+#ifdef _WIN32
+# define FC_DIR_SEPARATOR '\\'
+# define FC_DIR_SEPARATOR_S "\\"
+#else
+# define FC_DIR_SEPARATOR '/'
+# define FC_DIR_SEPARATOR_S "/"
+#endif
+
+extern FcChar8 *FcConfigRealFilename (FcConfig *, FcChar8 *);
+
+#ifdef HAVE_MKDTEMP
+#define fc_mkdtemp mkdtemp
+#else
+char *
+fc_mkdtemp (char *template)
+{
+ if (!mktemp (template) || mkdir (template, 0700))
+ return NULL;
+
+ return template;
+}
+#endif
+
+FcBool
+mkdir_p (const char *dir)
+{
+ char *parent;
+ FcBool ret;
+
+ if (strlen (dir) == 0)
+ return FcFalse;
+ parent = (char *) FcStrDirname ((const FcChar8 *) dir);
+ if (!parent)
+ return FcFalse;
+ if (access (parent, F_OK) == 0)
+ ret = mkdir (dir, 0755) == 0 && chmod (dir, 0755) == 0;
+ else if (access (parent, F_OK) == -1)
+ ret = mkdir_p (parent) && (mkdir (dir, 0755) == 0) && chmod (dir, 0755) == 0;
+ else
+ ret = FcFalse;
+ free (parent);
+
+ return ret;
+}
+
+FcBool
+unlink_dirs (const char *dir)
+{
+ DIR *d = opendir (dir);
+ struct dirent *e;
+ size_t len = strlen (dir);
+ char *n = NULL;
+ FcBool ret = FcTrue;
+#ifndef HAVE_STRUCT_DIRENT_D_TYPE
+ struct stat statb;
+#endif
+
+ if (!d)
+ return FcFalse;
+ while ((e = readdir (d)) != NULL)
+ {
+ size_t l;
+
+ if (strcmp (e->d_name, ".") == 0 ||
+ strcmp (e->d_name, "..") == 0)
+ continue;
+ l = strlen (e->d_name) + 1;
+ if (n)
+ free (n);
+ n = malloc (l + len + 1);
+ if (!n)
+ {
+ ret = FcFalse;
+ break;
+ }
+ strcpy (n, dir);
+ n[len] = FC_DIR_SEPARATOR;
+ strcpy (&n[len + 1], e->d_name);
+#ifdef HAVE_STRUCT_DIRENT_D_TYPE
+ if (e->d_type == DT_DIR)
+#else
+ if (stat (n, &statb) == -1)
+ {
+ fprintf (stderr, "E: %s\n", n);
+ ret = FcFalse;
+ break;
+ }
+ if (S_ISDIR (statb.st_mode))
+#endif
+ {
+ if (!unlink_dirs (n))
+ {
+ fprintf (stderr, "E: %s\n", n);
+ ret = FcFalse;
+ break;
+ }
+ }
+ else
+ {
+ if (unlink (n) == -1)
+ {
+ fprintf (stderr, "E: %s\n", n);
+ ret = FcFalse;
+ break;
+ }
+ }
+ }
+ if (n)
+ free (n);
+ closedir (d);
+
+ if (rmdir (dir) == -1)
+ {
+ fprintf (stderr, "E: %s\n", dir);
+ return FcFalse;
+ }
+
+ return ret;
+}
+
+int
+main(void)
+{
+ FcConfig *cfg = FcConfigCreate ();
+ char *basedir, template[512] = "/tmp/fc110-XXXXXX";
+ char *sysroot, systempl[512] = "/tmp/fc110-XXXXXX";
+ FcChar8 *d = NULL;
+ FcChar8 *ret = NULL;
+ FcChar8 *s = NULL;
+ FILE *fp;
+ int retval = 0;
+
+ retval++;
+ basedir = fc_mkdtemp (template);
+ if (!basedir)
+ {
+ fprintf (stderr, "%s: %s\n", template, strerror (errno));
+ goto bail;
+ }
+ retval++;
+ sysroot = fc_mkdtemp (systempl);
+ if (!sysroot)
+ {
+ fprintf (stderr, "%s: %s\n", systempl, strerror (errno));
+ goto bail;
+ }
+ fprintf (stderr, "D: Creating %s\n", basedir);
+ mkdir_p (basedir);
+ setenv ("HOME", basedir, 1);
+ retval++;
+ s = FcStrBuildFilename (basedir, ".fonts.conf", NULL);
+ if (!s)
+ goto bail;
+ retval++;
+ fprintf (stderr, "D: Creating %s\n", s);
+ if ((fp = fopen (s, "wb")) == NULL)
+ goto bail;
+ fprintf (fp, "%s", s);
+ fclose (fp);
+ retval++;
+ fprintf (stderr, "D: Checking file path\n");
+ ret = FcConfigRealFilename (cfg, "~/.fonts.conf");
+ if (!ret)
+ goto bail;
+ retval++;
+ if (strcmp ((const char *) s, (const char *) ret) != 0)
+ goto bail;
+ free (ret);
+ free (s);
+ setenv ("FONTCONFIG_SYSROOT", sysroot, 1);
+ fprintf (stderr, "D: Creating %s\n", sysroot);
+ mkdir_p (sysroot);
+ retval++;
+ d = FcStrBuildFilename (sysroot, basedir, NULL);
+ fprintf (stderr, "D: Creating %s\n", d);
+ mkdir_p (d);
+ free (d);
+ s = FcStrBuildFilename (sysroot, basedir, ".fonts.conf", NULL);
+ if (!s)
+ goto bail;
+ retval++;
+ fprintf (stderr, "D: Creating %s\n", s);
+ if ((fp = fopen (s, "wb")) == NULL)
+ goto bail;
+ fprintf (fp, "%s", s);
+ fclose (fp);
+ retval++;
+ fprintf (stderr, "D: Checking file path\n");
+ ret = FcConfigRealFilename (cfg, "~/.fonts.conf");
+ if (!ret)
+ goto bail;
+ retval++;
+ if (strcmp ((const char *) s, (const char *) ret) != 0)
+ goto bail;
+ retval = 0;
+bail:
+ fprintf (stderr, "Cleaning up\n");
+ unlink_dirs (basedir);
+ if (ret)
+ free (ret);
+ if (s)
+ free (s);
+
+ return retval;
+}
+

View File

@ -0,0 +1,43 @@
https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/107
Reversion of part of:
https://gitlab.freedesktop.org/fontconfig/fontconfig/commit/f5dd8512bdf9fd8e01c30ae36f593758b29385cf
--- /src/fcdir.c
+++ /src/fcdir.c
@@ -421,13 +421,6 @@
/* Not using existing cache file, construct new cache */
if (!cache)
cache = FcDirCacheScan (dir, config);
- if (cache)
- {
- FcFontSet *fs = FcCacheSet (cache);
-
- if (cache->dirs_count == 0 && (!fs || fs->nfont == 0))
- FcDirCacheDeleteUUID (dir, config);
- }
return cache;
}
--- /test/run-test.sh
+++ /test/run-test.sh
@@ -239,19 +239,4 @@
rm -rf $MyPWD/sysroot
-dotest "deleting .uuid file on empty dir"
-prep
-cp $FONT1 $FONT2 $FONTDIR
-$FCCACHE $FONTDIR
-sleep 1
-rm -f $FONTDIR/*pcf
-$FCCACHE $FONTDIR
-rmdir $FONTDIR > /dev/null 2>&1
-if [ $? != 0 ]; then
- echo "*** Test failed: $TEST"
- echo "$FONTDIR isn't empty"
- ls -al $FONTDIR
- exit 1
-fi
-
rm -rf $FONTDIR $CACHEFILE $CACHEDIR $FONTCONFIG_FILE out

View File

@ -0,0 +1,91 @@
From 8208f99fa1676c42bfd8d74de3e9dac5366c150c Mon Sep 17 00:00:00 2001
From: Akira TAGOH <akira@tagoh.org>
Date: Mon, 3 Sep 2018 04:56:16 +0000
Subject: [PATCH] Fix the build issue with --enable-static
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/109
--- a/fontconfig/fontconfig.h
+++ b/fontconfig/fontconfig.h
@@ -1076,6 +1076,10 @@ FcUtf16Len (const FcChar8 *string,
int *nchar,
int *wchar);
+FcPublic FcChar8 *
+FcStrBuildFilename (const FcChar8 *path,
+ ...);
+
FcPublic FcChar8 *
FcStrDirname (const FcChar8 *file);
--- a/src/fcint.h
+++ b/src/fcint.h
@@ -1282,10 +1282,6 @@ FcStrUsesHome (const FcChar8 *s);
FcPrivate FcBool
FcStrIsAbsoluteFilename (const FcChar8 *s);
-FcPrivate FcChar8 *
-FcStrBuildFilename (const FcChar8 *path,
- ...);
-
FcPrivate FcChar8 *
FcStrLastSlash (const FcChar8 *path);
--- a/test/test-bz106632.c
+++ b/test/test-bz106632.c
@@ -25,25 +25,26 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <dirent.h>
+#include <unistd.h>
+#include <errno.h>
#ifndef HAVE_STRUCT_DIRENT_D_TYPE
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
#endif
-#include "fcstr.c"
-#undef FcConfigBuildFonts
-#undef FcConfigCreate
-#undef FcConfigGetCurrent
-#undef FcConfigParseAndLoadFromMemory
-#undef FcConfigUptoDate
-#undef FcFontList
-#undef FcInitReinitialize
-#undef FcPatternCreate
-#undef FcPatternDestroy
#include <fontconfig/fontconfig.h>
+#ifdef _WIN32
+# define FC_DIR_SEPARATOR '\\'
+# define FC_DIR_SEPARATOR_S "\\"
+#else
+# define FC_DIR_SEPARATOR '/'
+# define FC_DIR_SEPARATOR_S "/"
+#endif
+
#ifdef HAVE_MKDTEMP
#define fc_mkdtemp mkdtemp
#else
@@ -154,18 +155,6 @@ unlink_dirs (const char *dir)
return ret;
}
-FcChar8 *
-FcLangNormalize (const FcChar8 *lang)
-{
- return NULL;
-}
-
-FcChar8 *
-FcConfigHome (void)
-{
- return NULL;
-}
-
int
main (void)
{

View File

@ -0,0 +1,62 @@
--- fontconfig-2.13.93/conf.d/60-latin.conf
+++ fontconfig-2.13.93/conf.d/60-latin.conf
@@ -5,44 +5,47 @@
<alias>
<family>serif</family>
<prefer>
+ <family>Liberation Serif</family>
<family>DejaVu Serif</family>
<family>Times New Roman</family>
- <family>Thorndale AMT</family>
<family>Luxi Serif</family>
<family>Nimbus Roman No9 L</family>
<family>Nimbus Roman</family>
<family>Times</family>
+ <family>Thorndale AMT</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
+ <family>Liberation Sans</family>
<family>DejaVu Sans</family>
- <family>Verdana</family>
<family>Arial</family>
- <family>Albany AMT</family>
<family>Luxi Sans</family>
<family>Nimbus Sans L</family>
<family>Nimbus Sans</family>
<family>Helvetica</family>
<family>Lucida Sans Unicode</family>
<family>BPG Glaho International</family> <!-- lat,cyr,arab,geor -->
+ <family>Verdana</family>
<family>Tahoma</family> <!-- lat,cyr,greek,heb,arab,thai -->
+ <family>Albany AMT</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
+ <family>Liberation Mono</family>
<family>DejaVu Sans Mono</family>
<family>Inconsolata</family>
<family>Andale Mono</family>
<family>Courier New</family>
- <family>Cumberland AMT</family>
<family>Luxi Mono</family>
<family>Nimbus Mono L</family>
<family>Nimbus Mono</family>
<family>Nimbus Mono PS</family>
<family>Courier</family>
+ <family>Cumberland AMT</family>
</prefer>
</alias>
<!--
@@ -63,6 +66,7 @@
<alias>
<family>cursive</family>
<prefer>
+ <family>Comic Neue</family>
<family>ITC Zapf Chancery Std</family>
<family>Zapfino</family>
<family>Comic Sans MS</family>

View File

@ -0,0 +1,29 @@
https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/223
From d4a8381169984246dbb14b7a810abd170d7d0afd Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Sat, 2 Apr 2022 02:36:24 +0100
Subject: [PATCH] configure.ac: allow disabling docbook
Sometimes we might want to build docs (install man pages, etc)
but allow disabling use of docbook.
Bug: https://bugs.gentoo.org/310157
Signed-off-by: Sam James <sam@gentoo.org>
--- a/configure.ac
+++ b/configure.ac
@@ -736,7 +736,13 @@ dnl ===========================================================================
# Let people not build/install docs if they don't have docbook
#
-AC_CHECK_PROG(HASDOCBOOK, docbook2html, yes, no)
+AC_ARG_ENABLE(docbook,
+ [AS_HELP_STRING([--disable-docbook],
+ [Disable building docs with docbook2html (default: no)])],,)
+
+if test x$enable_docbook != xno; then
+ AC_CHECK_PROG(HASDOCBOOK, docbook2html, yes, no)
+fi
AM_CONDITIONAL(USEDOCBOOK, test "x$HASDOCBOOK" = xyes)

View File

@ -0,0 +1,66 @@
https://bugs.gentoo.org/130466
--- a/conf.d/60-latin.conf
+++ b/conf.d/60-latin.conf
@@ -5,47 +5,50 @@
<alias>
<family>serif</family>
<prefer>
+ <family>Liberation Serif</family>
<family>Noto Serif</family>
<family>DejaVu Serif</family>
<family>Times New Roman</family>
- <family>Thorndale AMT</family>
<family>Luxi Serif</family>
<family>Nimbus Roman No9 L</family>
<family>Nimbus Roman</family>
<family>Times</family>
+ <family>Thorndale AMT</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
+ <family>Liberation Sans</family>
<family>Noto Sans</family>
<family>DejaVu Sans</family>
- <family>Verdana</family>
<family>Arial</family>
- <family>Albany AMT</family>
<family>Luxi Sans</family>
<family>Nimbus Sans L</family>
<family>Nimbus Sans</family>
<family>Helvetica</family>
<family>Lucida Sans Unicode</family>
<family>BPG Glaho International</family> <!-- lat,cyr,arab,geor -->
+ <family>Verdana</family>
<family>Tahoma</family> <!-- lat,cyr,greek,heb,arab,thai -->
+ <family>Albany AMT</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
+ <family>Liberation Mono</family>
<family>Noto Sans Mono</family>
<family>DejaVu Sans Mono</family>
<family>Inconsolata</family>
<family>Andale Mono</family>
<family>Courier New</family>
- <family>Cumberland AMT</family>
<family>Luxi Mono</family>
<family>Nimbus Mono L</family>
<family>Nimbus Mono</family>
<family>Nimbus Mono PS</family>
<family>Courier</family>
+ <family>Cumberland AMT</family>
</prefer>
</alias>
<!--
@@ -66,6 +69,7 @@
<alias>
<family>cursive</family>
<prefer>
+ <family>Comic Neue</family>
<family>ITC Zapf Chancery Std</family>
<family>Zapfino</family>
<family>Comic Sans MS</family>

View File

@ -0,0 +1,14 @@
https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/320
--- a/test/run-test.sh
+++ b/test/run-test.sh
@@ -40,9 +40,7 @@ EXPECTED=${EXPECTED-"out.expected"}
FCLIST="$LOG_COMPILER ../fc-list/fc-list$EXEEXT"
FCCACHE="$LOG_COMPILER ../fc-cache/fc-cache$EXEEXT"
-if [ -x "$(command -v bwrap)" ]; then
- BWRAP="$(command -v bwrap)"
-fi
+BWRAP=""
FONT1=$TESTDIR/4x6.pcf
FONT2=$TESTDIR/8x16.pcf

View File

@ -0,0 +1,220 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
# Cannot yet migrate to Meson as of 2.14.0:
# https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/244
inherit autotools multilib-minimal readme.gentoo-r1
DESCRIPTION="A library for configuring and customizing font access"
HOMEPAGE="https://fontconfig.org/"
SRC_URI="https://fontconfig.org/release/${P}.tar.xz"
LICENSE="MIT"
SLOT="1.0"
if ! [[ $(ver_cut 3) -ge 90 ]] ; then
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
fi
IUSE="doc static-libs test"
RESTRICT="!test? ( test )"
# - Check minimum freetype & other deps on bumps. See
# https://gitlab.freedesktop.org/fontconfig/fontconfig/-/blob/main/configure.ac#L314.
# Note that FT versioning is confusing, need to map it using
# https://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/VERSIONS.TXT
# But sometimes it's actually greater than that, e.g. see Fedora's spec file
# https://src.fedoraproject.org/rpms/fontconfig/blob/rawhide/f/fontconfig.spec#_1
#
# - Purposefully dropped the xml USE flag and libxml2 support. Expat is the
# default and used by every distro. See bug #283191.
#
# - There's a test-only dep on json-c.
# It might become an optional(?) runtime dep in future though. Who knows.
# Keep an eye on it.
RDEPEND=">=dev-libs/expat-2.1.0-r3[${MULTILIB_USEDEP}]
>=media-libs/freetype-2.9.1[${MULTILIB_USEDEP}]
virtual/libintl[${MULTILIB_USEDEP}]"
DEPEND="${RDEPEND}
test? ( dev-libs/json-c )"
BDEPEND="dev-util/gperf
>=sys-devel/gettext-0.19.8
virtual/pkgconfig
doc? (
=app-text/docbook-sgml-dtd-3.1*
app-text/docbook-sgml-utils[jadetex]
)"
PDEPEND="virtual/ttf-fonts"
# We need app-eselect/eselect-fontconfig in IDEPEND to update ROOT
# when cross-compiling.
IDEPEND="!x86-winnt? ( app-eselect/eselect-fontconfig )"
PATCHES=(
# bug #310157
"${FILESDIR}"/${PN}-2.14.0-docbook.patch
# bug #130466 + make liberation default
"${FILESDIR}"/${PN}-2.14.0-latin-update.patch
# Avoid test failure (bubblewrap doesn't work within sandbox)
"${FILESDIR}"/${PN}-2.14.0-skip-bubblewrap-tests.patch
# Patches from upstream (can usually be removed with next version bump)
)
DOC_CONTENTS="Please make fontconfig configuration changes using
\`eselect fontconfig\`. Any changes made to /etc/fonts/fonts.conf will be
overwritten. If you need to reset your configuration to upstream defaults,
delete the directory ${EROOT}/etc/fonts/conf.d/ and re-emerge fontconfig."
src_prepare() {
default
# Needed for docbook patch
eautoreconf
}
multilib_src_configure() {
local addfonts=(
"${EPREFIX}"/usr/local/share/fonts
)
# Harvest some font locations, such that users can benefit from the
# host OS's installed fonts
case ${CHOST} in
*-darwin*)
addfonts+=(
/Library/Fonts
/System/Library/Fonts
)
;;
*-solaris*)
[[ -d /usr/X/lib/X11/fonts/TrueType ]] && \
addfonts+=( /usr/X/lib/X11/fonts/TrueType )
[[ -d /usr/X/lib/X11/fonts/Type1 ]] &&
addfonts+=( /usr/X/lib/X11/fonts/Type1 )
;;
*-linux-gnu)
use prefix && [[ -d /usr/share/fonts ]] && \
addfonts+=( /usr/share/fonts )
;;
esac
local myeconfargs=(
$(use_enable doc docbook)
$(use_enable static-libs static)
# man pages. We split out the docbook parts into its own flag.
--enable-docs
# We handle this ourselves.
--disable-cache-build
# See comment above *DEPEND. We use Expat instead.
--disable-libxml2
--localstatedir="${EPREFIX}"/var
--with-default-fonts="${EPREFIX}"/usr/share/fonts
--with-add-fonts=$(IFS=, ; echo "${addfonts[*]}" )
--with-templatedir="${EPREFIX}"/etc/fonts/conf.avail
)
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
}
multilib_src_test() {
# Test needs network access
# https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/319
# On bumps after 2.14.0, please check to see if this has been fixed
# to allow local access!
chmod -x test/test-crbug1004254 || die
default
}
multilib_src_install() {
MULTILIB_CHOST_TOOLS=( /usr/bin/fc-cache$(get_exeext) )
default
# Avoid calling this multiple times, bug #459210
if multilib_is_native_abi; then
# Stuff installed from build-dir
emake -C doc DESTDIR="${D}" install-man
insinto /etc/fonts
doins fonts.conf
fi
}
multilib_src_install_all() {
einstalldocs
find "${ED}" -name "*.la" -delete || die
# fc-lang directory contains language coverage datafiles
# which are needed to test the coverage of fonts.
insinto /usr/share/fc-lang
doins fc-lang/*.orth
dodoc doc/fontconfig-user.{txt,pdf}
if [[ -e ${ED}/usr/share/doc/fontconfig/ ]] ; then
mv "${ED}"/usr/share/doc/fontconfig/* \
"${ED}"/usr/share/doc/${P} || die
rm -rf "${ED}"/usr/share/doc/fontconfig || die
fi
# Changes should be made to /etc/fonts/local.conf, and as we had
# too much problems with broken fonts.conf we force update it ...
echo 'CONFIG_PROTECT_MASK="/etc/fonts/fonts.conf"' \
> "${T}"/37fontconfig || die
doenvd "${T}"/37fontconfig
# As of fontconfig 2.7, everything sticks their noses in here.
dodir /etc/sandbox.d
echo 'SANDBOX_PREDICT="/var/cache/fontconfig"' \
> "${ED}"/etc/sandbox.d/37fontconfig || die
readme.gentoo_create_doc
# We allow the cache generation to make this later
# bug #587492
}
pkg_preinst() {
# bug #193476
# /etc/fonts/conf.d/ contains symlinks to ../conf.avail/ to include various
# config files. If we install as-is, we'll blow away user settings.
ebegin "Syncing fontconfig configuration to system"
if [[ -e ${EROOT}/etc/fonts/conf.d ]] ; then
local file f
for file in "${EROOT}"/etc/fonts/conf.avail/* ; do
f=${file##*/}
if [[ -L ${EROOT}/etc/fonts/conf.d/${f} ]] ; then
[[ -f ${ED}/etc/fonts/conf.avail/${f} ]] \
&& ln -sf ../conf.avail/"${f}" \
"${ED}"/etc/fonts/conf.d/ &>/dev/null
else
[[ -f ${ED}/etc/fonts/conf.avail/${f} ]] \
&& rm "${ED}"/etc/fonts/conf.d/"${f}" &>/dev/null
fi
done
fi
eend $?
}
pkg_postinst() {
einfo "Cleaning broken symlinks in ${EROOT}/etc/fonts/conf.d/"
find -L "${EROOT}"/etc/fonts/conf.d/ -type l -delete
readme.gentoo_print_elog
if [[ -z ${ROOT} ]] ; then
multilib_pkg_postinst() {
ebegin "Creating global font cache for ${ABI}"
"${EPREFIX}"/usr/bin/${CHOST}-fc-cache -srf
eend $?
}
multilib_parallel_foreach_abi multilib_pkg_postinst
fi
}

View File

@ -0,0 +1,100 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..10} )
inherit flag-o-matic meson-multilib python-any-r1 xdg-utils
DESCRIPTION="An OpenType text shaping engine"
HOMEPAGE="https://www.freedesktop.org/wiki/Software/HarfBuzz"
if [[ ${PV} = 9999 ]] ; then
EGIT_REPO_URI="https://github.com/harfbuzz/harfbuzz.git"
inherit git-r3
else
SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
fi
LICENSE="Old-MIT ISC icu"
# 0.9.18 introduced the harfbuzz-icu split; bug #472416
# 3.0.0 dropped some unstable APIs; bug #813705
SLOT="0/4.0.0"
IUSE="+cairo debug doc experimental +glib +graphite icu +introspection test +truetype"
RESTRICT="!test? ( test )"
REQUIRED_USE="introspection? ( glib )"
RDEPEND="
cairo? ( x11-libs/cairo:= )
glib? ( >=dev-libs/glib-2.38:2[${MULTILIB_USEDEP}] )
graphite? ( >=media-gfx/graphite2-1.2.1:=[${MULTILIB_USEDEP}] )
icu? ( >=dev-libs/icu-51.2-r1:=[${MULTILIB_USEDEP}] )
introspection? ( >=dev-libs/gobject-introspection-1.34:= )
truetype? ( >=media-libs/freetype-2.5.0.1:2=[${MULTILIB_USEDEP}] )
"
DEPEND="${RDEPEND}
>=dev-libs/gobject-introspection-common-1.34
"
BDEPEND="
${PYTHON_DEPS}
virtual/pkgconfig
doc? ( dev-util/gtk-doc )
introspection? ( dev-util/glib-utils )
"
pkg_setup() {
python-any-r1_pkg_setup
if ! use debug ; then
append-cppflags -DHB_NDEBUG
fi
}
src_prepare() {
default
xdg_environment_reset
sed -i \
-e '/tests\/macos\.tests/d' \
test/shape/data/in-house/Makefile.sources \
|| die # bug 726120
# bug 618772
append-cxxflags -std=c++14
# bug 790359
filter-flags -fexceptions -fthreadsafe-statics
# bug 762415
local pyscript
for pyscript in $(find -type f -name "*.py") ; do
python_fix_shebang -q "${pyscript}"
done
}
multilib_src_configure() {
# harfbuzz-gobject only used for introspection, bug #535852
local emesonargs=(
-Dcoretext="disabled"
-Dchafa="disabled"
$(meson_feature glib)
$(meson_feature graphite graphite2)
$(meson_feature icu)
$(meson_feature introspection gobject)
$(meson_feature test tests)
$(meson_feature truetype freetype)
$(meson_native_use_feature cairo)
$(meson_native_use_feature doc docs)
$(meson_native_use_feature introspection)
$(meson_use experimental experimental_api)
)
perl -pe "s/^(\s+conf\.set\('HAVE_\@0\@'.*)$/if name != 'getpagesize' and name != 'mprotect'\n\$1\nendif/" ${S}/meson.build > meson.build.tmp
mv meson.build.tmp ${S}/meson.build
meson_src_configure
}

View File

@ -0,0 +1,16 @@
EAPI=5
DESCRIPTION="Dummy binary"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
src_unpack() {
mkdir ${WORKDIR}/${P}
}
src_install() {
mkdir -p ${D}/usr/bin/
echo ":" > ${D}/usr/bin/${PN}
chmod +x ${D}/usr/bin/${PN}
}

View File

@ -0,0 +1,37 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DESCRIPTION=""
HOMEPAGE=""
SRC_URI="https://github.com/dlfcn-win32/dlfcn-win32/archive/refs/tags/v${PV}.tar.gz"
LICENSE=""
SLOT="0"
KEYWORDS="~amd64"
DEPEND=""
RDEPEND="${DEPEND}"
BDEPEND=""
inherit toolchain-funcs
S="${WORKDIR}/dlfcn-win32-${PV}"
src_configure() {
${S}/configure --cc=$(tc-getCC) --enable-shared --disable-static
}
src_compile() {
emake
}
src_install() {
dodir /usr/include
dodir /usr/bin
dodir /usr/lib
install ${S}/src/dlfcn.h -m 644 ${ED}/usr/include
install ${S}/libdl.dll -m 644 ${ED}/usr/bin
install ${S}/libdl.dll -m 644 ${ED}/usr/lib
}

View File

@ -0,0 +1,38 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DESCRIPTION=""
HOMEPAGE=""
COMMIT="2d1c576e62b99e85d99407e1a88794c6e44c3310"
SRC_URI="https://github.com/alitrack/mman-win32/archive/${COMMIT}.tar.gz"
LICENSE=""
SLOT="0"
KEYWORDS="~amd64"
DEPEND=""
RDEPEND="${DEPEND}"
BDEPEND=""
inherit toolchain-funcs
S="${WORKDIR}/mman-win32-${COMMIT}"
src_configure() {
${S}/configure --cc=$(tc-getCC) --enable-shared --disable-static
}
src_compile() {
emake
}
src_install() {
dodir /usr/include/sys
dodir /usr/lib
dodir /usr/bin
install -m 644 ${S}/mman.h ${ED}/usr/include/sys/mman.h
install -m 644 ${S}/libmman.dll ${ED}/usr/lib/libmman.dll
install -m 644 ${S}/libmman.dll ${ED}/usr/bin/libmman.dll
}

View File

@ -0,0 +1,18 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
DESCRIPTION="Virtual for operating system headers"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
# depend on SLOT 0 of linux-headers, because kernel-2.eclass
# sets a different SLOT for cross-building
RDEPEND="
!prefix-guest? (
kernel_linux? ( sys-kernel/linux-headers:0 )
)
prefix-guest? (
!sys-kernel/linux-headers
)"

View File

@ -0,0 +1,34 @@
From 21b8eb73d9272e06707ad6d0357f3034b8d9a46f Mon Sep 17 00:00:00 2001
From: "Anthony G. Basile" <blueness@gentoo.org>
Date: Wed, 14 Oct 2015 16:18:19 -0400
Subject: [PATCH] tests/pixbuf-lowmem.c: Do not run pixbuf-lowmem test on
uClibc
pixbuf-lowmem.c depends on GNU libc internals and does not build
on musl or uClibc. Commit e1fd25a fixes this issue for musl by
testing if __GLIBC__ is set. However, uClibc sets __GLIBC__ and
so this check is insufficient there. We expand the check so that
we run pixbuf-lowmem on glibc, while avoiding it on both musl and
uClibc.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
---
tests/pixbuf-lowmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/pixbuf-lowmem.c b/tests/pixbuf-lowmem.c
index 9e9571f..ec7504f 100644
--- a/tests/pixbuf-lowmem.c
+++ b/tests/pixbuf-lowmem.c
@@ -24,7 +24,7 @@
#include <time.h>
#include <string.h>
-#ifdef __GLIBC__
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
#define PRETEND_MEM_SIZE (16 * 1024 * 1024)
#define REMAINING_MEM_SIZE 100000
--
2.4.9

View File

@ -0,0 +1,116 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit gnome.org gnome2-utils meson-multilib multilib xdg
DESCRIPTION="Image loading library for GTK+"
HOMEPAGE="https://gitlab.gnome.org/GNOME/gdk-pixbuf"
LICENSE="LGPL-2.1+"
SLOT="2"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="gtk-doc +introspection jpeg tiff"
# TODO: For windows/darwin support: shared-mime-info conditional, native_windows_loaders option review
DEPEND="
>=dev-libs/glib-2.56.0:2[${MULTILIB_USEDEP}]
x11-misc/shared-mime-info
>=media-libs/libpng-1.4:0=[${MULTILIB_USEDEP}]
jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
tiff? ( >=media-libs/tiff-3.9.2:0=[${MULTILIB_USEDEP}] )
gtk-doc? ( >=dev-util/gi-docgen-2021.1 )
introspection? ( >=dev-libs/gobject-introspection-1.54:= )
"
RDEPEND="${DEPEND}
!<x11-libs/gtk+-2.90.4:3
"
BDEPEND="
app-text/docbook-xsl-stylesheets
app-text/docbook-xml-dtd:4.3
dev-libs/glib:2
dev-libs/libxslt
dev-util/glib-utils
>=sys-devel/gettext-0.19.8
virtual/pkgconfig
"
MULTILIB_CHOST_TOOLS=(
/usr/bin/gdk-pixbuf-query-loaders$(get_exeext)
)
PATCHES=(
# Do not run lowmem test on uclibc
# See https://bugzilla.gnome.org/show_bug.cgi?id=756590
"${FILESDIR}"/${PN}-2.32.3-fix-lowmem-uclibc.patch
)
src_prepare() {
xdg_src_prepare
# This will avoid polluting the pkg-config file with versioned libpng,
# which is causing problems with libpng14 -> libpng15 upgrade
# See upstream bug #667068
# First check that the pattern is present, to catch upstream changes on bumps,
# because sed doesn't return failure code if it doesn't do any replacements
grep -q "foreach png: \[ 'libpng16', 'libpng15', 'libpng14', 'libpng12', 'libpng13', 'libpng10' \]" meson.build || die "libpng check order has changed upstream"
sed -e "s/foreach png: \[ 'libpng16', 'libpng15', 'libpng14', 'libpng12', 'libpng13', 'libpng10' \]/foreach png: \[ 'libpng', 'libpng16', 'libpng15', 'libpng14', 'libpng12', 'libpng13', 'libpng10' \]/" -i meson.build || die
}
multilib_src_configure() {
local emesonargs=(
-Dpng=enabled
$(meson_feature tiff)
$(meson_feature jpeg)
-Dbuiltin_loaders=png,jpeg
-Drelocatable=false
#native_windows_loaders
-Dinstalled_tests=false
-Dgio_sniffing=true
$(meson_native_use_bool gtk-doc gtk_doc)
$(meson_native_use_feature introspection)
$(meson_native_true man)
)
meson_src_configure
}
multilib_src_install_all() {
einstalldocs
if use gtk-doc; then
mkdir -p "${ED}"/usr/share/gtk-doc/html/ || die
mv "${ED}"/usr/share/doc/gdk-pixbuf "${ED}"/usr/share/gtk-doc/html/ || die
mv "${ED}"/usr/share/doc/gdk-pixdata "${ED}"/usr/share/gtk-doc/html/ || die
fi
}
pkg_preinst() {
xdg_pkg_preinst
multilib_pkg_preinst() {
# Make sure loaders.cache belongs to gdk-pixbuf alone
local cache="usr/$(get_libdir)/${PN}-2.0/2.10.0/loaders.cache"
if [[ -e ${EROOT}/${cache} ]]; then
cp "${EROOT}"/${cache} "${ED}"/${cache} || die
else
touch "${ED}"/${cache} || die
fi
}
multilib_foreach_abi multilib_pkg_preinst
gnome2_gdk_pixbuf_savelist
}
pkg_postinst() {
xdg_pkg_postinst
multilib_foreach_abi gnome2_gdk_pixbuf_update
}
pkg_postrm() {
xdg_pkg_postrm
if [[ -z ${REPLACED_BY_VERSION} ]]; then
rm -f "${EROOT}"/usr/lib*/${PN}-2.0/2.10.0/loaders.cache
fi
}

View File

@ -0,0 +1,66 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/drm.git"
PYTHON_COMPAT=( python3_{8..11} )
if [[ ${PV} = 9999* ]]; then
GIT_ECLASS="git-r3"
fi
inherit ${GIT_ECLASS} python-any-r1 meson-multilib
DESCRIPTION="X.Org libdrm library"
HOMEPAGE="https://dri.freedesktop.org/ https://gitlab.freedesktop.org/mesa/drm"
if [[ ${PV} = 9999* ]]; then
SRC_URI=""
else
SRC_URI="https://dri.freedesktop.org/libdrm/${P}.tar.xz"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
fi
VIDEO_CARDS="amdgpu exynos freedreno intel nouveau omap radeon tegra vc4 vivante vmware"
for card in ${VIDEO_CARDS}; do
IUSE_VIDEO_CARDS+=" video_cards_${card}"
done
IUSE="${IUSE_VIDEO_CARDS} valgrind"
RESTRICT="test" # see bug #236845
LICENSE="MIT"
SLOT="0"
RDEPEND="
video_cards_intel? ( >=x11-libs/libpciaccess-0.13.1-r1:=[${MULTILIB_USEDEP}] )"
DEPEND="${RDEPEND}
valgrind? ( dev-util/valgrind )"
BDEPEND="${PYTHON_DEPS}
$(python_gen_any_dep 'dev-python/docutils[${PYTHON_USEDEP}]')"
python_check_deps() {
has_version -b "dev-python/docutils[${PYTHON_USEDEP}]"
}
CFLAGS+=" -std=gnu11"
multilib_src_configure() {
local emesonargs=(
# Udev is only used by tests now.
-Dudev=false
-Dcairo-tests=false
$(meson_use video_cards_amdgpu amdgpu)
$(meson_use video_cards_exynos exynos)
$(meson_use video_cards_freedreno freedreno)
$(meson_use video_cards_intel intel)
$(meson_use video_cards_nouveau nouveau)
$(meson_use video_cards_omap omap)
$(meson_use video_cards_radeon radeon)
$(meson_use video_cards_tegra tegra)
$(meson_use video_cards_vc4 vc4)
$(meson_use video_cards_vivante etnaviv)
$(meson_use video_cards_vmware vmwgfx)
# valgrind installs its .pc file to the pkgconfig for the primary arch
-Dvalgrind=$(usex valgrind auto false)
)
meson_src_configure
}

View File

@ -0,0 +1,34 @@
From 490f8979a260c16b1df055eab386345da18a2d54 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Wed, 10 Jul 2019 20:26:23 -0400
Subject: [PATCH] bidi: Be safer against bad input
Don't run off the end of an array that we
allocated to certain length.
Closes: https://gitlab.gnome.org/GNOME/pango/issues/342
---
pango/pango-bidi-type.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/pango/pango-bidi-type.c b/pango/pango-bidi-type.c
index 3e46b66c..5c02dbbb 100644
--- a/pango/pango-bidi-type.c
+++ b/pango/pango-bidi-type.c
@@ -181,8 +181,11 @@ pango_log2vis_get_embedding_levels (const gchar *text,
for (i = 0, p = text; p < text + length; p = g_utf8_next_char(p), i++)
{
gunichar ch = g_utf8_get_char (p);
- FriBidiCharType char_type;
- char_type = fribidi_get_bidi_type (ch);
+ FriBidiCharType char_type = fribidi_get_bidi_type (ch);
+
+ if (i == n_chars)
+ break;
+
bidi_types[i] = char_type;
ored_types |= char_type;
if (FRIBIDI_IS_STRONG (char_type))
--
2.21.0

View File

@ -0,0 +1,113 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
.TH PANGO-VIEW "1" "August 2018" "pango-view (pango) 1.42.4" "User Commands"
.SH NAME
pango-view \- Pango text viewer
.SH DESCRIPTION
.SS "Usage:"
.IP
pango\-view [OPTION?] \- FILE
.SS "Help Options:"
.TP
\fB\-h\fR, \fB\-\-help\fR
Show help options
.TP
\fB\-\-help\-all\fR
Show all help options
.TP
\fB\-\-help\-cairo\fR
Options understood by the cairo backend
.SS "Cairo backend options:"
.TP
\fB\-\-annotate\fR=\fI\,1\/\fR or 2
Annotate the output
.SS "Application Options:"
.TP
\fB\-\-no\-auto\-dir\fR
No layout direction according to contents
.TP
\fB\-\-backend\fR=\fI\,cairo\/\fR/xft/ft2
Pango backend to use for rendering (default: cairo)
.TP
\fB\-\-background\fR=\fI\,red\/\fR/#rrggbb/#rrggbbaa/transparent
Set the background color
.TP
\fB\-q\fR, \fB\-\-no\-display\fR
Do not display (just write to file or whatever)
.TP
\fB\-\-dpi\fR=\fI\,number\/\fR
Set the resolution
.TP
\fB\-\-align\fR=\fI\,left\/\fR/center/right
Text alignment
.TP
\fB\-\-ellipsize\fR=\fI\,start\/\fR/middle/end
Ellipsization mode
.TP
\fB\-\-font\fR=\fI\,description\/\fR
Set the font description
.TP
\fB\-\-foreground\fR=\fI\,red\/\fR/#rrggbb/#rrggbbaa
Set the text color
.TP
\fB\-\-gravity\fR=\fI\,south\/\fR/east/north/west/auto
Base gravity: glyph rotation
.TP
\fB\-\-gravity\-hint\fR=\fI\,natural\/\fR/strong/line
Gravity hint
.TP
\fB\-\-header\fR
Display the options in the output
.TP
\fB\-\-height=\fR+points/\-numlines
Height in points (positive) or number of lines (negative) for ellipsizing
.TP
\fB\-\-hinting\fR=\fI\,none\/\fR/auto/full
Hinting style
.TP
\fB\-\-indent\fR=\fI\,points\/\fR
Width in points to indent paragraphs
.TP
\fB\-\-justify\fR
Align paragraph lines to be justified
.TP
\fB\-\-language\fR=\fI\,en_US\/\fR/etc
Language to use for font selection
.TP
\fB\-\-margin\fR=\fI\,CSS\-style\/\fR numbers in pixels
Set the margin on the output in pixels
.TP
\fB\-\-markup\fR
Interpret text as Pango markup
.TP
\fB\-o\fR, \fB\-\-output\fR=\fI\,file\/\fR
Save rendered image to output file
.TP
\fB\-\-pixels\fR
Use pixel units instead of points (sets dpi to 72)
.TP
\fB\-\-rtl\fR
Set base direction to right\-to\-left
.TP
\fB\-\-rotate\fR=\fI\,degrees\/\fR
Angle at which to rotate results
.TP
\fB\-n\fR, \fB\-\-runs\fR=\fI\,integer\/\fR
Run Pango layout engine this many times
.TP
\fB\-\-single\-par\fR
Enable single\-paragraph mode
.TP
\fB\-t\fR, \fB\-\-text\fR=\fI\,string\/\fR
Text to display (instead of a file)
.TP
\fB\-\-version\fR
Show version numbers
.TP
\fB\-\-waterfall\fR
Create a waterfall display
.TP
\fB\-w\fR, \fB\-\-width\fR=\fI\,points\/\fR
Width in points to which to wrap lines or ellipsize
.TP
\fB\-\-wrap\fR=\fI\,word\/\fR/char/word\-char
Text wrapping mode (needs a width to be set)

View File

@ -0,0 +1,78 @@
https://gitlab.gnome.org/GNOME/pango/-/commit/0226bdd9c223f5651b6657a14cebc900bbac4b19
https://bugs.gentoo.org/836317
Fixes tests with Harfbuzz 4.0.0 ish.
From: Matthias Clasen <mclasen@redhat.com>
Date: Fri, 10 Jun 2022 08:00:22 -0400
Subject: [PATCH] Update tests to pass on F36
Rounding differences are our downfall :(
--- a/tests/layouts/valid-14.layout
+++ b/tests/layouts/valid-14.layout
@@ -25,7 +25,7 @@
"is-ellipsized" : true,
"unknown-glyphs" : 1,
"width" : 161792,
- "height" : 20480,
+ "height" : 21047,
"log-attrs" : [
{
"char-break" : true,
@@ -261,7 +261,7 @@
]
},
"flags" : 0,
- "y-offset" : 0,
+ "y-offset" : 567,
"start-x-offset" : 0,
"end-x-offset" : 0,
"glyphs" : [
@@ -360,7 +360,7 @@
]
},
"flags" : 0,
- "y-offset" : 0,
+ "y-offset" : 337,
"start-x-offset" : 0,
"end-x-offset" : 0,
"glyphs" : [
--- a/tests/layouts/valid-20.layout
+++ b/tests/layouts/valid-20.layout
@@ -40,7 +40,7 @@
"is-wrapped" : false,
"is-ellipsized" : false,
"unknown-glyphs" : 0,
- "width" : 67584,
+ "width" : 76800,
"height" : 25600,
"log-attrs" : [
{
@@ -138,7 +138,7 @@
"glyphs" : [
{
"glyph" : 244,
- "width" : 15360,
+ "width" : 18432,
"x-offset" : 14764,
"y-offset" : 3845,
"is-cluster-start" : true,
@@ -146,7 +146,7 @@
},
{
"glyph" : 272,
- "width" : 15360,
+ "width" : 18432,
"x-offset" : 14764,
"y-offset" : 4280,
"is-cluster-start" : true,
@@ -154,7 +154,7 @@
},
{
"glyph" : 273,
- "width" : 15360,
+ "width" : 18432,
"x-offset" : 14764,
"y-offset" : 3507,
"is-cluster-start" : true,
GitLab

View File

@ -0,0 +1,90 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit flag-o-matic gnome2-utils meson-multilib xdg
DESCRIPTION="Internationalized text layout and rendering library"
HOMEPAGE="https://www.pango.org/ https://gitlab.gnome.org/GNOME/pango"
SRC_URI="http://ftp.gnome.org/pub/GNOME/sources/pango/$(ver_cut 1-2)/${P}.tar.xz"
LICENSE="LGPL-2+"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="debug +introspection sysprof test X"
RESTRICT="!test? ( test )"
RDEPEND="
>=dev-libs/glib-2.62.2:2[${MULTILIB_USEDEP}]
>=dev-libs/fribidi-1.0.6[${MULTILIB_USEDEP}]
>=media-libs/harfbuzz-2.6.0:=[glib(+),introspection?,truetype(+),${MULTILIB_USEDEP}]
>=media-libs/fontconfig-2.13.0:1.0=[${MULTILIB_USEDEP}]
>=x11-libs/cairo-1.12.10:=[X?,${MULTILIB_USEDEP}]
>=media-libs/freetype-2.5.0.1:2=[${MULTILIB_USEDEP}]
introspection? ( >=dev-libs/gobject-introspection-0.9.5:= )
X? (
>=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
>=x11-libs/libXft-2.3.1-r1[${MULTILIB_USEDEP}]
>=x11-libs/libXrender-0.9.8[${MULTILIB_USEDEP}]
)
"
DEPEND="${RDEPEND}
sysprof? ( >=dev-util/sysprof-capture-3.40.1:4[${MULTILIB_USEDEP}] )
X? ( x11-base/xorg-proto )
"
BDEPEND="
dev-util/glib-utils
sys-apps/help2man
virtual/pkgconfig
test? ( media-fonts/cantarell )
"
PATCHES=(
"${FILESDIR}"/${PV}-harfbuzz-4.patch
)
src_prepare() {
xdg_src_prepare
gnome2_environment_reset
}
multilib_src_configure() {
if use debug; then
append-cflags -DPANGO_ENABLE_DEBUG
else
append-cflags -DG_DISABLE_CAST_CHECKS
fi
local emesonargs=(
# Never use gi-docgen subproject
--wrap-mode nofallback
-Dgtk_doc=false # we ship pregenerated docs
$(meson_native_use_feature introspection)
-Dinstall-tests=false
-Dfontconfig=enabled
$(meson_feature sysprof)
-Dlibthai=disabled
-Dcairo=enabled
$(meson_feature X xft)
-Dfreetype=enabled
)
meson_src_configure
}
multilib_src_install_all() {
insinto /usr/share/gtk-doc/html
# This will install PangoXft API docs regardless of USE=-X, but this is intentional
doins -r "${S}"/docs/Pango*
}
pkg_postinst() {
xdg_pkg_postinst
if has_version 'media-libs/freetype[-harfbuzz]' ; then
ewarn "media-libs/freetype is installed without harfbuzz support. This may"
ewarn "lead to minor font rendering problems, see bug 712374."
fi
}