/
Makefile
77 lines (63 loc) · 2.65 KB
/
Makefile
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
PORTNAME= xdg-desktop-portal-hyprland
DISTVERSIONPREFIX= v
DISTVERSION= 1.0.0
CATEGORIES= x11 wayland
PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
PATCHFILES+= 676571b2c042.patch:-p1 # https://github.com/hyprwm/xdg-desktop-portal-hyprland/pull/84
MAINTAINER= jbeich@FreeBSD.org
COMMENT= xdg-desktop-portal backend for hyprland
WWW= https://github.com/hyprwm/xdg-desktop-portal-hyprland
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
BROKEN_FreeBSD_12= libc++ too old
BUILD_DEPENDS= wayland-protocols>=1.31:graphics/wayland-protocols
LIB_DEPENDS= libsdbus-c++.so:devel/sdbus-cpp \
libdrm.so:graphics/libdrm \
libwayland-client.so:graphics/wayland \
libpipewire-0.3.so:multimedia/pipewire
RUN_DEPENDS= hyprland-share-picker:x11/hyprland-share-picker@${FLAVOR}
FLAVORS= qt5 qt6
qt5_CONFLICTS_INSTALL= ${PORTNAME}-qt6
qt6_CONFLICTS_INSTALL= ${PORTNAME}
qt6_PKGNAMESUFFIX= -qt6
USES= compiler:gcc-c++11-lib gl meson pkgconfig
USE_GITHUB= yes
USE_GL= gbm
GH_ACCOUNT= hyprwm
GH_TUPLE= hyprwm:hyprland-protocols:v0.2:hyprland_protocols/subprojects/hyprland-protocols
MESON_ARGS= -Dsystemd=disabled
PLIST_FILES= libexec/${PORTNAME} \
share/dbus-1/services/org.freedesktop.impl.portal.desktop.hyprland.service \
share/xdg-desktop-portal/portals/hyprland.portal
.if exists(/usr/lib/libc++.so) && !exists(/usr/include/c++/v1/__format/write_escaped.h)
CXXFLAGS+= -D_LIBCPP_ENABLE_EXPERIMENTAL # std::vformat
.endif
.ifdef GH_TUPLE
post-configure:
@${REINPLACE_CMD} 's/meson install/& \
--skip-subprojects/' ${BUILD_WRKSRC}/build.ninja
.endif
# XXX Drop after FreeBSD 13.2 EOL around 2024-05-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)
BUILD_DEPENDS+= ${CMAKE_BIN}:devel/cmake-core
CONFIGURE_ENV+= CC="${CC}" CXX="${CXX}" CPP="${CPP}"
CMAKE_BIN= ${LOCALBASE}/bin/cmake
# 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
#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 USES=compiler:gcc-c++11-lib
RUN_DEPENDS:= ${RUN_DEPENDS:Ngcc*}
LDFLAGS+= -static-libgcc