Skip to content

Commit

Permalink
Update Gentoo ebuild
Browse files Browse the repository at this point in the history
* Remove dirty suffix because Gentoo modifies CMakeLists.txt
* Update metadata.xml to match the OpenEMV overlay
* Add support for qt5 and qt6 useflags to build emv-viewer
  • Loading branch information
leonlynch committed Nov 16, 2024
1 parent 29a653b commit d11f31a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
22 changes: 21 additions & 1 deletion gentoo/dev-libs/emv-utils/emv-utils-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fi
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+pcsc-lite doc test"
IUSE="+pcsc-lite qt5 qt6 doc test"
RESTRICT="!test? ( test )"

BDEPEND="
Expand All @@ -30,22 +30,42 @@ RDEPEND="
app-text/iso-codes
dev-libs/json-c
pcsc-lite? ( sys-apps/pcsc-lite )
qt5? (
dev-qt/qtcore:5
dev-qt/qtgui:5
dev-qt/qtwidgets:5
)
qt6? (
dev-qt/qtbase:6[gui,widgets]
)
"
DEPEND="
${RDEPEND}
"

src_prepare() {
cmake_src_prepare

# Remove dirty suffix because Gentoo modifies CMakeLists.txt
sed -i -e 's/--dirty//' CMakeLists.txt || die "Failed to remove dirty suffix"
}

src_configure() {
# NOTE:
# https://wiki.gentoo.org/wiki/Project:Qt/Policies states that when an
# application optionally supports one of two Qt versions, it is allowed for
# both qt5 and qt6 to be enabled and, if so, qt5 should be preferred.
local mycmakeargs=(
$(cmake_use_find_package pcsc-lite PCSCLite)
-DBUILD_EMV_TOOL=$(usex pcsc-lite)
$(cmake_use_find_package qt5 Qt5)
$(cmake_use_find_package qt6 Qt6)
-DBUILD_DOCS=$(usex doc)
-DBUILD_TESTING=$(usex test)
)
if use qt5 || use qt6; then
mycmakeargs+=( -DBUILD_EMV_VIEWER=YES )
fi

cmake_src_configure
}
Expand Down
2 changes: 1 addition & 1 deletion gentoo/dev-libs/emv-utils/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
Expand Down

0 comments on commit d11f31a

Please sign in to comment.