Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new package diagnostic/glances #9591

Open
wants to merge 1 commit into
base: oi/hipster
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions components/sysutils/glances/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#

#
# Copyright 2022, Benny Lyons
#

BUILD_BITS=NO_ARCH
BUILD_STYLE=setup.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmm. This seems to be a nice candidate for python-integrate-project integration. Did you try to integrate using $WS_TOOLS/python-integrate-project Glances? It might be a bit harder to create the first integration, but all future maintenance and upgrades would be far far easier.



include ../../../make-rules/shared-macros.mk

COMPONENT_NAME= glances
COMPONENT_VERSION= 3.2.7
COMPONENT_SUMMARY= Monitoring system resources
COMPONENT_FMRI= diagnostic/glances
COMPONENT_CLASSIFICATION=Applications/System Utilities
COMPONENT_PROJECT_URL= https://github.com/nicolargo/glances
COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
COMPONENT_ARCHIVE_HASH= \
sha256:8eee819667b39e20f8ba3881dbe5c148146baf2da880a78e5ed184a8f790abd0
COMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)/archive/refs/tags/v$(COMPONENT_VERSION).tar.gz
#https://github.com/nicolargo/glances/archive/refs/tags/v3.2.7.tar.gz
#COMPONENT_ARCHIVE_URL=$(call pypi_url)
COMPONENT_LICENSE= LGPL-3.0-only
COMPONENT_LICENSE_FILE=$(COMPONENT_SRC)/LICENSES/LGPL-3.0-only.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you do not need the $(COMPONENT_SRC)/ part here.

#PYTHON_VERSIONS= $(PYTHON3_VERSIONS)
PYTHON_VERSIONS= 3.9
PYTHON_VERSION= 3.9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the build process will produce same results even with the above three lines removed. If so, then please remove them. If not, then please share the differences.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need either PYTHON_VERSIONS or PYTHON_VERSION, as I obtain this:
...>gmake env-prep
...
pkg install: No matching version of library/python/importlib-metadata-37 can be installed:
Reject: pkg://openindiana.org/library/python/[email protected]
...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because you have library/python/importlib-metadata in PYTHON_REQUIRED_PACKAGES. I'm curious how it appeared there. It should list library/python/importlib_metadata instead. Is your system up-to-date?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the output of "pkg info userland-incorporation". The latest is FMRI: pkg://openindiana.org/consolidation/userland/[email protected]:20221021T131054Z from a few minutes ago. It shouldn't be much older.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i had to update, am now at
FMRI: pkg://openindiana.org/consolidation/userland/[email protected]:20221021T131054Z
which is just a few hours old.
Now, gmake env-prep moans:
pkg list: no packages matching the following patterns are installed:
/library/python/importlib-metadata-37
Adding required packages to build environment...
This error is resolved by including:
PYTHON_VERSIONS= 3.9

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the remove of PYTHON_VERSIONS= 3.9: There is a subtle difference between what happens with or without this: If you don't have it, there will be builds in the build folder for every python version (3.7 and 3.9 at the moment).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...> pkg list -a | grep importlib

@mebenn: Your output is strange for several reasons.

First, there is (openindiana.org) in the output so you very like have non-default/non-standard publisher setup (pkg publisher output would tell us more).

Second, it miss some lines. The expected output should be something like this:

# pkg list -a | grep importlib
library/python/importlib-metadata-27              1.5.2-2020.0.1.2           --o
library/python/importlib-metadata-35              1.5.2-2020.0.1.1           i--
library/python/importlib-metadata-37              1.5.2-2020.0.1.2           i-r
library/python/importlib-metadata-39              1.5.2-2020.0.1.2           i-r
library/python/importlib_metadata                 4.10.1-2022.0.0.0          i--
library/python/importlib_metadata-37              4.10.1-2022.0.0.0          i--
library/python/importlib_metadata-39              4.10.1-2022.0.0.0          i--
#

Third, even with your strange pkg list -a | grep importlib output I do not understand how you got library/python/importlib-metadata in PYTHON_REQUIRED_PACKAGES. Is your workspace up-to-date (git pull)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the remove of PYTHON_VERSIONS= 3.9: There is a subtle difference between what happens with or without this: If you don't have it, there will be builds in the build folder for every python version (3.7 and 3.9 at the moment).

