• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Solved Polybar: I want to give it a try.

lebarondemerde

Daemon

Thanks: 508
Best answers: 1
Messages: 1,167

#1
Hi!

There is this very nice bar called Polybar. It currently does not build in FreeBSD but someone already gave some HINTS on how to make it possible:

Code:
Adding an #ifdef _FreeBSD_ for sys/endian.h statement.

Disabling -Werror and pedantic errors, I guess the author uses gcc and clang has different/additional warnings and errors.

Add the _WITH_DPRINTF define for dprintf, see https://reviews.freebsd.org/D6302 (I imagine this won't be an issue with FreeBSD 12.0-CURRENT.
However, the biggest problem is Polybar needs Linux inotify, but I would like to try to build it against devel/libinotify to see if it would work.

While there are those hints, I do not code and I do not know how implement them. So, I need some helping hand with that!

If everything end well I would probably port it. :)

Thanks!
 

tobik@

Daemon
Developer

Thanks: 1,280
Best answers: 1
Messages: 1,864

#2
This is completely untested, but adding querylib(WITH_LIBINOTIFY "pkg-config" libinotify libs dirs) to cmake/03-libs.cmake and option(WITH_LIBINOTIFY "libinotify support" ON) to cmake/02-opts.cmake will probably help in linking with libinotify.
 

tobik@

Daemon
Developer

Thanks: 1,280
Best answers: 1
Messages: 1,864

#6
I have not build tested it, but here is a short review anyway if anyone wants to pick it up.

jaagr:${PORTNAME}:${PORTVERSION}
No, just set GH_ACCOUNT=jaagr instead.

PORTVERSION= 3.0.5
The Porter's Handbook recommends using DISTVERSION instead.

CATEGORIES= multimedia
Why not x11? That's where other bars are categorized in as well.

ALSA_CMAKE_ON= -DENABLE_ALSA:BOOL=ON
ALSA_CMAKE_OFF= -DENABLE_ALSA:BOOL=OFF
This can be replaced with ALSA_CMAKE_BOOL= ENABLE_ALSA. Same for all the other *_CMAKE_* variables.

I3_BUILD_DEPENDS= i3:x11-wm/i3
This looks odd. I doubt the build calls i3 during the build? What is the real build dependency here? Does it need a header from x11-wm/i3? Maybe it should be ${LOCALBASE}/include/i3/ipc.h:x11-wm/i3 instead?

CXXFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
Add localbase:ldflags to USES instead.

share/man/man1/polybar.1
This is wrong. The man page should be installed in man/man1/ instead.

Other things:
  • Is pkgconfig missing from USES?
  • Please sort the options helpers like you sorted them in OPTIONS_DEFINE
  • In patch-cmake_01-core.cmake you forgot to remove -O2 as well.
  • I think the ALSA option needs a run dependency on audio/alsa-plugins as well for the OSS plugin. Why does polybar even need ALSA? AFAICT it's just for getting mixer volumes. It would probably be relatively easy to code up an OSS backend for this.
 

thebardian

Member

Thanks: 26
Messages: 26

#8
Just dropping by to express I too am interested in using polybar, I rep freebsd over on /r/unixporn and it would be helpful to have this. It is things like polybar not being available that [i believe] prevents many linux desktop tweakers from trying out bsd in favor of other linux distros like arch and gentoo. Good news though is we recently have audio/cava in ports!
 

capt_redbeard

New Member

Thanks: 7
Messages: 8

#9
Hello all!

I am new to the FreeBSD community. I have made an attempt at porting Polybar to work with FreeBSD. This is my first port, so I am happy to receive and constructive feedback and how to improve it, or if anything needs fixing.

Currently, the bar itself works. However, some of the modules are broken as they depend on Linuxisms, or just need some tweaking to work with FreeBSD. Hopefully we can get these changes merged upstream into Polybar itself!

Please let me know if I can help, or how I can improve the port. Hopefully we can get it committed soon enough!

https://github.com/kylecook80/polybar-port
 

lebarondemerde

Daemon

Thanks: 508
Best answers: 1
Messages: 1,167

