1
0
Fork 0

sci-libs/simpleitk: cmake runs, python not really :-/

Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Horea Christian <chr@chymera.eu>
This commit is contained in:
Horea Christian 2021-05-06 05:28:21 -04:00
parent 493ca825e3
commit c4bd5412c8
No known key found for this signature in database
GPG Key ID: EAA9223EE3BB378A
6 changed files with 238 additions and 88 deletions

View File

@ -1,3 +1,10 @@
*simpleitk-1.2.4 (06 May 2021)
06 May 2021; <chymera@gentoo.org> +files/simpleitk-1.2.4-int-cast.patch,
+files/simpleitk-1.2.4-module.patch, +simpleitk-1.2.4.ebuild,
simpleitk-2.0.0.ebuild:
sci-libs/simpleitk: cmake runs, python not really :-/
03 Jan 2021; <chymera@gentoo.org> -files/0dfae3e_reversed.patch, 03 Jan 2021; <chymera@gentoo.org> -files/0dfae3e_reversed.patch,
-files/77a3d89_reversed.patch, -files/simpleitk-1.2.4-int-cast.patch, -files/77a3d89_reversed.patch, -files/simpleitk-1.2.4-int-cast.patch,
-files/simpleitk-1.2.4-module.patch, -simpleitk-1.2.4.ebuild, -files/simpleitk-1.2.4-module.patch, -simpleitk-1.2.4.ebuild,

View File

@ -1 +1,4 @@
DIST simpleitk-2.0.0.tar.gz 1917829 SHA256 de7aeb1e27adc717979645f8daab12097c7b3de241e182c1f6bffa4d4ee4b086 SHA512 5387a7452bedaf3b757da58dffab9290014078e605ab95f3794d3bc8fd636ac4199d0a853bcc8c017837d59c601c1b507568a5450c8269f0f8708708ef10d0b6 WHIRLPOOL a310b532104eacc97c7a0de3296bc0183dfa5f2b3f839df7c45059f0e381103df3c63d358e6025f86551dd3e3e3d54c1f10a92a8e6348422a7cad7d01aed4d61 DIST SimpleITK-1.2.4.tar.gz 1894019 SHA256 1d67ed4324fee0d7341a027de865bf915a34dfa82e2863d89037e2f2865f7559 SHA512 49395b284fa03cc75dbd68f7f63008ea5d03a0771f0144f2d6d62ae034d66c93a14e262b48b12b6f0e6beb3d42d6f60022f502da02d2e87c6e47bd5d38637025 WHIRLPOOL 8d50fcc2b2bd5d300d439c7ee34ecf4ce47bf16e2418ad83fc21a1692b128b8933ac0660d10a348da2e02d8338351af5d6a6e0629f3e7c17d723a3655c05e24b
DIST SimpleITK-2.0.0.tar.gz 1904162 SHA256 88e3873e9fc347ca7f2f8af4710d5402fbfef5989cf039abcce9b7a7e395bdb8 SHA512 353fc834ce2e2626370a176217d5be7b08060abaf16bac47060f806ee0ffdf136c1fa241f2ffd2c19b28d69a8ab692e0086a62a3785b40867eb5f95c94e90a41 WHIRLPOOL 474072b4d01a425d6e5ac9b20d3c7994792e512984b89b82dafe192be93759662bdbe27d52e2734cf8d1e6a88e2361d73eca1bfd378c9682d36df0181fb7dd69
DIST SimpleITKData-1.2.4.tar.gz 112145576 SHA256 39901fd25bd676648a8cfd9ef7b1bd351583af92e8cfcc69ca83b4b627abb3b1 SHA512 1dd73d5bfeba0a7d72088dc2c966db764f5d7deb173bea17a9f6c5a9fae849ddc781b9fbf9b25ab898742268de4ca0dc5a64f72e985e3c72d4d95c7e5e79e92f WHIRLPOOL f7fae995477b88bb743560f25aec45bc83a155206fddde8abe4215d52eca098c7fa4ad9e529bdeb145c5f8b37a5c14777d211727bc5733fcc0bae8c135746ce0
DIST SimpleITKData-2.0.0.tar.gz 84658864 SHA256 68ecd540ef08600d1dbc64647cebcbec1bd459819ade1b438eb704b0068b3787 SHA512 a5ef18e541463818bacf9f75d033cf1a4e2e67b40ae0a6e0f359a14739fa51be9b6c1e007a3a72c4c4ec878dfce98350ec576cb6312429f97055cd81a7f49236 WHIRLPOOL 7545db6c32b7a7b5c5e30c0e0c5ebb8803d0264f477ed27f1ae6ff5f2aafb5e9dbcf55602e1550096f309e79adc032b4d182061abb21bab95e2ed0cf219dbf36

