Mutsuha Asada
2025-04-11 14:04:15 +02:00
committed by Sandro Jäckel
parent 66290f9eb9
commit 2335f7a0be
2 changed files with 28 additions and 20 deletions
+15 -16
View File
@@ -1,38 +1,37 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
python3,
fetchFromGitHub,
gitUpdater,
python3,
stdenv,
zint,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "zxing-cpp";
version = "2.2.1";
version = "2.3.0";
src = fetchFromGitHub {
owner = "zxing-cpp";
repo = "zxing-cpp";
rev = "v${finalAttrs.version}";
hash = "sha256-teFspdATn9M7Z1vSr/7PdJx/xAv+TVai8rIekxqpBZk=";
tag = "v${finalAttrs.version}";
hash = "sha256-e3nSxjg8p+1DEUbZOh4C2zfnA6iGhNJMPiIe2oJEbRo=";
};
# c++ 20 needed for char8_t or clang-19 build fails
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace-fail "CMAKE_CXX_STANDARD 17" "CMAKE_CXX_STANDARD 20"
'';
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
zint
];
cmakeFlags = [
"-DBUILD_EXAMPLES=OFF"
"-DBUILD_BLACKBOX_TESTS=OFF"
"-DZXING_BLACKBOX_TESTS=OFF"
"-DZXING_DEPENDENCIES=LOCAL"
"-DZXING_EXAMPLES=OFF"
"-DZXING_USE_BUNDLED_ZINT=OFF"
];
passthru = {
@@ -7,6 +7,7 @@
pybind11,
libzxing-cpp,
pytestCheckHook,
zint,
}:
buildPythonPackage rec {
@@ -20,20 +21,28 @@ buildPythonPackage rec {
# https://pybind11.readthedocs.io/en/stable/installing.html#include-with-pypi
postPatch = ''
substituteInPlace pyproject.toml \
--replace "pybind11[global]" "pybind11"
--replace-fail "pybind11[global]" "pybind11"
substituteInPlace setup.py \
--replace-fail "cfg = 'Debug' if self.debug else 'Release'" "cfg = 'Release'" \
--replace-fail " '-DVERSION_INFO=' + self.distribution.get_version()]" " '-DVERSION_INFO=' + self.distribution.get_version(), '-DZXING_DEPENDENCIES=LOCAL', '-DZXING_USE_BUNDLED_ZINT=OFF']"
'';
dontUseCmakeConfigure = true;
propagatedBuildInputs = [ numpy ];
build-system = [
setuptools-scm
pybind11
];
buildInputs = [ pybind11 ];
dependencies = [ numpy ];
nativeBuildInputs = [
cmake
setuptools-scm
];
buildInputs = [ zint ];
nativeCheckInputs = [
pillow
pytestCheckHook