#10
Hi.

Unfortunately I do not have how to build it now, but the quick look I did on the port I saw some lines out of the standards. :)

I will not make a detailed post because I am out of time right now (and I am not an expert either) but you can always check the port using: make stage-qa (or add DEVELOPER=yes to make.conf, and run the normal make stage) + ports-mgmt/portlint.

If you use ports-mgmt/synth or ports-mgmt/poudriere you can use any of them to make more tests to the port.

synth test cat/port
poudriere testport -j jail cat/port

As alternative to synth/ poudriere testing capabilities you can use ports-mgmt/porttools (what have ports-mgmt/portlint as dependency).

BTW: I think x11 is a better category to Polybar than x11-wm.

Thanks! :D
 

capt_redbeard

New Member

Thanks: 7
Messages: 8

#11
Hi.

Unfortunately I do not have how to build it now, but the quick look I did on the port I saw some lines out of the standards. :)

I will not make a detailed post because I am out of time right now (and I am not an expert either) but you can always check the port using: make stage-qa (or add DEVELOPER=yes to make.conf, and run the normal make stage) + ports-mgmt/portlint.

If you use ports-mgmt/synth or ports-mgmt/poudriere you can use any of them to make more tests to the port.

synth test cat/port
poudriere testport -j jail cat/port

As alternative to synth/ poudriere testing capabilities you can use ports-mgmt/porttools (what have ports-mgmt/portlint as dependency).

BTW: I think x11 is a better category to Polybar than x11-wm.

Thanks! :D
Thank you for help! I will use these tools to improve the port. :)
 

lebarondemerde

Daemon

Thanks: 508
Best answers: 1
Messages: 1,167

#13
Please run poudriere testport. I am getting some errors while testing:

Code:
CMake Error at /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Call Stack (most recent call first):
  /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:377 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/share/cmake/Modules/FindPkgConfig.cmake:36 (find_package_handle_standard_args)
  cmake/common/utils.cmake:255 (find_package)
  cmake/02-opts.cmake:5 (checklib)
  CMakeLists.txt:16 (include)
PS. I did a PR with minor things,

Thanks! :)
 

lebarondemerde

Daemon

Thanks: 508
Best answers: 1
Messages: 1,167

#14
While toying with capt_redbeard port I found a missing dependency: x11/xcb-proto.

The point is, I can't get the port to work with that dependency stated in it, why?

If I add it to {RUN,BUILD}_DEPENDS make simple does not even try to build it if it is not installed, and give this error:

Code:
Package 'xcb-proto', required by 'virtual:world', not found
If already installed make try to build it but give an error because it is already installed.

The other point is Polybar trying to find xcb-render, xcb-damage, xcb-sync, xcb-composite. They are in there already but not found. I think Polybar does need some patches to be able to find them. :)

EDIT: tobik@

x11-wm/i3 actually seem to be needed to build the i3 module (or the IPC one, not sure yet).

Thanks!
 

capt_redbeard

New Member

Thanks: 7
Messages: 8

#15
Hmm interesting. So I am able to build the port successfully locally, just not with a clean slate yet (hence, the missing dependency issue). I am getting that sorted right now, I'll post back whenever I get a successful build in poudriere.
 

capt_redbeard

New Member

Thanks: 7
Messages: 8

#20
I have fixed the dependency issues! The makefile also now has options. I was able to test the port using poudriere and portlint and everything checks out. Let me know of any other issues that may be a problem.
 

lebarondemerde

Daemon

Thanks: 508
Best answers: 1
Messages: 1,167

#21
Hi!

Assuming you want maintain the port, you could add that to the Phabricator.

You would need to add the port to your local ports tree, modify /usr/ports/x11/Makefile and add polybar in there (in alphabetic order), later provide a diff with both.

If you prefer to use GitHub, you would need to fork the FreeBSD ports tree mirror (what is read only) to do that, otherwise you could use your ports tree if you use subversion.

It is easier to do using devel/arcanist. Example: arc diff --create x11/Makefile x11/polybar.

Thanks!
 
Top