dia: fix build, move python2 from hard dependency to optional

This commit is contained in:
John McQuah 2023-01-30 08:57:26 -05:00
parent 5f6a3909d7
commit 21d612e9b0
6 changed files with 41 additions and 221 deletions

View File

@ -53,8 +53,6 @@ drwxr-xr-x root/root usr/lib/dia/
-rwxr-xr-x root/root usr/lib/dia/libpostscript_filter.so
-rwxr-xr-x root/root usr/lib/dia/libpstricks_filter.la
-rwxr-xr-x root/root usr/lib/dia/libpstricks_filter.so
-rwxr-xr-x root/root usr/lib/dia/libpython_plugin.la
-rwxr-xr-x root/root usr/lib/dia/libpython_plugin.so
-rwxr-xr-x root/root usr/lib/dia/libsadt_objects.la
-rwxr-xr-x root/root usr/lib/dia/libsadt_objects.so
-rwxr-xr-x root/root usr/lib/dia/libshape_filter.la
@ -78,37 +76,6 @@ drwxr-xr-x root/root usr/share/applications/
-rw-r--r-- root/root usr/share/applications/dia.desktop
drwxr-xr-x root/root usr/share/dia/
-rw-r--r-- root/root usr/share/dia/dia-splash.png
-rw-r--r-- root/root usr/share/dia/python-startup.py
-rw-r--r-- root/root usr/share/dia/python-startup.pyc
drwxr-xr-x root/root usr/share/dia/python/
-rw-r--r-- root/root usr/share/dia/python/allprops.py
-rw-r--r-- root/root usr/share/dia/python/allprops.pyc
-rw-r--r-- root/root usr/share/dia/python/aobjects.py
-rw-r--r-- root/root usr/share/dia/python/aobjects.pyc
-rw-r--r-- root/root usr/share/dia/python/codegen.py
-rw-r--r-- root/root usr/share/dia/python/codegen.pyc
-rw-r--r-- root/root usr/share/dia/python/diasvg.py
-rw-r--r-- root/root usr/share/dia/python/diasvg.pyc
-rw-r--r-- root/root usr/share/dia/python/diasvg_import.py
-rw-r--r-- root/root usr/share/dia/python/diasvg_import.pyc
-rw-r--r-- root/root usr/share/dia/python/dot.py
-rw-r--r-- root/root usr/share/dia/python/dot.pyc
-rw-r--r-- root/root usr/share/dia/python/doxrev.py
-rw-r--r-- root/root usr/share/dia/python/doxrev.pyc
-rw-r--r-- root/root usr/share/dia/python/gtkcons.py
-rw-r--r-- root/root usr/share/dia/python/gtkcons.pyc
-rw-r--r-- root/root usr/share/dia/python/imgmap.py
-rw-r--r-- root/root usr/share/dia/python/imgmap.pyc
-rw-r--r-- root/root usr/share/dia/python/otypes.py
-rw-r--r-- root/root usr/share/dia/python/otypes.pyc
-rw-r--r-- root/root usr/share/dia/python/pydiadoc.py
-rw-r--r-- root/root usr/share/dia/python/pydiadoc.pyc
-rw-r--r-- root/root usr/share/dia/python/scascale.py
-rw-r--r-- root/root usr/share/dia/python/scascale.pyc
-rw-r--r-- root/root usr/share/dia/python/select_by.py
-rw-r--r-- root/root usr/share/dia/python/select_by.pyc
-rw-r--r-- root/root usr/share/dia/python/select_empty.py
-rw-r--r-- root/root usr/share/dia/python/select_empty.pyc
drwxr-xr-x root/root usr/share/dia/shapes/
drwxr-xr-x root/root usr/share/dia/shapes/Assorted/
-rw-r--r-- root/root usr/share/dia/shapes/Assorted/arrow-chevron.png
@ -1792,6 +1759,9 @@ drwxr-xr-x root/root usr/share/icons/hicolor/48x48/apps/
drwxr-xr-x root/root usr/share/icons/hicolor/scalable/
drwxr-xr-x root/root usr/share/icons/hicolor/scalable/apps/
-rw-r--r-- root/root usr/share/icons/hicolor/scalable/apps/dia.svg
drwxr-xr-x root/root usr/share/man/
drwxr-xr-x root/root usr/share/man/man1/
-rw-r--r-- root/root usr/share/man/man1/dia.1.gz
drwxr-xr-x root/root usr/share/mime-info/
-rw-r--r-- root/root usr/share/mime-info/dia.keys
-rw-r--r-- root/root usr/share/mime-info/dia.mime

