Saturday, February 27, 2021

switch compiz from pyrex to cython

Is anyone actually using x11/compiz?

In the below diff we switch from pyrex to cython to build the .pyx file.
The main goal is to retire pyrex and compiz is the last consumer.

The diff:
- patches the autoconf infrastructure to look for cython instead of
pyrex
- switches CONFIGURE_STYLE from gnu to autoreconf
- fixes the one cython compile problem, and
- regenerates plist

ok?

Index: compizconfig-python/Makefile
===================================================================
RCS file: /cvs/ports/x11/compiz/compizconfig-python/Makefile,v
retrieving revision 1.5
diff -u -p -u -r1.5 Makefile
--- compizconfig-python/Makefile 23 Feb 2021 19:39:49 -0000 1.5
+++ compizconfig-python/Makefile 28 Feb 2021 02:25:59 -0000
@@ -3,7 +3,7 @@
COMMENT = compiz configuration system bindings

DISTNAME = compizconfig-python-0.8.4
-REVISION = 2
+REVISION = 3

MASTER_SITES = http://releases.compiz.org/components/compizconfig-python/

@@ -16,14 +16,17 @@ LIB_DEPENDS = x11/compiz/libcompizconfig
MODULES = lang/python
MODPY_VERSION = ${MODPY_DEFAULT_VERSION_2}

-BUILD_DEPENDS = devel/pyrex
+BUILD_DEPENDS = lang/cython${MODPY_FLAVOR}

LIBTOOL_FLAGS = --tag=disable-static

-CONFIGURE_STYLE = gnu
+AUTOCONF_VERSION = 2.63
+AUTOMAKE_VERSION = 1.12
+CONFIGURE_STYLE = autoreconf

pre-patch:
@ln -s ${MODPY_BIN} ${WRKDIR}/bin/python
+ @ln -s ${LOCALBASE}/bin/cython${MODPY_BIN_SUFFIX} ${WRKDIR}/bin/cython

pre-build:
@rm -f ${WRKSRC}/src/compizconfig.c
Index: compizconfig-python/patches/patch-configure_ac
===================================================================
RCS file: compizconfig-python/patches/patch-configure_ac
diff -N compizconfig-python/patches/patch-configure_ac
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ compizconfig-python/patches/patch-configure_ac 28 Feb 2021 02:25:59 -0000
@@ -0,0 +1,18 @@
+$OpenBSD$
+
+Index: configure.ac
+--- configure.ac.orig
++++ configure.ac
+@@ -31,10 +31,10 @@ else
+ AM_PATH_PYTHON_VERSION(2.5,2.5.0)
+ fi
+
+-AC_CHECK_PROGS(PYREX, pyrexc)
++AC_CHECK_PROGS(PYREX, cython)
+ if test -z "$PYREX"
+ then
+- AC_MSG_ERROR([Couldn't find Pyrex])
++ AC_MSG_ERROR([Couldn't find Cython])
+ fi
+
+ AC_CONFIG_FILES([
Index: compizconfig-python/patches/patch-src_Makefile_am
===================================================================
RCS file: compizconfig-python/patches/patch-src_Makefile_am
diff -N compizconfig-python/patches/patch-src_Makefile_am
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ compizconfig-python/patches/patch-src_Makefile_am 28 Feb 2021 02:25:59 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: src/Makefile.am
+--- src/Makefile.am.orig
++++ src/Makefile.am
+@@ -3,7 +3,7 @@ INCLUDES=\
+ @CCS_CFLAGS@
+
+ compizconfig.c: compizconfig.pyx
+- -pyrexc compizconfig.pyx
++ -cython compizconfig.pyx
+
+ compizconfig_la_LDFLAGS = -module -avoid-version -fPIC -export-symbols-regex initcompizconfig -lX11
+ compizconfig_la_LIBADD = @CCS_LIBS@
Index: compizconfig-python/patches/patch-src_compizconfig_pyx
===================================================================
RCS file: /cvs/ports/x11/compiz/compizconfig-python/patches/patch-src_compizconfig_pyx,v
retrieving revision 1.1
diff -u -p -u -r1.1 patch-src_compizconfig_pyx
--- compizconfig-python/patches/patch-src_compizconfig_pyx 3 Dec 2013 00:51:19 -0000 1.1
+++ compizconfig-python/patches/patch-src_compizconfig_pyx 28 Feb 2021 02:25:59 -0000
@@ -1,6 +1,7 @@
$OpenBSD: patch-src_compizconfig_pyx,v 1.1 2013/12/03 00:51:19 fgsch Exp $
---- src/compizconfig.pyx.orig Mon Feb 25 00:32:45 2013
-+++ src/compizconfig.pyx Mon Feb 25 00:33:08 2013
+Index: src/compizconfig.pyx
+--- src/compizconfig.pyx.orig
++++ src/compizconfig.pyx
@@ -583,7 +583,7 @@ cdef class Setting:
cdef object extendedStrRestrictions
cdef object baseStrRestrictions
@@ -10,6 +11,15 @@ $OpenBSD: patch-src_compizconfig_pyx,v 1
cdef CCSSettingType t
cdef CCSSettingInfo * i

+@@ -653,7 +653,7 @@ cdef class Setting:
+
+ property Hints:
+ def __get__ (self):
+- if self.ccsSetting.hints == '':
++ if not self.ccsSetting.hints:
+ return []
+ else:
+ return str (self.ccsSetting.hints).split (";")[:-1]
@@ -689,7 +689,7 @@ cdef class SSGroup:
cdef object display
cdef object screens
Index: compizconfig-python/pkg/PLIST
===================================================================
RCS file: /cvs/ports/x11/compiz/compizconfig-python/pkg/PLIST,v
retrieving revision 1.1
diff -u -p -u -r1.1 PLIST
--- compizconfig-python/pkg/PLIST 3 Dec 2013 00:51:19 -0000 1.1
+++ compizconfig-python/pkg/PLIST 28 Feb 2021 02:25:59 -0000
@@ -1,3 +1,3 @@
@comment $OpenBSD: PLIST,v 1.1 2013/12/03 00:51:19 fgsch Exp $
lib/pkgconfig/compizconfig-python.pc
-lib/python${MODPY_VERSION}/site-packages/compizconfig.so
+@so lib/python${MODPY_VERSION}/site-packages/compizconfig.so

No comments:

Post a Comment