summaryrefslogtreecommitdiff
blob: e35c0185bc9254ca737a03fa8cc3c168a8f288b1 (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
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit cmake

DESCRIPTION="Header-only single-file std::filesystem compatible helper library"
HOMEPAGE="https://github.com/gulrak/filesystem"
SRC_URI="https://github.com/gulrak/filesystem/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 ~arm64 x86"
IUSE="examples test"
RESTRICT="!test? ( test )"

S="${WORKDIR}/${P#*-}"

src_prepare() {
	cmake_src_prepare
	sed -i "s:-Werror::g" cmake/GhcHelper.cmake test/CMakeLists.txt || die
}

src_configure() {
	local mycmakeargs=(
		-DGHC_FILESYSTEM_BUILD_EXAMPLES=OFF
		-DGHC_FILESYSTEM_BUILD_TESTING=$(usex test)
		-DGHC_FILESYSTEM_WITH_INSTALL=ON
	)

	cmake_src_configure
}

src_install() {
	cmake_src_install

	docinto examples
	use examples && dodoc examples/*.cpp
}