This is valid point. Yes, you are right. But that should be the only difference (plus a bit longer build time). The resulting package should be the same. If we want to avoid that right now I believe the best way is to set PYTHON_VERSIONS = $(PYTHON_VERSION).

This is also reason why we need to order builds for various Python versions. I removed this ordering recently (mistakenly) so I'll return it back for now until some better solution is implemented.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but we have again some failing packages due to these changes. Furthermore, I found another difference (new vs. old):

< set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)-$(PYV)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)

set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)

The automatic addition of $(PYV) to package fmri could be suppressed using GENERATE_EXTRA_CMD= in component's Makefile.

BTW, I plan to implement better (and simpler) support for python components that do not need to be build for multiple pythons (like this one, or ansible, etc), but first I'd like to complete fully automatic integration of versioned python components.

OTOH, if these components (glances, ansible, and so on) are built as versioned python packages, then they would be easier to integrate now. AFAIK, versioned python packages have only one con I'm aware about: there is set of packages, instead of single package, but the main package name will stay, so no big difference for end users.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's my current env:
I'm up-to-date...
...> git log
`...
commit 774110f (upstream/oi/hipster)
Author: Marcel Telka [email protected]
Date: Fri Oct 21 06:47:57 2022 +0200

perl/B-COW: update to 0.007

...
`
i.e., my (rebase) commits are above the the commit today at 6:47, and commits below I've omitted. So update looks ok.

# pkg list -a | grep importlib library/python/importlib-metadata-27 1.5.2-2020.0.1.2 --o library/python/importlib-metadata-35 1.5.2-2020.0.1.1 i-- library/python/importlib-metadata-37 1.5.2-2020.0.1.2 i-r library/python/importlib-metadata-39 1.5.2-2020.0.1.2 i-r library/python/importlib_metadata 4.10.1-2022.0.0.0 i-- library/python/importlib_metadata-37 4.10.1-2022.0.0.0 i-- library/python/importlib_metadata-39 4.10.1-2022.0.0.0 i-- #...> uname -a
SunOS oi 5.11 illumos-ea524515bd i86pc i386 i86pc benn@oi:~/devl/oi/oi-userland/components$

I've also noticed a problem with glances-3.9 in the bin dir. I tried to resolve this by removing $(PYV) (in glances.p5m) from the fmri to obtain
set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)@....
and then coping /usr/bin/glances-3.9 to /usr/bin/glances in COMPONENT_POST_INSTALL_ACTIONS; but this is horrible.
So I still think that I require PYTHON_VERSION=3.9 to avoid different builds for different Python versions.
I'll have a look tomorrow and be on IRC if anyone happens to be about.
Cheers, thanks for the help


TEST_TARGET= $(NO_TESTS)
include $(WS_MAKE_RULES)/common.mk