View File

@ -0,0 +1,64 @@
From 73caeaa545859cffd68f9aebe1e8b66de5ab812d Mon Sep 17 00:00:00 2001
From: Bradley Lowekamp <blowekamp@mail.nih.gov>
Date: Fri, 14 Feb 2020 09:35:29 -0500
Subject: [PATCH] Explicitly cast int to ITK strongly typed enums
---
Code/IO/src/sitkImageReaderBase.cxx | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/Code/IO/src/sitkImageReaderBase.cxx b/Code/IO/src/sitkImageReaderBase.cxx
index b8c93a2ac..a5e6d9cd9 100644
--- a/Code/IO/src/sitkImageReaderBase.cxx
+++ b/Code/IO/src/sitkImageReaderBase.cxx
@@ -214,7 +214,7 @@ ::GetPixelIDFromImageIO( const ImageIOBase *iobase,
if (numberOfComponents == 1 &&
( pixelType == itk::ImageIOBase::SCALAR || pixelType == itk::ImageIOBase::COMPLEX ) )
{
- outPixelType = this->ExecuteInternalReadScalar( componentType );
+ outPixelType = this->ExecuteInternalReadScalar( static_cast<int>(componentType) );
return;
}
// we try to load anything else into a VectorImage
@@ -226,12 +226,12 @@ ::GetPixelIDFromImageIO( const ImageIOBase *iobase,
pixelType == itk::ImageIOBase::POINT ||
pixelType == itk::ImageIOBase::OFFSET )
{
- outPixelType = this->ExecuteInternalReadVector( componentType );
+ outPixelType = this->ExecuteInternalReadVector( static_cast<int>(componentType) );
return;
}
else if ( pixelType == itk::ImageIOBase::COMPLEX )
{
- outPixelType = this->ExecuteInternalReadComplex( componentType );
+ outPixelType = this->ExecuteInternalReadComplex( static_cast<int>(componentType) );
return;
}
else
@@ -268,7 +268,7 @@ ::ExecuteInternalReadScalar( int componentType )
{
const unsigned int UnusedDimension = 2;
- switch(componentType)
+ switch(static_cast<ImageIOBase::IOComponentType>(componentType))
{
case itk::ImageIOBase::CHAR:
return ImageTypeToPixelIDValue< itk::Image<int8_t, UnusedDimension> >::Result;
@@ -326,7 +326,7 @@ ::ExecuteInternalReadComplex( int componentType )
{
const unsigned int UnusedDimension = 2;
- switch(componentType)
+ switch(static_cast<ImageIOBase::IOComponentType>(componentType))
{
case itk::ImageIOBase::FLOAT:
return ImageTypeToPixelIDValue< itk::Image<std::complex<float>, UnusedDimension> >::Result;
@@ -346,7 +346,7 @@ ::ExecuteInternalReadVector( int componentType )
{
const unsigned int UnusedDimension = 2;
- switch(componentType)
+ switch(static_cast<ImageIOBase::IOComponentType>(componentType))
{
case itk::ImageIOBase::CHAR:
return ImageTypeToPixelIDValue< itk::VectorImage<int8_t, UnusedDimension> >::Result;

View File

@ -0,0 +1,22 @@
From 9a9f67416683d69c1c8d2362ba6e50c4848803b2 Mon Sep 17 00:00:00 2001
From: Bradley Lowekamp <blowekamp@mail.nih.gov>
Date: Wed, 20 Nov 2019 15:30:50 -0500
Subject: [PATCH] Update SLICImageFilter's module
---
Code/BasicFilters/json/SLICImageFilter.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Code/BasicFilters/json/SLICImageFilter.json b/Code/BasicFilters/json/SLICImageFilter.json
index 2ffba2f4c..0e9ced7d7 100644
--- a/Code/BasicFilters/json/SLICImageFilter.json
+++ b/Code/BasicFilters/json/SLICImageFilter.json
@@ -156,7 +156,7 @@
]
}
],
- "itk_module" : "SimpleITKFilters",
+ "itk_module" : "ITKSuperPixel",
"detaileddescription" : "The Simple Linear Iterative Clustering (SLIC) algorithm groups pixels into a set of labeled regions or super-pixels. Super-pixels follow natural image boundaries, are compact, and are nearly uniform regions which can be used as a larger primitive for more efficient computation. The SLIC algorithm can be viewed as a spatially constrained iterative k-means method.\n\nThe original algorithm was designed to cluster on the joint domain of the images index space and it's CIELAB color space. This implementation works with images of arbitrary dimension as well as scalar, single channel, images and most multi-component image types including ITK's arbitrary length VectorImage .\n\nThe distance between a pixel and a cluster is the sum of squares of the difference between their joint range and domains ( index and value ). The computation is done in index space with scales provided by the SpatialProximityWeight parameters.\n\nThe output is a label image with each label representing a superpixel cluster. Every pixel in the output is labeled, and the starting label id is zero.\n\nThis code was contributed in the Insight Journal paper: \"Scalable Simple Linear Iterative Clustering (SSLIC) Using a\nGeneric and Parallel Approach\" by Lowekamp B. C., Chen D. T., Yaniv Z.",
"briefdescription" : "Simple Linear Iterative Clustering (SLIC) super-pixel segmentation."
}

View File

@ -0,0 +1,96 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{7..9} )
LUA_COMPAT=( lua5-1 )
inherit lua-single toolchain-funcs cmake python-r1
#distutils-r1
#python-single-r1
MY_PN="SimpleITK"
DESCRIPTION="Layer on top of ITK for rapid prototyping, education and interpreted languages."
HOMEPAGE="https://simpleitk.org/"
SRC_URI="
https://github.com/SimpleITK/SimpleITK/releases/download/v${PV}/SimpleITK-${PV}.tar.gz
https://github.com/SimpleITK/SimpleITK/releases/download/v${PV}/SimpleITKData-${PV}.tar.gz
"
RESTRICT="primaryuri"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
# tcl currently fails: https://github.com/SimpleITK/SimpleITK/issues/1348
IUSE="python tcl"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
BDEPEND="dev-lang/swig"
RDEPEND="
${LUA_DEPS}
dev-cpp/gtest
tcl? ( dev-lang/tk )
sci-libs/itk
dev-python/virtualenv
python? ( ${PYTHON_DEPS} )
"
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}/${P}-module.patch"
"${FILESDIR}/${P}-int-cast.patch"
)
S="${WORKDIR}/${MY_PN}-${PV}"
src_prepare() {
cmake_src_prepare
cp -rf "../${MY_PN}-${PV}/.ExternalData" "${BUILD_DIR}/" || die
}
src_configure() {
local mycmakeargs=(
-DWRAP_DEFAULT:BOOL=OFF
-DWRAP_TCL:BOOL=$(usex tcl)
-DWRAP_PYTHON:BOOL=$(usex python)
-DBUILD_TESTING:BOOL=OFF
-DSimpleITK_FORBID_DOWNLOADS=ON
-DSimpleITK_PYTHON_USE_VIRTUALENV:BOOL=OFF
-DSimpleITK_EXPLICIT_INSTANTIATION=OFF
-DExternalData_OBJECT_STORES:STRING="${BUILD_DIR}/.ExternalData"
-DSimpleITK_INSTALL_LIBRARY_DIR=$(get_libdir)
-DSimpleITK_LUA_EXECUTABLE:PATH=/usr/bin/lua5.1
-DLUA_EXECUTABLE:PATH=/usr/bin/lua5.1
)
cmake_src_configure
}
# -DUSE_SYSTEM_VIRTUALENV=ON
# -DModule_SimpleITKFilters:BOOL=ON
# -DUSE_SYSTEM_GTEST=ON
# -DUSE_SYSTEM_ITK=ON
# -DUSE_SYSTEM_LUA=ON
# -DUSE_SYSTEM_SWIG=ON
src_install() {
pwd
ls -lah
echo "${BUILD_DIR}"
cd "../${P}_build" || die
pushd Wrapping/Python > /dev/null || die
pwd
echo "Doing "python Packaging/setup.py install" here"
#1
#python Packaging/setup.py install || die
cd Packaging || die
esetup.py install || die
popd > /dev/null || die
#pushd ../${P}_build/Wrapping/Python > /dev/null || die
# python Packaging/setup.py install
#popd > /dev/null || die
#pwd
#ls -lah
#die
}

