blob: 74f757af0d87c77a4f5257d37a3a5e6ab1e0a05a (
plain) (
blame)
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
|
PORTNAME= hyprland
DISTVERSIONPREFIX= v
DISTVERSION= 0.40.0
PORTREVISION= 3
CATEGORIES= x11-wm wayland
PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
PATCHFILES+= ec092bd601d9.patch:-p1 # hyprwayland-scanner 0.3.5
MAINTAINER= jbeich@FreeBSD.org
COMMENT= Dynamic tiling Wayland compositor that doesn't sacrifice on its looks #'
WWW= https://hyprland.org/
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= evdev-proto>0:devel/evdev-proto \
hyprwayland-scanner>=0.3.5:devel/hyprwayland-scanner \
wayland-protocols>=1.35:graphics/wayland-protocols
LIB_DEPENDS= libhyprlang.so:devel/hyprlang \
libtomlplusplus.so:devel/tomlplusplus \
libdrm.so:graphics/libdrm \
libwayland-server.so:graphics/wayland \
libuuid.so:misc/e2fsprogs-libuuid \
libwlroots-${PORTNAME}.so:x11-toolkits/wlroots-${PORTNAME} \
libhyprcursor.so:x11/hyprcursor \
libinput.so:x11/libinput \
libxkbcommon.so:x11/libxkbcommon
USES= cmake:indirect compiler:c++11-lib gl gnome meson pkgconfig xorg
USE_GITHUB= yes
USE_GL= egl opengl
USE_GNOME= cairo pango
USE_XORG= pixman
GH_ACCOUNT= hyprwm
GH_PROJECT= Hyprland
GH_TUPLE= hyprwm:hyprland-protocols:v0.2-4-g0c2ce70:hyprland_protocols/subprojects/hyprland-protocols \
canihavesomecoffee:udis86:1.7.2-186-g5336633:udis86/subprojects/udis86
MESON_ARGS= -Dsystemd=disabled
# Generated by "make update-hash" for commit_pins in hyprpm.toml
GH_HASH= cba1ade848feac44b2eda677503900639581c3f4
# XXX Drop after FreeBSD 14.0 EOL around 2024-10-01
.if exists(/usr/lib/libc++.so) && !exists(/usr/include/c++/v1/__format/write_escaped.h)
CXXFLAGS+= -fexperimental-library
.endif
# XXX Drop after FreeBSD 13.4 EOL around 2026-01-31
# https://cgit.freebsd.org/src/commit/?id=af93fea71038
.if !exists(/usr/include/sys/timerfd.h)
LIB_DEPENDS+= libepoll-shim.so:devel/libepoll-shim
.endif
OPTIONS_DEFINE= X11
OPTIONS_DEFAULT=X11
X11_USE= XORG=xcb
X11_MESON_ENABLED= xwayland
post-patch:
# Extract (snapshot) version from the port instead of meson.build
@${REINPLACE_CMD} -i .nogit \
-e "/version.*jq/s/run_command.*/'${DISTVERSIONFULL}',/" \
${WRKSRC}/meson.build
@${REINPLACE_CMD} -i .nogit \
-e '/^HASH/s/=.*/=${GH_HASH}/' \
-e '/^BRANCH/s/=.*/=main/' \
-e '/^MESSAGE/s/=.*/="?"/' \
-e "/^DATE/s/=.*/=\"$$(date -ur $$(${AWK} \
'/TIMESTAMP/ { print $$3 }' ${DISTINFO_FILE}))\"/" \
-e '/^DIRTY/s/=.*/=portbld/' \
-e '/^TAG/s/=.*/=${DISTVERSIONFULL}/' \
-e '/^COMMITS/s/=.*/="?"/' \
${WRKSRC}/scripts/generateVersion.sh
# Respect consolekit2 as XDG_RUNTIME_DIR fallback
@${REINPLACE_CMD} 's,/run/user,/var&,' \
${WRKSRC}/hyprctl/main.cpp \
${WRKSRC}/src/Compositor.cpp
# Respect PREFIX for wallpapers
@${REINPLACE_CMD} 's,/usr/share,${DATADIR:H},' \
${WRKSRC}/src/render/OpenGL.cpp
.ifdef GH_TUPLE
post-configure:
@${REINPLACE_CMD} 's/meson install/& \
--skip-subprojects/' ${BUILD_WRKSRC}/build.ninja
.endif
post-install:
# Plugin API installs all headers (no private vs. public)
@(cd ${STAGEDIR}${PREFIX} && ${FIND} include/${PORTNAME} ! -type d) >>${TMPPLIST}
update-hash:
# https://docs.github.com/en/rest/commits/commits#get-a-commit
# Pretend to be curl(1) for pretty-printed JSON to help parse with sed(1)
@${REINPLACE_CMD} -i '' -e "/^GH_HASH=/s/=.*/= $$(\
${SETENV} HTTP_USER_AGENT=curl ${FETCH_CMD} -qo- \
https://api.github.com/repos/${GH_ACCOUNT}/${GH_PROJECT}/commits/${GH_TAGNAME} | \
${SED} -n '/sha/ { s/.*\"\([0-9a-f]\{40\}\).*/\1/p; q; }' \
)/" \
${.CURDIR}/Makefile
# XXX Drop after FreeBSD 13.2 EOL around 2024-07-01 (don't forget distinfo)
.if ${CXX} == c++ && exists(/usr/lib/libc++.so)
.if !exists(/usr/include/c++/v1/__ranges/as_rvalue_view.h) || make(makesum) || make(fetch)
USES+= llvm:min=16,build,export
PATH:= ${LLVM_PREFIX}/bin:${PATH} # XXX _CMAKE_TOOLCHAIN_SUFFIX vs. devel/llvm*
CONFIGURE_ENV+= CC="${CC}" CXX="${CXX}" CPP="${CPP}"
# XXX Move into separate port and standardize via USES
GH_TUPLE+= llvm:llvm-project:llvmorg-16.0.1:libcxx
CXXFLAGS+= -nostdinc++ -isystem${WRKDIR}/libcxx_prefix/include/c++/v1
# Don't link against new libc++ as it's not necessary
CXXFLAGS+= -D_LIBCPP_HAS_NO_VERBOSE_ABORT_IN_LIBRARY
#LDFLAGS+= -nostdlib++ -L${WRKDIR}/libcxx_prefix/lib -l:libc++.a -lcxxrt
pre-configure: bundled-libcxx
bundled-libcxx:
@${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} \
-DLIBCXX_INCLUDE_BENCHMARKS:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX:PATH=${WRKDIR}/libcxx_prefix \
-B ${WRKDIR}/libcxx_build -S ${WRKSRC_libcxx}/libcxx
@${DO_MAKE_BUILD:NDESTDIR*} install -C ${WRKDIR}/libcxx_build
.endif
.endif # exists(/usr/lib/libc++.so)
.include <bsd.port.mk>
# XXX Work around !target(makesum)
makesum: update-hash
|