Skip to content

Commit

Permalink
bmpanel2: Add Python 3 support.
Browse files Browse the repository at this point in the history
Also use CMAKE_INSTALL_MANDIR so the man page gets installed properly.
  • Loading branch information
alarixnia committed Sep 6, 2022
1 parent 1fc6f3c commit b81f3c0
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 14 deletions.
18 changes: 8 additions & 10 deletions wm/bmpanel2/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.45 2022/06/30 11:18:56 nia Exp $
# $NetBSD: Makefile,v 1.46 2022/09/06 09:26:27 nia Exp $

DISTNAME= bmpanel2-2.1pre1
PKGREVISION= 31
PKGREVISION= 32
CATEGORIES= wm sysutils
MASTER_SITES= http://bmpanel2.googlecode.com/files/

Expand All @@ -10,15 +10,16 @@ HOMEPAGE= https://github.com/nsf/bmpanel2
COMMENT= NETWM-compatible panel for X11
LICENSE= mit

BUILD_DEPENDS+= asciidoc-[0-9]*:../../textproc/asciidoc
TOOL_DEPENDS+= asciidoc-[0-9]*:../../textproc/asciidoc

USE_CMAKE= yes
USE_LANGUAGES= c c++
USE_TOOLS+= pkg-config gzip
USE_TOOLS+= pkg-config

REPLACE_PYTHON= extra/py/bmpanel2.py
PYTHON_VERSIONS_ACCEPTED= 27 # not yet ported as of 2.1pre1
PY_PATCHPLIST= yes
PYDISTUTILSPKG= no

EGG_NAME= bmpanel2cfg-1.0

INSTALLATION_DIRS+= ${PKGMANDIR}/man1

Expand All @@ -28,13 +29,10 @@ SUBST_FILES.prefix= xdg.c
SUBST_STAGE.prefix= post-extract
SUBST_MESSAGE.prefix= Fixing path to themes.

post-install:
${MV} ${DESTDIR}${PREFIX}/share/man/man1/* ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1

.include "../../devel/glib2/buildlink3.mk"
.include "../../devel/pango/buildlink3.mk"
.include "../../lang/python/application.mk"
.include "../../lang/python/extension.mk"
.include "../../lang/python/egg.mk"
.include "../../graphics/cairo/buildlink3.mk"
.include "../../x11/libX11/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
9 changes: 6 additions & 3 deletions wm/bmpanel2/PLIST
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
@comment $NetBSD: PLIST,v 1.3 2022/03/25 11:33:44 wiz Exp $
@comment $NetBSD: PLIST,v 1.4 2022/09/06 09:26:27 nia Exp $
bin/bmpanel2
bin/bmpanel2cfg
${PYSITELIB}/bmpanel2.py
${PYSITELIB}/bmpanel2.pyc
${PYSITELIB}/bmpanel2cfg-1.0-py2.7.egg-info
man/man1/bmpanel2.1
${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt
${PYSITELIB}/${EGG_INFODIR}/top_level.txt
@comment man/man1/bmpanel2.1
share/bmpanel2/themes/alduin-glossy/default_icon.png
share/bmpanel2/themes/alduin-glossy/launchbar-arrow.png
share/bmpanel2/themes/alduin-glossy/tb-left-active-hover.png
Expand Down
4 changes: 3 additions & 1 deletion wm/bmpanel2/distinfo
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
$NetBSD: distinfo,v 1.5 2021/10/26 11:25:10 nia Exp $
$NetBSD: distinfo,v 1.6 2022/09/06 09:26:27 nia Exp $

BLAKE2s (bmpanel2-2.1pre1.tar.gz) = d476b095b853c2c75ea7d82ee8919f28a1b164dc14987d9eb1741066c7a57670
SHA512 (bmpanel2-2.1pre1.tar.gz) = 8c1a4c64b25c04c6858407e8887f35f54d8b9e8e8b5b5c633258467afee77598157dfe3ef957ab7e5358b4a4bb0360032e711aa6cdb825a6e42ea2e5d97f97ef
Size (bmpanel2-2.1pre1.tar.gz) = 386297 bytes
SHA1 (patch-extra_py_bmpanel2.py) = 335bb0fe65930f82efdb7759d06ffa9f2cd0bf61
SHA1 (patch-man_CMakeLists.txt) = a95f82aebf42d31311e5d7bf42d9367253b246e2
SHA1 (patch-widget-utils.c) = 00ee1d8bb3c5a7c5b8fc6e7994472ce26e318285
17 changes: 17 additions & 0 deletions wm/bmpanel2/patches/patch-extra_py_bmpanel2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$NetBSD: patch-extra_py_bmpanel2.py,v 1.1 2022/09/06 09:26:27 nia Exp $

Python 3 fix.

https://github.com/SpartanJ/bmpanel2/commit/9d67757d915c7b707cc48a50c8cf97aa7c7a3513

--- extra/py/bmpanel2.py.orig 2022-09-06 08:51:15.418160728 +0000
+++ extra/py/bmpanel2.py
@@ -140,7 +140,7 @@ class ConfigNode:
for c in self.children:
if c.name == item:
return c
- raise KeyError, item
+ raise KeyError

#----------------------------------------------------------------------
# ConfigFormat
33 changes: 33 additions & 0 deletions wm/bmpanel2/patches/patch-man_CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
$NetBSD: patch-man_CMakeLists.txt,v 1.1 2022/09/06 09:26:27 nia Exp $

Install man page to CMAKE_INSTALL_MANDIR.
Do not use gzip.

--- man/CMakeLists.txt.orig 2009-11-01 05:50:26.000000000 +0000
+++ man/CMakeLists.txt
@@ -1,18 +1,17 @@
IF(BMPANEL2_FEATURE_MANPAGE)
+ INCLUDE(GNUInstallDirs)
FIND_PROGRAM(A2X a2x)
- FIND_PROGRAM(GZIP gzip)
- IF(A2X AND GZIP)
+ IF(A2X)
SET(ASCIIDOC_OPTS -f ${CMAKE_CURRENT_SOURCE_DIR}/asciidoc.conf -a man_version="${BMPANEL_VERSION}")
SET(A2X_OPTS -D ${CMAKE_CURRENT_BINARY_DIR} -d manpage -f manpage)
SET(MAN_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/bmpanel2.txt)
ADD_CUSTOM_COMMAND(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/bmpanel2.1.gz
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/bmpanel2.1
COMMAND ${A2X} ${A2X_OPTS} --asciidoc-opts="${ASCIIDOC_OPTS}" ${MAN_SOURCE}
- COMMAND ${GZIP} -f ${CMAKE_CURRENT_BINARY_DIR}/bmpanel2.1
DEPENDS asciidoc.conf bmpanel2.txt
)
- ADD_CUSTOM_TARGET(manpage ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/bmpanel2.1.gz)
- INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/bmpanel2.1.gz
- DESTINATION share/man/man1)
- ENDIF(A2X AND GZIP)
+ ADD_CUSTOM_TARGET(manpage ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/bmpanel2.1)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/bmpanel2.1
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
+ ENDIF(A2X)
ENDIF(BMPANEL2_FEATURE_MANPAGE)

0 comments on commit b81f3c0

Please sign in to comment.