View File

@ -3,116 +3,74 @@
EAPI=7 EAPI=7
PYTHON_COMPAT=( python2_7 python3_{6..9} ) PYTHON_COMPAT=( python3_{7..9} )
LUA_COMPAT=( lua5-{1..3} )
inherit toolchain-funcs cmake python-single-r1 inherit lua-single toolchain-funcs cmake python-single-r1
MY_PN="SimpleITK" MY_PN="SimpleITK"
DESCRIPTION="Layer on top of ITK for rapid prototyping, education and interpreted languages." DESCRIPTION="Layer on top of ITK for rapid prototyping, education and interpreted languages."
HOMEPAGE="https://simpleitk.org/" HOMEPAGE="https://simpleitk.org/"
SRC_URI="https://github.com/SimpleITK/SimpleITK/archive/v${PV}.tar.gz -> ${P}.tar.gz" SRC_URI="
https://github.com/SimpleITK/SimpleITK/releases/download/v${PV}/SimpleITK-${PV}.tar.gz
https://github.com/SimpleITK/SimpleITK/releases/download/v${PV}/SimpleITKData-${PV}.tar.gz
"
RESTRICT="primaryuri" RESTRICT="primaryuri"
LICENSE="Apache-2.0" LICENSE="Apache-2.0"
SLOT="0" SLOT="0"
# Won't work on account of newer LUA requirement: KEYWORDS="~amd64 ~x86"
# https://github.com/SimpleITK/SimpleITK/issues/1242
KEYWORDS=""
IUSE="python"
# According to upstream it should be dev-lang/lua:5.3 , but that is hard masked. IUSE="python tcl"
# Let's hope for the best! REQUIRED_USE="${PYTHON_REQUIRED_USE}"
BDEPEND="dev-lang/swig"
RDEPEND=" RDEPEND="
dev-lang/lua:0 ${LUA_DEPS}
dev-cpp/gtest dev-cpp/gtest
tcl? ( dev-lang/tk )
sci-libs/itk sci-libs/itk
dev-python/virtualenv dev-python/virtualenv
python? ( ${PYTHON_DEPS} )
" "
DEPEND=" DEPEND="${RDEPEND}"
dev-lang/swig
${RDEPEND}
"
#REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
PATCHES=( PATCHES=(
"${FILESDIR}/0dfae3e_reversed.patch" "${FILESDIR}/${P}-module.patch"
"${FILESDIR}/77a3d89_reversed.patch" "${FILESDIR}/${P}-int-cast.patch"
) )
S="${WORKDIR}/${MY_PN}-${PV}" S="${WORKDIR}/${MY_PN}-${PV}"
src_configure() { src_prepare() {
local mycmakeargs=( cmake_src_prepare
-DUSE_SYSTEM_LUA=ON cp -rf "../${MY_PN}-${PV}/.ExternalData" "${BUILD_DIR}/" || die
-DUSE_SYSTEM_SWIG=ON
-DUSE_SYSTEM_GTEST=ON
-DUSE_SYSTEM_ITK=ON
-DUSE_SYSTEM_VIRTUALENV=ON
)
#-DITK_INSTALL_LIBRARY_DIR=$(get_libdir)
#-DBUILD_SHARED_LIBS=ON
#-DGDCM_USE_SYSTEM_OPENJPEG=ON
#-DITK_FORBID_DOWNLOADS:BOOL=OFF
#-DITK_USE_SYSTEM_DCMTK=ON
#-DITK_USE_SYSTEM_DOUBLECONVERSION=ON
#-DITK_USE_SYSTEM_CASTXML=ON
#-DITK_USE_SYSTEM_HDF5=ON
#-DITK_USE_SYSTEM_JPEG=ON
#-DITK_USE_SYSTEM_PNG=ON
#-DITK_USE_SYSTEM_SWIG=ON
#-DITK_USE_SYSTEM_TIFF=ON
#-DITK_USE_SYSTEM_ZLIB=ON
#-DITK_USE_KWSTYLE=OFF
#-DITK_BUILD_DEFAULT_MODULES=ON
#-DITK_COMPUTER_MEMORY_SIZE="${ITK_COMPUTER_MEMORY_SIZE:-1}"
#-DWRAP_ITK_JAVA=OFF
#-DWRAP_ITK_TCL=OFF
#-Ddouble-conversion_INCLUDE_DIRS="${EPREFIX}/usr/include/double-conversion"
#-DExternalData_OBJECT_STORES="${WORKDIR}/InsightToolkit-${PV}/.ExternalData"
#-DModule_GenericLabelInterpolator:BOOL=ON
#-DModule_ITKReview:BOOL=ON
#-DBUILD_EXAMPLES="$(usex examples ON OFF)"
#-DITK_USE_REVIEW="$(usex review ON OFF)"
#-DBUILD_TESTING="$(usex test ON OFF)"
#if use python; then
# mycmakeargs+=(
# -DITK_WRAP_PYTHON=ON
# -DITK_WRAP_DIMS="${ITK_WRAP_DIMS:-2;3}"
# )
#else
# mycmakeargs+=(
# -DITK_WRAP_PYTHON=OFF
# )
#fi
cmake-utils_src_configure
} }
src_configure() {
local mycmakeargs=(
-DWRAP_DEFAULT:BOOL=OFF
-DWRAP_TCL:BOOL=$(usex tcl)
-DWRAP_PYTHON:BOOL=$(usex python)
-DBUILD_TESTING:BOOL=OFF
-DSimpleITK_FORBID_DOWNLOADS=ON
-DSimpleITK_PYTHON_USE_VIRTUALENV:BOOL=OFF
-DSimpleITK_EXPLICIT_INSTANTIATION=OFF
-DExternalData_OBJECT_STORES:STRING="${BUILD_DIR}/.ExternalData"
-DSimpleITK_INSTALL_LIBRARY_DIR=$(get_libdir)
-DSimpleITK_LUA_EXECUTABLE:PATH=/usr/bin/lua5.1
-DLUA_EXECUTABLE:PATH=/usr/bin/lua5.1
)
cmake_src_configure
}
# -DUSE_SYSTEM_VIRTUALENV=ON
# -DModule_SimpleITKFilters:BOOL=ON
# -DUSE_SYSTEM_GTEST=ON
# -DUSE_SYSTEM_ITK=ON
# -DUSE_SYSTEM_LUA=ON
# -DUSE_SYSTEM_SWIG=ON
#src_install() { #src_install() {
# cmake-utils_src_install # die
#
# if use examples; then
# insinto /usr/share/doc/${PF}/examples
# docompress -x /usr/share/doc/${PF}/examples
# doins -r "${S}"/Examples/*
# fi
#
# echo "ITK_DATA_ROOT=${EROOT%/}/usr/share/${PN}/data" > ${T}/40${PN}
# local ldpath="${EROOT%/}/usr/$(get_libdir)/InsightToolkit"
# if use python; then
# echo "PYTHONPATH=${EROOT%/}/usr/$(get_libdir)/InsightToolkit/WrapITK/Python" >> "${T}"/40${PN}
# ldpath="${ldpath}:${EROOT%/}/usr/$(get_libdir)/InsightToolkit/WrapITK/lib"
# fi
# echo "LDPATH=${ldpath}" >> "${T}"/40${PN}
# doenvd "${T}"/40${PN}
#
# if use doc; then
# insinto /usr/share/doc/${PF}/api-docs
# cd "${WORKDIR}"/html
# rm *.md5 || die "Failed to remove superfluous hashes"
# einfo "Installing API docs. This may take some time."
# insinto /usr/share/doc/${PF}/api-docs
# doins -r *
# fi
#} #}