2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"). You may
4 # only use this file in accordance with the terms of the CDDL.
6 # A full copy of the text of the CDDL should have accompanied this
7 # source. A copy of the CDDL is also available via the Internet at
8 # http://www.illumos.org/license/CDDL.
12 # Copyright 2019 Michal Nowak
13 # Copyright 2021 Nona Hansel
16 %patch% 01-test-disable-failing.patch
19 # This project is not on PyPI so we need to provide all info here.
20 # See also https://github.com/powerline/powerline/issues/2116
22 HOMEPAGE='https://github.com/powerline/powerline/'
23 DOWNLOAD_URL='https://github.com/powerline/powerline/archive/refs/tags/$(HUMAN_VERSION).tar.gz'
24 SUMMARY='The ultimate statusline/prompt utility'
27 COMPONENT_FMRI = python/powerline
29 # Manifest options for python/powerline-vim package
30 COMPONENT_FMRI.powerline-vim = $(COMPONENT_FMRI)-vim
31 COMPONENT_SUMMARY.powerline-vim = $(COMPONENT_SUMMARY) - Vim editor binding
32 COMPONENT_CLASSIFICATION.powerline-vim = System/Text Tools
34 # This is a standalone application. Since no other Python project depends on
35 # it we just provide single unversioned package.
36 SINGLE_PYTHON_VERSION = yes
38 # Needed for connect() and socket()
39 CFLAGS += -lsocket -lnsl
41 # Make sure compiled binaries are installed at proper location
42 PYTHON_DATA = $(USRDIR)
44 # Adjust powerline configuration for our location of bindings
45 COMPONENT_PREP_ACTION= \
46 $(GSED) -i -e "/TMUX_CONFIG_DIRECTORY/ s@BINDINGS_DIRECTORY@'/usr/share/powerline'@" $(SOURCE_DIR)/powerline/config.py
48 # Move bindings where we want them
49 PROTOUSRLIBPOWERLINE= $(PROTOUSRLIBDIR)/python$(PYTHON_VERSION)/vendor-packages/powerline
50 PROTOUSRSHAREPOWERLINEDIR= $(PROTOUSRSHAREDIR)/powerline/
51 PROTOUSRSHAREVIM= $(PROTOUSRSHAREDIR)/vim/vimfiles/powerline/
52 COMPONENT_POST_INSTALL_ACTION += \
53 $(MKDIR) $(PROTOUSRSHAREPOWERLINEDIR){,awesome,bash,fish,shell,tcsh,tmux,zsh} ; \
54 for file in awesome/powerline.lua \
56 fish/powerline-setup.fish \
59 tmux/powerline-base.conf \
61 tmux/powerline_tmux_1.7_plus.conf \
62 tmux/powerline_tmux_1.8.conf \
63 tmux/powerline_tmux_1.8_minus.conf \
64 tmux/powerline_tmux_1.8_plus.conf \
65 tmux/powerline_tmux_1.9_plus.conf \
66 tmux/powerline_tmux_2.1_plus.conf \
69 $(MV) $(PROTOUSRLIBPOWERLINE)/bindings/$$file $(PROTOUSRSHAREPOWERLINEDIR)/$$file; \
71 $(MKDIR) $(PROTOUSRSHAREVIM) ; \
72 $(MV) $(PROTOUSRLIBPOWERLINE)/bindings/vim/autoload/powerline/debug.vim $(PROTOUSRSHAREVIM) ; \
73 $(MV) $(PROTOUSRLIBPOWERLINE)/bindings/vim/plugin/powerline.vim $(PROTOUSRSHAREVIM) ;
75 # Remove files we do not need
76 COMPONENT_POST_INSTALL_ACTION += \
77 ( cd $(PROTOUSRLIBPOWERLINE) ; $(RM) \
78 bindings/bar/powerline-bar.py \
79 bindings/lemonbar/powerline-lemonbar.py \
80 commands/lemonbar.py \
81 dist/systemd/powerline-daemon.service \
83 renderers/lemonbar.py \
86 # Testing needs TEST_ROOT and HOME environment variables (the directory does
88 COMPONENT_TEST_ENV += TEST_ROOT="$(@D)/.test_home"
89 COMPONENT_TEST_ENV += HOME="$(@D)/.test_home"
91 # Create manifest for python/powerline-vim package
92 cat "$WS_TOP/transforms/manifest-metadata-template" \
93 | sed -e 's/^#.*Copyright.*<contributor>.*$/# This file was automatically generated using '"$THIS"'/g' \
94 > "$DISTRIBUTION-vim.p5m"
95 cat <<-"EOF" >> "$DISTRIBUTION-vim.p5m"
96 # This binding needs Vim to be functional
97 depend type=require fmri=editor/vim
99 file path=usr/share/vim/vimfiles/powerline/debug.vim
100 file path=usr/share/vim/vimfiles/powerline/powerline.vim
102 # Remove vim files from base manifest
103 sed -i -e '/vimfiles/d' "$MANIFEST"
104 # Make shell files executable
105 printf '<transform file path=usr/share/powerline/.*sh$ -> default mode 0555>\n' >> "$MANIFEST"
106 MANIFEST="$MANIFEST $DISTRIBUTION-vim.p5m"