View File

@ -1,8 +1,5 @@
untrusted comment: verify with /etc/ports/contrib.pub
RWSagIOpLGJF30rZuRQmk+yVNMb90yQI+qcVG5kiH1wnHX4sC7deHoXO7fPWgJ5pe9Pa95y/gcKLbddO0tqVDATI2OOJVNjGjws=
SHA256 (Pkgfile) = 5d76695f07e18f1459b953c7003c6b9523e6702fef1aa237c3f76d75296bb48e
SHA256 (.footprint) = 0d17fe7cf87933811344bc14d5c6d63c483aea256307b0f2a9687ebe6a3b1f8d
RWSagIOpLGJF30+b4GZ7SC6PzzlCZY1j2iXaVEVzeK1E7spHh52L9CMsJ6UAwSATAljsmtrLhBN9Xjbi0joPIco0L9kraE0SRgw=
SHA256 (Pkgfile) = c3febff4b562a5d52b74a12eb450a5d8476672a4000a3ac04b843787f91c9f63
SHA256 (.footprint) = 7ad2bbfbc02a456d1cca4078aafcd36fa1f78a75ae86bde34666ad8ff18cf4d9
SHA256 (dia-0.97.3.tar.xz) = 22914e48ef48f894bb5143c5efc3d01ab96e0a0cde80de11058d3b4301377d34
SHA256 (dia-0.97.2-underlinking.patch) = e7681b719c8ddf8c099c58ab16d521a570c36b24a8fcbe24309f398af965f1f4
SHA256 (dia-0.97.3-freetype_pkgconfig.patch) = d140a0e17d46b4b944fcd2a5685797c2dd3b4188a7d341c79b058656477d367a
SHA256 (dia-0.97.0-gnome-doc.patch) = 5a0161a8da6991c65eb85cda4fbb00e65d897a13ab17ca2d1924167d316fa7a6

View File

