Skip to content

Commit 453297e

Browse files
committed
[ENH][pacakges] Enable installation of development files
- This introduces changes to pacakge definitions and new patches to install development files. The motivation is to enable the development of 3D Slicer extensions
1 parent 9889376 commit 453297e

22 files changed

+1771
-322
lines changed

guix-systole/packages.scm

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,17 @@
2626
(string-append directory "/packages/patches") directory))
2727
%load-path))
2828

29-
;; Define a modified %patch-path that includes custom patch directory
3029
(define %patch-path
31-
(make-parameter (list systole-patches
32-
(string-append systole-patches "/slicer")
33-
%original-patch-path)))
30+
(make-parameter (append
31+
(list systole-patches
32+
(string-append systole-patches "/ctk")
33+
(string-append systole-patches "/qrestapi")
34+
(string-append systole-patches "/slicer")
35+
(string-append systole-patches "/slicer-openigtlink")
36+
)
37+
%original-patch-path)))
3438

35-
;; Define search-patch function
39+
;; Define search-patch functio
3640
(define (search-patch file-name)
3741
"Search the patch FILE-NAME. Raise an error if not found."
3842
(or (search-path (%patch-path) file-name)

guix-systole/packages/ctk.scm

Lines changed: 118 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -15,103 +15,113 @@
1515
#:use-module (gnu packages tbb)
1616
#:use-module (gnu packages xiph) ; Theora lib.
1717
#:use-module (gnu packages xml) ; libxml2, expat
18+
#:use-module (gnu packages) ; libxml2, expat
1819
#:use-module (guix build-system cmake)
1920
#:use-module (guix download)
21+
#:use-module (guix gexp)
2022
#:use-module ((guix licenses)
2123
#:prefix license:)
2224
#:use-module (guix packages)
2325
#:use-module (guix-systole packages itk)
24-
#:use-module (guix-systole packages vtk))
26+
#:use-module (guix-systole packages vtk)
27+
#:use-module (guix-systole packages))
2528

2629
;; --------------------------- CTK ---------------------------
2730
(define-public ctk
2831
(package
29-
(name "ctk")
30-
(version "0.1")
31-
(source
32-
(origin
33-
(method url-fetch)
34-
(uri
35-
"https://github.com/commontk/CTK/archive/82cae5781621845486bad2697aed095f04cfbe76.tar.gz")
36-
(sha256
37-
(base32 "1g2jv4hjimf4baqbmpmc29ara2f8gk8604g1v8k243x882f0ls9z"))))
38-
(build-system cmake-build-system)
39-
(arguments
40-
'(#:tests? #f
41-
#:parallel-build? #t ; Scheme building using multiple threads.
42-
#:configure-flags
43-
(list ;; --------------------------- Build Flags ---------------------------
44-
"-DCTK_USE_GIT_PROTOCOL:BOOL=OFF" ;turning off git protocol, as it is not supported by modern GitHub
45-
"-DCTK_SUPERBUILD:BOOL=OFF" ;Disable Superbuild
46-
"-DBUILD_TESTING:BOOL=OFF"
47-
"-DCTK_INSTALL_LIB_DIR=lib" ; Hardcoded path for CTK install directory. Fix for CTK-Widgets.
32+
(name "ctk")
33+
(version "0.1")
34+
(source
35+
(origin
36+
(method url-fetch)
37+
(uri
38+
"https://github.com/commontk/CTK/archive/82cae5781621845486bad2697aed095f04cfbe76.tar.gz")
39+
(sha256
40+
(base32 "1g2jv4hjimf4baqbmpmc29ara2f8gk8604g1v8k243x882f0ls9z"))
41+
(patches (search-patches
42+
"0001-ENH-Fix-locating-DCMTK-when-using-CTK.patch"))
43+
))
44+
(build-system cmake-build-system)
45+
(arguments
46+
(list #:tests? #f
47+
#:parallel-build? #t ; Scheme building using multiple threads.
48+
#:configure-flags
49+
#~(list ;; --------------------------- Build Flags ---------------------------
50+
"-DCTK_USE_GIT_PROTOCOL:BOOL=OFF" ;turning off git protocol, as it is not supported by modern GitHub
51+
"-DCTK_SUPERBUILD:BOOL=OFF" ;Disable Superbuild
52+
"-DBUILD_TESTING:BOOL=OFF"
53+
"-DCTK_INSTALL_LIB_DIR=lib" ; Hardcoded path for CTK install directory. Fix for CTK-Widgets.
4854

49-
;; NOTE: (from Slicer) These may need to change in the future.
50-
"-DCTK_BUILD_QTDESIGNER_PLUGINS:BOOL=ON"
51-
;; "-DCTK_BUILD_QTDESIGNER_PLUGINS:BOOL=${Slicer_BUILD_QT_DESIGNER_PLUGINS}"
52-
;; "-DCTK_INSTALL_QTPLUGIN_DIR:STRING=${Slicer_INSTALL_QtPlugins_DIR}"
53-
;; -------------------------- CTKdata flags --------------------------
54-
;; NOTE: Testing should be reviewed and added at some point
55-
"-DCTK_ENABLE_CTKDATA:BOOL=OFF" ;CTKData is only needed for testing
56-
;; ---------------------------- VTK flags ----------------------------
57-
"-DCTK_USE_SYSTEM_VTK:BOOL=ON"
58-
;; ---------------------------- ITK flags ----------------------------
59-
"-DCTK_USE_SYSTEM_ITK:BOOL=ON"
60-
;; --------------------------- DICOM Flags ---------------------------
61-
"-DCTK_USE_SYSTEM_DCMTK:BOOL=ON"
62-
"-DCTK_APP_ctkDICOM:BOOL=ON"
63-
"-DCTK_LIB_DICOM/Core:BOOL=ON"
64-
"-DCTK_LIB_DICOM/Widgets:BOOL=ON"
65-
;; ------------------------ CTK Widgets Flags-------------------------
66-
"-DCTK_LIB_Widgets:BOOL=ON"
67-
"-DCTK_LIB_Visualization/VTK/Widgets:BOOL=ON" ; \
68-
"-DCTK_LIB_Visualization/VTK/Widgets_USE_TRANSFER_FUNCTION_CHARTS:BOOL=ON" ; -> Needs GuiSupportQT
69-
"-DCTK_LIB_ImageProcessing/ITK/Core:BOOL=ON" ; /
70-
"-DCTK_LIB_PluginFramework:BOOL=OFF"
71-
"-DCTK_PLUGIN_org.commontk.eventbus:BOOL=OFF"
72-
;; ---------------------- PythonQt wrapping ----------------------
73-
"-DCTK_LIB_Scripting/Python/Core:BOOL=OFF"
74-
"-DCTK_LIB_Scripting/Python/Core_PYTHONQT_USE_VTK:BOOL=OFF"
75-
"-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTCORE:BOOL=OFF"
76-
"-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTGUI:BOOL=OFF"
77-
"-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTUITOOLS:BOOL=OFF"
78-
"-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTNETWORK:BOOL=OFF"
79-
"-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTMULTIMEDIA:BOOL=OFF"
80-
"-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTWEBKIT:BOOL=OFF"
81-
"-DCTK_LIB_Scripting/Python/Widgets:BOOL=OFF"
82-
"-DCTK_ENABLE_Python_Wrapping:BOOL=OFF")))
83-
(inputs
84-
(list qtbase-5
85-
qttools-5
86-
qtsvg-5
87-
dcmtk
88-
vtk-slicer
89-
itk-slicer
55+
;; NOTE: (from Slicer) These may need to change in the future.
56+
"-DCTK_BUILD_QTDESIGNER_PLUGINS:BOOL=ON"
57+
;; "-DCTK_BUILD_QTDESIGNER_PLUGINS:BOOL=${Slicer_BUILD_QT_DESIGNER_PLUGINS}"
58+
;; "-DCTK_INSTALL_QTPLUGIN_DIR:STRING=${Slicer_INSTALL_QtPlugins_DIR}"
59+
;; -------------------------- CTKdata flags --------------------------
60+
;; NOTE: Testing should be reviewed and added at some point
61+
"-DCTK_ENABLE_CTKDATA:BOOL=OFF" ;CTKData is only needed for testing
62+
;; ---------------------------- VTK flags ----------------------------
63+
"-DCTK_USE_SYSTEM_VTK:BOOL=ON"
64+
;; ---------------------------- ITK flags ----------------------------
65+
"-DCTK_USE_SYSTEM_ITK:BOOL=ON"
66+
;; --------------------------- DICOM Flags ---------------------------
67+
"-DCTK_USE_SYSTEM_DCMTK:BOOL=ON"
68+
"-DCTK_APP_ctkDICOM:BOOL=ON"
69+
"-DCTK_LIB_DICOM/Core:BOOL=ON"
70+
"-DCTK_LIB_DICOM/Widgets:BOOL=ON"
71+
;; ------------------------ CTK Widgets Flags-------------------------
72+
"-DCTK_LIB_Widgets:BOOL=ON"
73+
"-DCTK_LIB_Visualization/VTK/Widgets:BOOL=ON" ; \
74+
"-DCTK_LIB_Visualization/VTK/Widgets_USE_TRANSFER_FUNCTION_CHARTS:BOOL=ON" ; -> Needs GuiSupportQT
75+
"-DCTK_LIB_ImageProcessing/ITK/Core:BOOL=ON" ; /
76+
"-DCTK_LIB_PluginFramework:BOOL=OFF"
77+
"-DCTK_PLUGIN_org.commontk.eventbus:BOOL=OFF"
78+
;; ---------------------- PythonQt wrapping ----------------------
79+
"-DCTK_LIB_Scripting/Python/Core:BOOL=OFF"
80+
"-DCTK_LIB_Scripting/Python/Core_PYTHONQT_USE_VTK:BOOL=OFF"
81+
"-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTCORE:BOOL=OFF"
82+
"-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTGUI:BOOL=OFF"
83+
"-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTUITOOLS:BOOL=OFF"
84+
"-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTNETWORK:BOOL=OFF"
85+
"-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTMULTIMEDIA:BOOL=OFF"
86+
"-DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTWEBKIT:BOOL=OFF"
87+
"-DCTK_LIB_Scripting/Python/Widgets:BOOL=OFF"
88+
"-DCTK_ENABLE_Python_Wrapping:BOOL=OFF"
89+
(string-append "-DDCMTK_DIR:PATH="
90+
#$(this-package-input "dcmtk")
91+
"/lib/cmake/dcmtk")
92+
)))
93+
(inputs
94+
(list qtbase-5
95+
qttools-5
96+
qtsvg-5
97+
dcmtk
98+
vtk-slicer
99+
itk-slicer
90100
; --- Libraries for Visualization VTK widgets and ITK core ---
91-
hdf5-1.10
92-
python
93-
glew
94-
libtheora
95-
netcdf
96-
proj ; LibPROJ
97-
jsoncpp
98-
libxml2
99-
libharu
100-
gl2ps
101-
libpng-apng
102-
eigen
103-
mpich
104-
expat
105-
double-conversion
106-
lz4
107-
libjpeg-turbo
108-
freetype
109-
tbb))
110-
(home-page "github.com/commontk/CTK")
111-
(synopsis "A set of common support code for medical imaging, surgical
101+
hdf5-1.10
102+
python
103+
glew
104+
libtheora
105+
netcdf
106+
proj ; LibPROJ
107+
jsoncpp
108+
libxml2
109+
libharu
110+
gl2ps
111+
libpng-apng
112+
eigen
113+
mpich
114+
expat
115+
double-conversion
116+
lz4
117+
libjpeg-turbo
118+
freetype
119+
tbb))
120+
(home-page "github.com/commontk/CTK")
121+
(synopsis "A set of common support code for medical imaging, surgical
112122
navigation, and related purposes. ")
113-
(description
114-
"The goal of CTK is to support biomedical image computing. CTK
123+
(description
124+
"The goal of CTK is to support biomedical image computing. CTK
115125
code is licensed under Apache 2.0. This means that users of CTK are allowed to
116126
use the code for academic, commercial, or other purposes without paying license
117127
fees or being restricted in their ability to redistribute their code or keep it
@@ -121,30 +131,30 @@ CTK works on topics that are not covered by existing toolkits that support the
121131
mutual interest and needs of the CTK community. The main scope of current CTK
122132
efforts includes the topics DICOM, DICOM Application Hosting, Widgets, and
123133
Plugin Framework.")
124-
(license license:asl2.0)))
134+
(license license:asl2.0)))
125135

126136
(define-public ctkapplauncher
127137
(package
128-
(name "ctkapplauncher")
129-
(version "0.1")
130-
(source
131-
(origin
132-
(method url-fetch)
133-
(uri
134-
"https://github.com/commontk/AppLauncher/archive/8759e03985738b8a8f3eb74ab516ba4e8ef29988.tar.gz")
135-
(sha256
136-
(base32 "1lrrcg9s39n357z2dhfhv8ff99biivdnwwxaggwvnpv9knppaz83"))))
137-
(build-system cmake-build-system)
138-
(arguments
139-
'(#:tests? #f
140-
#:configure-flags (list "-DBUILD_TESTING=OFF"
141-
"-DCTKAppLauncher_QT_VERSION=5"
142-
"-DCTKAppLauncher_INSTALL_LauncherLibrary=ON"
143-
)))
144-
(inputs (list qtbase-5))
145-
(home-page "http://www.commontk.org/")
146-
(synopsis
147-
"Simple and small program allowing to set the environment of any executable.")
148-
(description
149-
"Simple and small program allowing to set the environment of any executable.")
150-
(license license:asl2.0)))
138+
(name "ctkapplauncher")
139+
(version "0.1")
140+
(source
141+
(origin
142+
(method url-fetch)
143+
(uri
144+
"https://github.com/commontk/AppLauncher/archive/8759e03985738b8a8f3eb74ab516ba4e8ef29988.tar.gz")
145+
(sha256
146+
(base32 "1lrrcg9s39n357z2dhfhv8ff99biivdnwwxaggwvnpv9knppaz83"))))
147+
(build-system cmake-build-system)
148+
(arguments
149+
'(#:tests? #f
150+
#:configure-flags (list "-DBUILD_TESTING=OFF"
151+
"-DCTKAppLauncher_QT_VERSION=5"
152+
"-DCTKAppLauncher_INSTALL_LauncherLibrary=ON"
153+
)))
154+
(inputs (list qtbase-5))
155+
(home-page "http://www.commontk.org/")
156+
(synopsis
157+
"Simple and small program allowing to set the environment of any executable.")
158+
(description
159+
"Simple and small program allowing to set the environment of any executable.")
160+
(license license:asl2.0)))

