summaryrefslogtreecommitdiffstats
path: root/utils/kmscon/Makefile
blob: bd57c8378bbbbfd75910e763776f4cb7c6160915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
include $(TOPDIR)/rules.mk

PKG_NAME:=kmscon
PKG_VERSION:=10.0.3
PKG_RELEASE:=6

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/kmscon/kmscon/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=4a0552d3cd3ba16df4fcff61f2b1431650bcd9e7ecabc03625ce52345b9c95c5

PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=COPYING

PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=kmscon/host

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/meson.mk

PKG_CONFIG_DEPENDS:= \
	CONFIG_PACKAGE_kmscon-mod-gl \
	CONFIG_PACKAGE_kmscon-mod-unifont

MESON_ARGS += \
	-Dtests=false \
	-Ddocs=disabled \
	-Dlibseat=enabled \
	-Ddbus=disabled \
	-Dvideo_fbdev=disabled \
	-Dvideo_drm2d=enabled \
	-Dfont_psf=enabled \
	-Dfont_freetype=disabled \
	-Dfont_pango=disabled

ifdef CONFIG_PACKAGE_kmscon-mod-unifont
MESON_ARGS += -Dfont_unifont=enabled
else
MESON_ARGS += -Dfont_unifont=disabled
endif

ifdef CONFIG_PACKAGE_kmscon-mod-gl
MESON_ARGS += \
	-Dvideo_drm3d=enabled \
	-Drenderer_gltex=enabled
else
MESON_ARGS += \
	-Dvideo_drm3d=disabled \
	-Drenderer_gltex=disabled
endif

define Host/Configure
endef

define Host/Compile
	$(HOSTCC) $(HOST_CFLAGS) $(HOST_CPPFLAGS) \
		-o $(HOST_BUILD_DIR)/genunifont \
		$(HOST_BUILD_DIR)/src/font/genunifont.c $(HOST_LDFLAGS) -lz
endef

define Host/Install
	$(INSTALL_DIR) $(HOST_BUILD_PREFIX)/bin
	$(INSTALL_BIN) $(HOST_BUILD_DIR)/genunifont $(HOST_BUILD_PREFIX)/bin/
endef

define Host/Uninstall
	rm -f $(HOST_BUILD_PREFIX)/bin/genunifont
endef

define Package/kmscon
  SECTION:=utils
  CATEGORY:=Utilities
  TITLE:=Terminal emulator on a KMS device
  URL:=https://github.com/kmscon/kmscon
  DEPENDS:=input-support +kmod-input-evdev +libtsm +libxkbcommon +libudev \
	+libdrm +zlib +xkeyboard-config +libseat +seatd
endef

define Package/kmscon/description
  A terminal emulator that draws directly on a DRM/KMS device, so a
  system needs no framebuffer console to have a text console. Draws in
  software on the KMS device; install kmscon-mod-gl for the OpenGL ES
  path. The built-in font renders ASCII only; install
  kmscon-mod-unifont for the rest of Unicode.
endef

define Package/kmscon-mod-gl
  SECTION:=utils
  CATEGORY:=Utilities
  TITLE:=OpenGL ES rendering for kmscon
  URL:=https://github.com/kmscon/kmscon
  DEPENDS:=kmscon +libmesa
endef

define Package/kmscon-mod-gl/description
  The drm3d video backend and the gltex renderer, which draw through
  OpenGL ES instead of in software. kmscon loads them if they are
  present and uses them only when started with --hwaccel. Worth
  installing on a system that carries Mesa anyway.
endef

define Package/kmscon-mod-unifont
  SECTION:=utils
  CATEGORY:=Utilities
  TITLE:=GNU Unifont font engine for kmscon
  URL:=https://github.com/kmscon/kmscon
  LICENSE:=MIT OFL-1.1
  DEPENDS:=kmscon
endef

define Package/kmscon-mod-unifont/description
  A font engine carrying GNU Unifont, a bitmap font covering the Basic
  Multilingual Plane, so box drawing, symbols and wide characters are
  drawn instead of replaced. kmscon picks it when no font engine is
  configured.
endef

define Package/kmscon/conffiles
/etc/config/kmscon
endef

define Package/kmscon/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/kmscon $(1)/usr/bin/
	$(INSTALL_DIR) $(1)/usr/lib/kmscon
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/kmscon/mod-psf.so $(1)/usr/lib/kmscon/
	$(INSTALL_DIR) $(1)/etc/config
	$(INSTALL_DATA) ./files/kmscon.config $(1)/etc/config/kmscon
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) ./files/kmscon.init $(1)/etc/init.d/kmscon
endef

define Package/kmscon-mod-gl/install
	$(INSTALL_DIR) $(1)/usr/lib/kmscon
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/kmscon/mod-drm3d.so $(1)/usr/lib/kmscon/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/kmscon/mod-gltex.so $(1)/usr/lib/kmscon/
endef

define Package/kmscon-mod-unifont/install
	$(INSTALL_DIR) $(1)/usr/lib/kmscon
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/kmscon/mod-unifont.so $(1)/usr/lib/kmscon/
endef

$(eval $(call HostBuild))
$(eval $(call BuildPackage,kmscon))
$(eval $(call BuildPackage,kmscon-mod-gl))
$(eval $(call BuildPackage,kmscon-mod-unifont))