@ -1,43 +1,50 @@
# Description: GTK+ Diagramming Creation Software.
# URL: https://wiki.gnome.org/action/show/Apps/Dia
# Maintainer: Danny Rawlins, crux at romster dot me
# Depends on: docbook-xsl gtk libart_lgpl python xorg-libxdamage
# Depends on: docbook-xsl gtk libart_lgpl xorg-libxdamage
# Optional: python
name=dia
version=0.97.3
release=2
source=(https://download.gnome.org/sources/$name/${version%.*}/$name-$version.tar.xz
# https://gitweb.gentoo.org/repo/gentoo.git/tree/app-office/dia/files
dia-0.97.2-underlinking.patch dia-0.97.3-freetype_pkgconfig.patch
dia-0.97.0-gnome-doc.patch)
release=3
source=(https://download.gnome.org/sources/$name/${version%.*}/$name-$version.tar.xz)
build() {
cd $name-$version
# https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/dia
for file in `find -type f -name '*.py'`; do
sed -i 's_#!/usr/bin/env python_#!/usr/bin/env python2_' "$file"
done
sed -i 's#python2\.1#python2 python2.1#' configure
export PYTHON=/usr/bin/python2
patch -Np1 -i $SRC/dia-0.97.2-underlinking.patch
patch -Np1 -i $SRC/dia-0.97.3-freetype_pkgconfig.patch
patch -Np1 -i $SRC/dia-0.97.0-gnome-doc.patch
./configure \
--prefix=/usr \
--mandir=/usr/share/man \
--with-cairo \
--with-python \
--without-hardbooks \
--disable-gnome \
--disable-nls
# pkgconf obviates the three patches we used to apply to configure.in
sed -e 's/freetype-config --libs/pkgconf --libs freetype2/' \
-e 's/freetype-config --cflags/pkgconf --cflags freetype2/' \
-i configure
# avoid filling /usr/share/locale with unwanted translations
sed -e 's/all-local$//; s/all-local //;' \
-e '/^SUBDIRS/s/ po / /' \
-i Makefile.in
PKGMK_DIA="--prefix=/usr
--mandir=/usr/share/man
--with-cairo
--without-hardbooks
--disable-gnome
--disable-nls"
if prt-get isinst python; then
PKGMK_DIA+=" --with-python"
for file in $(grep -lrE "/usr/bin/env python$" .); do
sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python2|' "$file"
done
sed -e 's/python python2\.1/python2 python2.1/' \
-i configure
else
PKGMK_DIA+=" --without-python"
fi
./configure $PKGMK_DIA
make
make DESTDIR=$PKG install
/usr/bin/python -mcompileall $PKG
[[ "$PKGMK_DIA" =~ --with-python ]] && /usr/bin/python2 -mcompileall $PKG
rm -r \
$PKG/usr/share/locale \
$PKG/usr/share/doc \
$PKG/usr/share/man
rm -rf $PKG/usr/share/doc
rm -rf $PKG/usr/share/man/fr
}

View File

@ -1,61 +0,0 @@
From 9d40692b695b30f80b263814bdd351c0dbe67733 Mon Sep 17 00:00:00 2001
From: Gilles Dartiguelongue <eva@gentoo.org>
Date: Mon, 18 May 2009 22:19:35 +0200
Subject: [PATCH] Fix compilation in a gnome environment, gentoo bug #159831
---
configure.in | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/configure.in b/configure.in
index d27ee6e..d9c0bf4 100644
--- a/configure.in
+++ b/configure.in
@@ -110,17 +110,19 @@ if test "$have_libart" = "yes" ; then
fi
AC_MSG_CHECKING([whether GNOME specific code should be used])
-AC_ARG_ENABLE(gnome,[ --enable-gnome enable gnome code],
- GNOME=$enableval, GNOME=no)
-if test "$GNOME" = "yes" ; then
+AC_ARG_ENABLE(gnome,
+ AC_HELP_STRING([--enable-gnome],[enable gnome code]),,
+ enable_gnome=no)
+if test "x$enable_gnome" = "xyes" ; then
GTK_MODULES="$GTK_MODULES libgnome-2.0 libgnomeui-2.0"
AC_DEFINE(GNOME,1,[Define if building with GNOME support])
+ AC_DEFINE(HAVE_GNOME,1,[Define if building with GNOME support])
AC_DEFINE_UNQUOTED(GNOME_ICONDIR, "${prefix}/share/pixmaps", [GNOME icon directory])
- have_gnome=true
+ have_gnome=yes
else
- have_gnome=false
+ have_gnome=no
fi
-AM_CONDITIONAL(HAVE_GNOME, $have_gnome)
+AM_CONDITIONAL(HAVE_GNOME, [test "x$have_gnome" != "xno"])
AC_MSG_RESULT($GNOME)
dnl GTK2: libgnomecanvas-2.0 ?
@@ -129,7 +131,8 @@ PKG_CHECK_MODULES(GTK,$GTK_MODULES)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
-AM_CONDITIONAL(HAVE_BONOBO,false)
+#AM_CONDITIONAL(HAVE_BONOBO,false)
+AM_CONDITIONAL(HAVE_BONOBO,[test "true" = "false"])
dnl Look for Cairo
AC_ARG_WITH(cairo,
@@ -627,7 +630,7 @@ Configuration:
Source code location: ${srcdir}
Compiler: ${CC}
- Gnome support: ${GNOME}
+ Gnome support: ${have_gnome}
Python support: ${with_python}
Libart support (PNG export): ${have_libart}
Cairo support (PNG, PDF, print): ${with_cairo}
--
1.6.3

View File

@ -1,27 +0,0 @@
From 2f853bab67b087605a10f544a7df780ac98b8583 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <gentoo@mgorny.alt.pl>
Date: Sat, 7 Jul 2012 17:28:59 +0200
Subject: [PATCH] Fix missing linkage with gmodule-2.0.
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=678761
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=420685
---
configure.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.in b/configure.in
index 72830de..6b7394a 100644
--- a/configure.in
+++ b/configure.in
@@ -55,7 +55,7 @@ AC_SUBST(GMODULE_CFLAGS)
AC_SUBST(GMODULE_LIBS)
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
-GTK_MODULES="gtk+-2.0 >= 2.6.0 glib-2.0 >= 2.6.0 libxml-2.0 gdk-pixbuf-2.0 gthread-2.0"
+GTK_MODULES="gtk+-2.0 >= 2.6.0 glib-2.0 >= 2.6.0 libxml-2.0 gdk-pixbuf-2.0 gthread-2.0 gmodule-2.0"
PKG_CHECK_MODULES(PANGOVERSION, pango >= 1.8.0, ,
AC_MSG_ERROR([Need Pango version 1.8.0 or higher]))
--
1.7.11.1

View File

@ -1,66 +0,0 @@
--- dia-0.97.3/configure.in
+++ dia-0.97.3/configure.in
@@ -62,43 +62,26 @@
AC_ARG_WITH(freetype,
[ --without-freetype compile without FreeType support],,with_freetype=yes)
-if test "x$with_freetype" = "xyes"; then
-PKG_CHECK_MODULES(PANGOFT2,pangoft2,have_pangoft2=true,have_pangoft2=false)
-if test "$have_pangoft2" = "true"; then
- dnl On Solaris with Forte C, at least, need to link app/dia with -lfreetype.
- dnl It's not enough that -lpangoft2 implicitly pulls it in.
- have_freetype=false
- AC_CHECK_LIB(freetype,FT_Init_FreeType,have_freetype=true,have_freetype=false,`freetype-config --libs`)
- if test "$have_freetype" = "true"; then
- dnl Need 2.0.9, as a bug was fixed for us there.
- dnl However, freetype-config doesn't give a meaningful version, so we must
- dnl do it like this.
- AC_MSG_CHECKING([if FreeType version is 2.0.9 or higher])
- old_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS `freetype-config --cflags`"
- AC_TRY_CPP([#include <ft2build.h>
-#include FT_FREETYPE_H
-#if (FREETYPE_MAJOR*1000+FREETYPE_MINOR)*1000+FREETYPE_PATCH < 2000009
-#error Freetype version too low.
-#endif
-],
- [AC_MSG_RESULT(yes)
- FREETYPE_LIBS=`freetype-config --libs`
- AC_SUBST(FREETYPE_LIBS)
- FREETYPE_CFLAGS=`freetype-config --cflags`
- AC_SUBST(FREETYPE_CFLAGS)
- GTK_MODULES="$GTK_MODULES pangoft2"
- AC_DEFINE(HAVE_FREETYPE,1,[Define if you have the FreeType2 library])]
- ,
- [AC_MSG_ERROR([Need FreeType library version 2.0.9 or higher])])
- CPPFLAGS="$old_CPPFLAGS"
- else
- AC_MSG_ERROR(Can't find FreeType library)
- fi
-else
- AC_MSG_ERROR(Can't find PangoFT2 library)
-fi
-fi
+AS_IF([test "x$with_freetype" = "xyes"],[
+ dnl freetype2.pc uses the libtool specific version number and not the
+ dnl package version. See
+ dnl https://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/VERSIONS.TXT
+ dnl Let's raise minimum dependency to freetype-2.4.0 because that's the
+ dnl lowest freetype libtool version I could find.
+ dnl freetype-2.4.0 is from July 2010 and should be reasonably old
+ dnl enough.
+ PKG_CHECK_MODULES(FREETYPE, freetype2 >= 11.0.5,
+ [
+ CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
+ AC_DEFINE(HAVE_FREETYPE,1,[Define if you have the FreeType2 library])
+ ],
+ AC_MSG_ERROR([Need FreeType library version 2.4.0 or higher])
+ )
+ PKG_CHECK_MODULES(PANGOFT2,pangoft2,
+ GTK_MODULES="$GTK_MODULES pangoft2",
+ AC_MSG_ERROR(Can't find PangoFT2 library)
+ )
+])
AM_CONDITIONAL(WITH_FREETYPE, test "x$with_freetype" != "xno")
CFLAGS="$FREETYPE_CFLAGS $CFLAGS"