guix-systole/packages/itk.scm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
"-DBUILD_EXAMPLES:BOOL=OFF"
4848
"-DITK_WRAPPING:BOOL=OFF"
4949
"-DITK_BUILD_DEFAULT_MODULES:BOOL=ON"
50-
"-DITK_INSTALL_NO_DEVELOPMENT:BOOL=ON"
5150
"-DITK_WRAP_PYTHON:BOOL=OFF"
5251
"-DKWSYS_USE_MD5:BOOL=ON" ;Required by SlicerExecutionModel
5352
"-DITK_USE_SYSTEM_DCMTK:BOOL=ON"
@@ -70,7 +69,7 @@
7069
"-DITK_LEGACY_REMOVE:BOOL=OFF" ;<-- Allow LEGACY ITKv4 features for now.
7170
"-DITK_LEGACY_SILENT:BOOL=OFF" ;<-- Use of legacy code will produce compiler warnings
7271
"-DModule_ITKDeprecated:BOOL=ON" ;<-- Needed for ITKv5 now. (itkMultiThreader.h and MutexLock backwards compatibility.)
73-
72+
7473
;; Optimization
7574
"-DITK_CXX_OPTIMIZATION_FLAGS:STRING=" ;Force compiler-default instruction set to ensure compatibility with older CPUs
7675
"-DITK_C_OPTIMIZATION_FLAGS:STRING=" ;Force compiler-default instruction set to ensure compatibility with older CPUs
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
From 496cb3feca5b34185382f62a93539f7b810f15e9 Mon Sep 17 00:00:00 2001
2+
From: Rafael Palomar <[email protected]>
3+
Date: Sat, 10 May 2025 13:05:32 +0200
4+
Subject: [PATCH] ENH: Allow passing DCMTK_DIR for system DCMTK
5+
6+
---
7+
CMakeExternals/DCMTK.cmake | 15 ++++++++-------
8+
1 file changed, 8 insertions(+), 7 deletions(-)
9+
10+
diff --git a/CMakeExternals/DCMTK.cmake b/CMakeExternals/DCMTK.cmake
11+
index afd37880..32dfbb8c 100644
12+
--- a/CMakeExternals/DCMTK.cmake
13+
+++ b/CMakeExternals/DCMTK.cmake
14+
@@ -6,13 +6,6 @@ set(proj DCMTK)
15+
16+
set(${proj}_DEPENDENCIES "")
17+
18+
-ExternalProject_Include_Dependencies(${proj}
19+
- PROJECT_VAR proj
20+
- DEPENDS_VAR ${proj}_DEPENDENCIES
21+
- EP_ARGS_VAR ${proj}_EXTERNAL_PROJECT_ARGS
22+
- USE_SYSTEM_VAR ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj}
23+
- )
24+
-
25+
# Let the user to chose whether to use libs installed in the system
26+
option(${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj} "Use installed ${proj} library in the system" OFF)
27+
mark_as_advanced(${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
28+
@@ -20,6 +13,7 @@ mark_as_advanced(${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
29+
if(${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
30+
unset(DCMTK_DIR CACHE)
31+
find_package(DCMTK REQUIRED)
32+
+ message(FATAL_ERROR ${DCMTK_LIBRARIES})
33+
endif()
34+
35+
# Sanity checks
36+
@@ -27,6 +21,13 @@ if(DEFINED DCMTK_DIR AND NOT EXISTS ${DCMTK_DIR})
37+
message(FATAL_ERROR "DCMTK_DIR variable is defined but corresponds to non-existing directory")
38+
endif()
39+
40+
+ExternalProject_Include_Dependencies(${proj}
41+
+ PROJECT_VAR proj
42+
+ DEPENDS_VAR ${proj}_DEPENDENCIES
43+
+ EP_ARGS_VAR ${proj}_EXTERNAL_PROJECT_ARGS
44+
+ USE_SYSTEM_VAR ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj}
45+
+ )
46+
+
47+
if(NOT DEFINED DCMTK_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
48+
set(revision_tag "11972eaa4ecdbf3aab0f46eff78f33d7e2b16bfe") # patched-DCMTK-3.6.6_20210115
49+
if(${proj}_REVISION_TAG)
50+
--
51+
2.49.0
52+

0 commit comments

Comments
 (0)