Subject: [PATCH 1/2] gnu: Remove shogun.

From: Andreas Enge <[email-masked]>
Date: Thu, 27 Mar 2025 20:49:43 +0100

* gnu/packages/machine-learning.scm (shogun): Delete variable.

The package depends on atlas, which does not build any more. The ftp
server that is supposed to contain the source code has become private
and does not accept anonymous connections. The package has not been
updated since 2018. It has no dependent packages.

Change-Id: Ia2e1ef51180397a056410fd8d33ce2827623aaa0
---
 gnu/packages/machine-learning.scm | 148 ------------------------------
 1 file changed, 148 deletions(-)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 4ea05a7752..818e208a37 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1422,154 +1422,6 @@ (define-public python-spacy
 model packaging, deployment and workflow management.")
     (license license:expat)))
 
-(define-public shogun
-  (package
-    (name "shogun")
-    (version "6.1.3")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append
-             "ftp://shogun-toolbox.org/shogun/releases/"
-             (version-major+minor version)
-             "/sources/shogun-" version ".tar.bz2"))
-       (sha256
-        (base32
-         "1rn9skm3nw6hr7mr3lgp2gfqhi7ii0lyxck7qmqnf8avq349s5jp"))
-       (modules '((guix build utils)
-                  (ice-9 rdelim)))
-       (snippet
-        '(begin
-           ;; Remove non-free sources and files referencing them
-           (for-each delete-file
-                     (find-files "src/shogun/classifier/svm/"
-                                 "SVMLight\\.(cpp|h)"))
-           (for-each delete-file
-                     (find-files "examples/undocumented/libshogun/"
-                                 (string-append
-                                  "(classifier_.*svmlight.*|"
-                                  "evaluation_cross_validation_locked_comparison).cpp")))
-           ;; Remove non-free functions.
-           (define (delete-ifdefs file)
-             (with-atomic-file-replacement file
-               (lambda (in out)
-                 (let loop ((line (read-line in 'concat))
-                            (skipping? #f))
-                   (if (eof-object? line)
-                       #t
-                       (let ((skip-next?
-                              (or (and skipping?
-                                       (not (string-prefix?
-                                             "#endif //USE_SVMLIGHT" line)))
-                                  (string-prefix?
-                                   "#ifdef USE_SVMLIGHT" line))))
-                         (when (or (not skipping?)
-                                   (and skipping? (not skip-next?)))
-                           (display line out))
-                         (loop (read-line in 'concat) skip-next?)))))))
-           (for-each delete-ifdefs
-                     (append
-                      (find-files "src/shogun/classifier/mkl"
-                                  "^MKLClassification\\.cpp")
-                      (find-files "src/shogun/classifier/svm"
-                                  "^SVMLightOneClass\\.(cpp|h)")
-                      (find-files "src/shogun/multiclass"
-                                  "^ScatterSVM\\.(cpp|h)")
-                      (find-files "src/shogun/kernel/"
-                                  "^(Kernel|CombinedKernel|ProductKernel)\\.(cpp|h)")
-                      (find-files "src/shogun/regression/svr"
-                                  "^(MKLRegression|SVRLight)\\.(cpp|h)")
-                      (find-files "src/shogun/transfer/domain_adaptation"
-                                  "^DomainAdaptationSVM\\.(cpp|h)")))
-           #t))))
-    (build-system cmake-build-system)
-    (arguments
-     '(#:tests? #f ;no check target
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'delete-broken-symlinks
-           (lambda _
-             (for-each delete-file '("applications/arts/data"
-                                     "applications/asp/data"
-                                     "applications/easysvm/data"
-                                     "applications/msplicer/data"
-                                     "applications/ocr/data"
-                                     "examples/meta/data"
-                                     "examples/undocumented/data"))
-             #t))
-         (add-after 'unpack 'change-R-target-path
-           (lambda* (#:key outputs #:allow-other-keys)
-             (substitute* '("src/interfaces/r/CMakeLists.txt"
-                            "examples/meta/r/CMakeLists.txt")
-               (("\\$\\{R_COMPONENT_LIB_PATH\\}")
-                (string-append (assoc-ref outputs "out")
-                               "/lib/R/library/")))
-             #t))
-         (add-after 'unpack 'fix-octave-modules
-           (lambda* (#:key outputs #:allow-other-keys)
-             (substitute* "src/interfaces/octave/CMakeLists.txt"
-               (("^include_directories\\(\\$\\{OCTAVE_INCLUDE_DIRS\\}")
-                "include_directories(${OCTAVE_INCLUDE_DIRS} ${OCTAVE_INCLUDE_DIRS}/octave")
-               ;; change target directory
-               (("\\$\\{OCTAVE_OCT_LOCAL_API_FILE_DIR\\}")
-                (string-append (assoc-ref outputs "out")
-                               "/share/octave/packages")))
-             (substitute* '("src/interfaces/octave/swig_typemaps.i"
-                            "src/interfaces/octave/sg_print_functions.cpp")
-               ;; "octave/config.h" and "octave/oct-obj.h" deprecated in Octave.
-               (("octave/config\\.h") "octave/octave-config.h")
-               (("octave/oct-obj.h") "octave/ovl.h"))
-             #t))
-         (add-after 'unpack 'move-rxcpp
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let ((rxcpp-dir "shogun/third-party/rxcpp"))
-               (mkdir-p rxcpp-dir)
-               (install-file (assoc-ref inputs "rxcpp") rxcpp-dir)
-               #t)))
-         (add-before 'build 'set-HOME
-           ;; $HOME needs to be set at some point during the build phase
-           (lambda _ (setenv "HOME" "/tmp") #t)))
-       #:configure-flags
-       (list "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
-             "-DUSE_SVMLIGHT=OFF" ;disable proprietary SVMLIGHT
-             "-DBUILD_META_EXAMPLES=OFF" ;requires unpackaged ctags
-             ;;"-DINTERFACE_JAVA=ON" ;requires unpackaged jblas
-             ;;"-DINTERFACE_RUBY=ON" ;requires unpackaged ruby-narray
-             ;;"-DINTERFACE_PERL=ON" ;"FindPerlLibs" does not exist
-             ;;"-DINTERFACE_LUA=ON"  ;fails because lua doesn't build pkgconfig file
-             "-DINTERFACE_OCTAVE=ON"
-             "-DINTERFACE_PYTHON=ON"
-             "-DINTERFACE_R=ON")))
-    (inputs
-     `(("python" ,python)
-       ("numpy" ,python-numpy)
-       ("r-minimal" ,r-minimal)
-       ("octave" ,octave-cli)
-       ("swig" ,swig)
-       ("eigen" ,eigen)
-       ("hdf5" ,hdf5)
-       ("atlas" ,atlas)
-       ("arpack" ,arpack-ng)
-       ("openblas" ,openblas)
-       ("glpk" ,glpk)
-       ("libxml2" ,libxml2)
-       ("lzo" ,lzo)
-       ("zlib" ,zlib)))
-    (native-inputs
-     (list pkg-config rxcpp))
-    ;; Non-portable SSE instructions are used so building fails on platforms
-    ;; other than x86_64.
-    (supported-systems '("x86_64-linux"))
-    (home-page "https://shogun-toolbox.org/")
-    (synopsis "Machine learning toolbox")
-    (description
-     "The Shogun Machine learning toolbox provides a wide range of unified and
-efficient Machine Learning (ML) methods.  The toolbox seamlessly
-combines multiple data representations, algorithm classes, and general purpose
-tools.  This enables both rapid prototyping of data pipelines and extensibility
-in terms of new algorithms.")
-    (license license:gpl3+)))
-
 (define-public onnx
   (package
     (name "onnx")
-- 
2.49.0