PKG_MACROS += PYVER=$(PYTHON_VERSION)
# pkgdepend doesn't like the first line of a Python script to be:
# '#!/usr/bin/env python' so turn it into '#!/usr/bin/python$(PYTHON_VERSION)'
COMPONENT_POST_INSTALL_ACTION += \
$(GSED) -i -e 's?env python?python$(PYTHON_VERSION)?' \
$(PROTOUSRBINDIR)/*;

SHARE_DIR=$(PROTO_DIR)/usr/share
PIXMAPS_DIR=$(PROTOUSRSHAREDIR)/pixmaps
APPLICATIONS_DIR=$(PROTOUSRSHAREDIR)/applications

COMPONENT_POST_INSTALL_ACTION += \
$(MKDIR) -p $(PIXMAPS_DIR); \
$(CP) $(COMPONENT_SRC)/glances/outputs/static/images/glances.png $(PIXMAPS_DIR)/glances.png;
COMPONENT_POST_INSTALL_ACTION += \
$(MKDIR) -p $(PROTOUSRSHAREDIR)/applications; \
$(CP) $(COMPONENT_DIR)/glances.desktop $(PROTOUSRSHAREDIR)/applications/glances.desktop;
COMPONENT_POST_INSTALL_ACTION += \
$(MKDIR) -p $(PROTOUSRSHAREDIR)/man/man1; \
$(CP) $(COMPONENT_SRC)/docs/man/glances.1 $(PROTOUSRSHAREDIR)/man/man1/glances.1;

REQUIRED_PACKAGES += print/psutils

# Auto-generated dependencies
PYTHON_REQUIRED_PACKAGES += library/python/importlib-metadata
PYTHON_REQUIRED_PACKAGES += library/python/setuptools
PYTHON_REQUIRED_PACKAGES += runtime/python
67 changes: 67 additions & 0 deletions components/sysutils/glances/glances.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[Desktop Entry]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where this file comes from? It lacks the copyright/license header.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know much about Mate. I copied /usr/share/applications/htop.desktop to glances.desktop and configured. Now the htop package self does not contain any htop.desktop, so I assume this was generated by Mate??
It would be even easier if I could generate a .desktop for glances.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then, maybe, it would be better to do not include this file? Since Glance seems to be a terminal utility we do not need desktop file for it, IMHO.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW: This package is also a candidate as we don't want to have /usr/bin/glances-3.9

Type=Application
Version=1.0
Name=Glances
GenericName=Process Viewer
GenericName[ca]=Visualitzador de processos
GenericName[da]=Procesfremviser
GenericName[de]=Prozessanzeige
GenericName[en_GB]=Process Viewer
GenericName[es]=Visor de procesos
GenericName[fi]=Prosessikatselin
GenericName[fr]=Visualiseur de processus
GenericName[gl]=Visor de procesos
GenericName[it]=Visore dei processi
GenericName[ko]=프로세스 뷰어
GenericName[nb]=Prosessviser
GenericName[nl]=Viewer van processen
GenericName[nn]=Prosessvisar
GenericName[pl]=Przeglądarka procesów
GenericName[pt]=Visualizador de Processos
GenericName[pt_BR]=Visualizador de processos
GenericName[ru]=Монитор процессов
GenericName[sk]=Prehliadač procesov
GenericName[sl]=Pregledovalnik opravil
GenericName[sr@ijekavian]=Приказивач процеса
GenericName[sr@ijekavianlatin]=Prikazivač procesa
GenericName[sr@latin]=Prikazivač procesa
GenericName[sr]=Приказивач процеса
GenericName[sv]=Processvisning
GenericName[tr]=Süreç Görüntüleyici
GenericName[uk]=Перегляд процесів
GenericName[zh_CN]=进程查看器
GenericName[zh_TW]=行程檢視器
Comment=Show System Processes
Comment[ca]=Visualitzeu els processos del sistema
Comment[da]=Vis systemprocesser
Comment[de]=Systemprozesse anzeigen
Comment[en_GB]=Show System Processes
Comment[es]=Mostrar procesos del sistema
Comment[fi]=Katsele järjestelmän prosesseja
Comment[fr]=Affiche les processus système
Comment[gl]=Mostrar os procesos do sistema.
Comment[it]=Mostra processi di sistema
Comment[ko]=시스템 프로세스 보기
Comment[nb]=Vis systemprosesser
Comment[nl]=Systeemprocessen tonen
Comment[nn]=Vis systemprosessar
Comment[pl]=Pokaż procesy systemowe
Comment[pt]=Mostrar os Processos do Sistema
Comment[pt_BR]=Mostra os processos do sistema
Comment[ru]=Просмотр списка процессов в системе
Comment[sk]=Zobraziť systémové procesy
Comment[sl]=Prikaz sistemskih opravil
Comment[sr@ijekavian]=Приказ системских процеса
Comment[sr@ijekavianlatin]=Prikaz sistemskih procesa
Comment[sr@latin]=Prikaz sistemskih procesa
Comment[sr]=Приказ системских процеса
Comment[sv]=Visa systemprocesser
Comment[tr]=Sistem Süreçlerini Göster
Comment[uk]=Перегляд системних процесів
Comment[zh_CN]=显示系统进程
Comment[zh_TW]=顯示系統行程
Icon=glances
Exec=glances
Terminal=true
Categories=System;Monitor;ConsoleOnly;
Keywords=system;process;task
Loading