summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--user/kst/APKBUILD48
-rw-r--r--user/kst/kst-gsl2.patch154
2 files changed, 202 insertions, 0 deletions
diff --git a/user/kst/APKBUILD b/user/kst/APKBUILD
new file mode 100644
index 000000000..4709cd4c8
--- /dev/null
+++ b/user/kst/APKBUILD
@@ -0,0 +1,48 @@
+# Contributor: A. Wilcox <awilfox@adelielinux.org>
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+pkgname=kst
+pkgver=2.0.8
+pkgrel=0
+pkgdesc="Real-time dataset viewing and plotting tool"
+url="https://kst-plot.kde.org/"
+arch="all"
+license="GPL-2.0-only"
+depends=""
+makedepends="cmake extra-cmake-modules qt5-qtbase-dev qt5-qttools-dev gsl-dev"
+install=""
+langdir="/usr/share/kst/locale"
+subpackages="$pkgname-doc $pkgname-lang"
+source="https://downloads.sourceforge.net/project/kst/Kst%20$pkgver/Kst-$pkgver.tar.gz
+ kst-gsl2.patch"
+builddir="$srcdir/Kst-$pkgver"
+
+build() {
+ cd "$builddir"
+ if [ "$CBUILD" != "$CHOST" ]; then
+ CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
+ fi
+ cmake \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DBUILD_SHARED_LIBS=True \
+ -DCMAKE_BUILD_TYPE=RelWithDebugInfo \
+ -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
+ -DCMAKE_C_FLAGS="$CFLAGS" \
+ -Dkst_qt5="YesPlease" \
+ -Dkst_install_prefix="/usr" \
+ ${CMAKE_CROSSOPTS}
+ make
+}
+
+check() {
+ cd "$builddir"
+ CTEST_OUTPUT_ON_FAILURE=TRUE ctest
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="81be1e9ef189dbf087c5626b984297d4c8f84f22fce50c4933ea467a65f8595c0254af78d55f2b2e324934346f0758b7a0cf48d06d1108026b60b7ffba1221fb Kst-2.0.8.tar.gz
+1dbd94d7e4298d768ab1e9e020dd207b848e72b30db6b1f2ef2f3eb0d528ec5c0a120593e7e7c06f4cb1e59e950a965e217c30564a26510a180d82418628d4e5 kst-gsl2.patch"
diff --git a/user/kst/kst-gsl2.patch b/user/kst/kst-gsl2.patch
new file mode 100644
index 000000000..0edbfe7fd
--- /dev/null
+++ b/user/kst/kst-gsl2.patch
@@ -0,0 +1,154 @@
+--- Kst-2.0.8/src/plugins/fits/non_linear.h 2014-02-13 18:41:44.000000000 +0900
++++ Kst-2.0.8/src/plugins/fits/non_linear.h 2016-03-04 00:34:31.000000000 +0900
+@@ -177,37 +177,45 @@
+ }
+ iIterations++;
+ } while( iStatus == GSL_CONTINUE && iIterations < MAX_NUM_ITERATIONS );
+- gsl_multifit_covar( pSolver->J, 0.0, pMatrixCovariance );
+-
+- //
+- // determine the fitted values...
+- //
+- for( i=0; i<NUM_PARAMS; i++ ) {
+- dXInitial[i] = gsl_vector_get( pSolver->x, i );
+- }
+-
+- for( i=0; i<iLength; i++ ) {
+- vectorOutYFitted->value()[i] = function_calculate( pInputX[i], dXInitial );
+- vectorOutYResiduals->value()[i] = pInputY[i] - vectorOutYFitted->value()[i];
++
++
++ gsl_matrix *J = gsl_matrix_alloc(pSolver->fdf->n, pSolver->fdf->p);
++ if (J != NULL) {
++ gsl_multifit_fdfsolver_jac(pSolver, J);
++
++ gsl_multifit_covar( J, 0.0, pMatrixCovariance );
++
++ //
++ // determine the fitted values...
++ //
++ for( i=0; i<NUM_PARAMS; i++ ) {
++ dXInitial[i] = gsl_vector_get( pSolver->x, i );
++ }
++
++ for( i=0; i<iLength; i++ ) {
++ vectorOutYFitted->value()[i] = function_calculate( pInputX[i], dXInitial );
++ vectorOutYResiduals->value()[i] = pInputY[i] - vectorOutYFitted->value()[i];
++ }
++
++ //
++ // fill in the parameter values and covariance matrix...
++ //
++ for( i=0; i<NUM_PARAMS; i++ ) {
++ vectorOutYParameters->value()[i] = gsl_vector_get( pSolver->x, i );
++ for( j=0; j<NUM_PARAMS; j++ ) {
++ vectorOutYCovariance->value()[(i*NUM_PARAMS)+j] = gsl_matrix_get( pMatrixCovariance, i, j );
++ }
++ }
++
++ //
++ // determine the value of chi^2/nu
++ //
++ scalarOutChi->setValue(gsl_blas_dnrm2( pSolver->f ));
++
++ bReturn = true;
++
++ gsl_matrix_free( J );
+ }
+-
+- //
+- // fill in the parameter values and covariance matrix...
+- //
+- for( i=0; i<NUM_PARAMS; i++ ) {
+- vectorOutYParameters->value()[i] = gsl_vector_get( pSolver->x, i );
+- for( j=0; j<NUM_PARAMS; j++ ) {
+- vectorOutYCovariance->value()[(i*NUM_PARAMS)+j] = gsl_matrix_get( pMatrixCovariance, i, j );
+- }
+- }
+-
+- //
+- // determine the value of chi^2/nu
+- //
+- scalarOutChi->setValue(gsl_blas_dnrm2( pSolver->f ));
+-
+- bReturn = true;
+-
+ gsl_matrix_free( pMatrixCovariance );
+ }
+ gsl_multifit_fdfsolver_free( pSolver );
+--- Kst-2.0.8/src/plugins/fits/non_linear_weighted.h 2014-02-13 18:41:44.000000000 +0900
++++ Kst-2.0.8/src/plugins/fits/non_linear_weighted.h 2016-03-04 00:37:41.000000000 +0900
+@@ -193,37 +193,43 @@
+ }
+ while( iStatus == GSL_CONTINUE && iIterations < MAX_NUM_ITERATIONS );
+
+- gsl_multifit_covar( pSolver->J, 0.0, pMatrixCovariance );
+-
+- //
+- // determine the fitted values...
+- //
+- for( i=0; i<NUM_PARAMS; i++ ) {
+- dXInitial[i] = gsl_vector_get( pSolver->x, i );
+- }
+-
+- for( i=0; i<iLength; i++ ) {
+- vectorOutYFitted->value()[i] = function_calculate( pInputs[XVALUES][i], dXInitial );
+- vectorOutYResiduals->value()[i] = pInputs[YVALUES][i] - vectorOutYFitted->value()[i];
+- }
+-
+- //
+- // fill in the parameter values and covariance matrix...
+- //
+- for( i=0; i<NUM_PARAMS; i++ ) {
+- vectorOutYParameters->value()[i] = gsl_vector_get( pSolver->x, i );
+- for( j=0; j<NUM_PARAMS; j++ ) {
+- vectorOutYCovariance->value()[(i*NUM_PARAMS)+j] = gsl_matrix_get( pMatrixCovariance, i, j );
+- }
++ gsl_matrix *J = gsl_matrix_alloc(pSolver->fdf->n, pSolver->fdf->p);
++ if (J != NULL) {
++ gsl_multifit_fdfsolver_jac(pSolver, J);
++
++ gsl_multifit_covar( J, 0.0, pMatrixCovariance );
++
++ //
++ // determine the fitted values...
++ //
++ for( i=0; i<NUM_PARAMS; i++ ) {
++ dXInitial[i] = gsl_vector_get( pSolver->x, i );
++ }
++
++ for( i=0; i<iLength; i++ ) {
++ vectorOutYFitted->value()[i] = function_calculate( pInputs[XVALUES][i], dXInitial );
++ vectorOutYResiduals->value()[i] = pInputs[YVALUES][i] - vectorOutYFitted->value()[i];
++ }
++
++ //
++ // fill in the parameter values and covariance matrix...
++ //
++ for( i=0; i<NUM_PARAMS; i++ ) {
++ vectorOutYParameters->value()[i] = gsl_vector_get( pSolver->x, i );
++ for( j=0; j<NUM_PARAMS; j++ ) {
++ vectorOutYCovariance->value()[(i*NUM_PARAMS)+j] = gsl_matrix_get( pMatrixCovariance, i, j );
++ }
++ }
++
++ //
++ // determine the value of chi^2/nu
++ //
++ scalarOutChi->setValue(gsl_blas_dnrm2( pSolver->f ));
++
++ bReturn = true;
++
++ gsl_matrix_free( J );
+ }
+-
+- //
+- // determine the value of chi^2/nu
+- //
+- scalarOutChi->setValue(gsl_blas_dnrm2( pSolver->f ));
+-
+- bReturn = true;
+-
+ gsl_matrix_free( pMatrixCovariance );
+ }
+ gsl_multifit_fdfsolver_free( pSolver );