dislocker-9999.ebuild 1.58 KB
Newer Older
Liguros - Gitlab CI/CD [develop]'s avatar
updates  
Liguros - Gitlab CI/CD [develop] committed
1
# Copyright 1999-2020 Gentoo Authors
2 3
# Distributed under the terms of the GNU General Public License v2

Liguros - Gitlab CI/CD [develop]'s avatar
updates  
Liguros - Gitlab CI/CD [develop] committed
4
EAPI=7
5

Liguros - Gitlab CI/CD [develop]'s avatar
updates  
Liguros - Gitlab CI/CD [develop] committed
6
inherit cmake flag-o-matic
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

DESCRIPTION="Dislocker is used to read BitLocker encrypted partitions."
HOMEPAGE="https://github.com/Aorimn/dislocker"

if [[ ${PV} == *9999* ]]; then
	EGIT_REPO_URI="https://github.com/Aorimn/dislocker.git"
	inherit git-r3
else
	SRC_URI="https://github.com/Aorimn/dislocker/archive/v${PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="~amd64 ~x86"
fi

LICENSE="GPL-2"
SLOT="0"
IUSE="ruby"

Liguros - Gitlab CI/CD [develop]'s avatar
updates  
Liguros - Gitlab CI/CD [develop] committed
23 24 25 26 27
DEPEND="
	sys-fs/fuse:0=
	net-libs/mbedtls:0=
	ruby? ( dev-lang/ruby:* )
"
28 29
RDEPEND="${DEPEND}"

Liguros - Gitlab CI/CD [develop]'s avatar
updates  
Liguros - Gitlab CI/CD [develop] committed
30 31
CMAKE_REMOVE_MODULES_LIST="${CMAKE_REMOVE_MODULES_LIST} FindRuby"

32
src_prepare() {
Liguros - Gitlab CI/CD [develop]'s avatar
updates  
Liguros - Gitlab CI/CD [develop] committed
33 34 35 36
	if use ruby && [[ ${PV} == "0.7.1" ]]; then
		PATCHES=( "${FILESDIR}/${P}-fix-find-ruby.patch" )
	fi
	cmake_src_prepare
37 38 39 40 41

# We either need to change Werror to Wno-error or remove the multiple declarations of FORTIFY_SOURCE
#    sed 's:Werror:Wno-error:g' -i "${S}/src/CMakeLists.txt" || die
	sed 's:-D_FORTIFY_SOURCE=2::g' -i "${S}/src/CMakeLists.txt" || die

Liguros - Gitlab CI/CD [develop]'s avatar
updates  
Liguros - Gitlab CI/CD [develop] committed
42 43 44 45
#	sed 's:\.\./man:'../../${P}/man':g' -i "${S}/src/CMakeLists.txt" || die
# Do not process compressed versions of the manuals
	sed -r 's:( create_symlink \$\{BIN_FUSE\}\.1)\.gz (.+\.1)\.gz\\:\1 \2\\:' -i "${S}/src/CMakeLists.txt" || die
	sed -r 's:^(.+\.1\.gz):#\1:' -i "${S}/src/CMakeLists.txt" || die
46 47 48 49
}

src_configure() {
	mycmakeargs=(
Liguros - Gitlab CI/CD [develop]'s avatar
updates  
Liguros - Gitlab CI/CD [develop] committed
50
		$(cmake_use_find_package ruby Ruby)
51
	)
Liguros - Gitlab CI/CD [develop]'s avatar
updates  
Liguros - Gitlab CI/CD [develop] committed
52
	cmake_src_configure
53 54 55
}

src_install() {
Liguros - Gitlab CI/CD [develop]'s avatar
updates  
Liguros - Gitlab CI/CD [develop] committed
56 57 58
	if ! use ruby; then
		rm "${S}/man/linux/${PN}-find.1" || die
	fi
59
	find "${S}/man/linux" -name '*.1' -exec doman '{}' +
Liguros - Gitlab CI/CD [develop]'s avatar
updates  
Liguros - Gitlab CI/CD [develop] committed
60
	cmake_src_install
61
}