commit: 204acbf8906ed847f1911b9721b7c986b4f623c6 Author: Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com> AuthorDate: Thu May 29 12:32:53 2025 +0000 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org> CommitDate: Wed Jun 11 07:29:36 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=204acbf8
sys-fs/dislocker: add 0.7.3_p20250513 Migrate to EAPI=8, use net-libs/mbedtls:3, update LICENSE, minor cleanups. Closes: https://bugs.gentoo.org/804981 Closes: https://bugs.gentoo.org/811486 Closes: https://bugs.gentoo.org/810811 Closes: https://bugs.gentoo.org/935752 Closes: https://bugs.gentoo.org/956803 Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com> Part-of: https://github.com/gentoo/gentoo/pull/39999 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org> sys-fs/dislocker/Manifest | 1 + sys-fs/dislocker/dislocker-0.7.3_p20250513.ebuild | 67 ++++++++++++++++ .../dislocker-0.7.3_p20250513_mbedtls-3.patch | 90 ++++++++++++++++++++++ 3 files changed, 158 insertions(+) diff --git a/sys-fs/dislocker/Manifest b/sys-fs/dislocker/Manifest index a1a495a1eb9d..2acae4f4bdc6 100644 --- a/sys-fs/dislocker/Manifest +++ b/sys-fs/dislocker/Manifest @@ -1 +1,2 @@ DIST dislocker-0.7.3.tar.gz 111257 BLAKE2B ba8403facfef04f5194a22421d2010d472b073d6dce03c9f457d7661de11bb818782cc66bfee8cd88fe72af7ac127bbbcbe1a01c5c35f0cf054f282b3208c3ea SHA512 c62241d70d51f6445a2f6d0f08e099bbc1a4257ca98232471fc43ec63e69d62ae5f702c995ec00b7e1db7d33f4bb3a31ea05bc13862bf3b539feb301a0e034ff +DIST dislocker-0.7.3_p20250513.tar.gz 114875 BLAKE2B 2a8b0d9f243f3f97690dd9be2c3040237135c6d546cccd9f930cb5bbf5d5a29f2c3325d7beb5a716d3f929590c7ef9cc62c81a5f69b88f0ea6fc9710f2011000 SHA512 62ec4d0d9efcfbb4f33a126bf27debc7d5027777ee5cedd03ebbf27ef23da9380884559bdefb063713aa98520df9f4f38b738bd8e0d7aea6fb513a11d4f6107c diff --git a/sys-fs/dislocker/dislocker-0.7.3_p20250513.ebuild b/sys-fs/dislocker/dislocker-0.7.3_p20250513.ebuild new file mode 100644 index 000000000000..0843313b27bf --- /dev/null +++ b/sys-fs/dislocker/dislocker-0.7.3_p20250513.ebuild @@ -0,0 +1,67 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CMAKE_REMOVE_MODULES_LIST=( ${CMAKE_REMOVE_MODULES_LIST} FindRuby ) +inherit cmake + +EGIT_COMMIT="4572dc727940cc42249c9f967cee9c505f16b121" + +DESCRIPTION="Dislocker is used to read BitLocker encrypted partitions" +HOMEPAGE="https://github.com/Aorimn/dislocker" +SRC_URI="https://github.com/Aorimn/dislocker/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${PN}-${EGIT_COMMIT}" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +IUSE="ruby" + +DEPEND=" + sys-fs/fuse:0= + net-libs/mbedtls:3= + ruby? ( dev-lang/ruby:* ) +" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}/dislocker-0.7.3_p20250513_mbedtls-3.patch" +) + +src_prepare() { + # Part of dislocker-0.7.3_p20250513_mbedtls-3.patch + mv include/dislocker/ssl_bindings.h{.in,} || die + + cmake_src_prepare + + # Update cmake_minimum_required + sed -i -e 's:VERSION 2.6:VERSION 3.10:g' CMakeLists.txt || die + + # We either need to change Werror to Wno-error or remove the multiple declarations of FORTIFY_SOURCE + #sed 's:Werror:Wno-error:g' -i src/CMakeLists.txt || die + sed 's:-D_FORTIFY_SOURCE=2::g' -i src/CMakeLists.txt || die + + # Do not process compressed versions of the manuals + #sed 's:\.\./man:'../../${P}/man':g' -i "${S}/src/CMakeLists.txt" || die + sed -r 's:( create_symlink \$\{BIN_FUSE\}\.1)\.gz (.+\.1)\.gz\\:\1 \2\\:' -i src/CMakeLists.txt || die + sed -r 's:^(.+\.1\.gz):#\1:' -i src/CMakeLists.txt || die +} + +src_configure() { + local mycmakeargs=( + $(cmake_use_find_package ruby Ruby) + ) + + cmake_src_configure +} + +src_install() { + if ! use ruby; then + rm "${S}/man/linux/${PN}-find.1" || die + fi + + find "${S}/man/linux" -name '*.1' -exec doman '{}' + || die + cmake_src_install +} diff --git a/sys-fs/dislocker/files/dislocker-0.7.3_p20250513_mbedtls-3.patch b/sys-fs/dislocker/files/dislocker-0.7.3_p20250513_mbedtls-3.patch new file mode 100644 index 000000000000..4e12ed234902 --- /dev/null +++ b/sys-fs/dislocker/files/dislocker-0.7.3_p20250513_mbedtls-3.patch @@ -0,0 +1,90 @@ +From https://github.com/Aorimn/dislocker/pull/336 +From: "Azamat H. Hackimov" <[email protected]> +Date: Tue, 11 Feb 2025 00:05:31 +0300 +Subject: [PATCH 1/2] Use MbedTLS 3, remove support for outdated versions + +PolarSSL no longer supported and should not be used as dependency. MbedTLS 2 reached EOL, upstream recommends to use MbedTLS 3 branch. + +After dropping outdated versions, configuration of dislocker is greatly simplified. +--- a/.gitignore ++++ b/.gitignore +@@ -12,7 +12,6 @@ src/dislocker-metadata + src/libdislocker.so* + + # Configured files +-include/dislocker/ssl_bindings.h + src/dislocker-find.rb + + # Unit test files +--- a/include/dislocker/ssl_bindings.h ++++ b/include/dislocker/ssl_bindings.h +@@ -24,43 +24,12 @@ + #define SSL_BINDINGS_H + + /* +- * Here stand the bindings for polarssl SHA256/SHA2/SHA-2 function for dislocker ++ * Here stand the bindings for MbedTLS SHA256/SHA2/SHA-2 function for dislocker + */ +-#include "@POLARSSL_INC_FOLDER@/version.h" +-#if MBEDTLS_VERSION_MAJOR >= 3 +-#include "@POLARSSL_INC_FOLDER@/mbedtls_config.h" +-#include "@POLARSSL_INC_FOLDER@/compat-2.x.h" +-#else +-#include "@POLARSSL_INC_FOLDER@/config.h" +-#endif +-#include "@POLARSSL_INC_FOLDER@/aes.h" +- +-// Function's name changed +-#if defined(MBEDTLS_SHA256_C) +-# include "mbedtls/sha256.h" +-# if MBEDTLS_VERSION_NUMBER >= 0x02070000 +-# define SHA256(input, len, output) mbedtls_sha256_ret(input, len, output, 0) +-# else +-# define SHA256(input, len, output) mbedtls_sha256(input, len, output, 0) +-# endif /* POLARSSL_VERSION_NUMBER >= 0x02070000 */ +-#else /* defined(MBEDTLS_SHA256_C) */ +- +-# if defined(POLARSSL_SHA256_C) +-# include "polarssl/sha256.h" +-# define SHA256(input, len, output) sha256(input, len, output, 0) +-# else /* defined(POLARSSL_SHA256_C) */ +-# include "polarssl/sha2.h" +- +-// 0x00630500 = version 0.99.5, argument's type changed in this release +-# if POLARSSL_VERSION_NUMBER >= 0x00630500 +-# define SHA256(input, len, output) sha2(input, len, output, 0) +-# else +-# define SHA256(input, len, output) sha2(input, (int)len, output, 0) +-# endif /* POLARSSL_VERSION_NUMBER >= 0x00630500 */ +- +-# endif /* defined(POLARSSL_SHA256_C) */ +-#endif /* defined(MBEDTLS_SHA256_C) */ ++#include "mbedtls/aes.h" ++#include "mbedtls/sha256.h" + ++#define SHA256(input, len, output) mbedtls_sha256(input, len, output, 0) + + /* Here stand the bindings for AES functions and contexts */ + #if defined(MBEDTLS_AES_H) +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -116,14 +116,8 @@ endif() + # Libraries + set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) + +-find_package (PolarSSL REQUIRED) +-if(POLARSSL_FOUND AND POLARSSL_INCLUDE_DIRS AND POLARSSL_LIBRARIES) +- include_directories (${POLARSSL_INCLUDE_DIRS}) +- set (LIB ${LIB} ${POLARSSL_LIBRARIES}) +- configure_file (${PROJECT_SOURCE_DIR}/include/dislocker/ssl_bindings.h.in ${PROJECT_SOURCE_DIR}/include/dislocker/ssl_bindings.h ESCAPE_QUOTES @ONLY) +-else() +- return () +-endif() ++find_package (MbedTLS 3 REQUIRED) ++set (LIB ${LIB} MbedTLS::mbedcrypto) + + # Ruby bindings + set(WITH_RUBY "AUTO" CACHE STRING "Enable Ruby bindings. Valid values are ON, OFF, or AUTO") +-- +2.49.0 +
