summaryrefslogtreecommitdiff
path: root/test-kwin.scm
blob: e0a89c3d2a12760ebe18bbca3883f3cb1bc175d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
;; rm -rf /tmp/guix-build-kwin-5.10.4.drv-*
;; ./pre-inst-env guix build -K kwin
;; tar c -C /tmp/guix-build-kwin-5.10.4.drv-0 -f /tmp/guix-build-kwin-prebuild.tar .
;; ./pre-inst-env guix build -K -e '(@ (gnu packages kde-plasma) kwin-test)'
;; ./pre-inst-env guix build -K -f test-kwin.scm

(use-modules (guix)
             (guix build-system gnu)
             (gnu packages kde-plasma)
             (gnu packages kde-frameworks)
             (gnu packages qt)
             (gnu packages xorg) ;; for X11 server and Xwayland
             (gnu packages xdisorg)
             (gnu packages glib) ;; for dbus
             (gnu packages linux) ;; for strace

             (gnu packages base)
             (gnu packages boost)
             (gnu packages bootloaders)
             (gnu packages compression)
             (gnu packages fonts)
             (gnu packages fontutils)
             (gnu packages freedesktop)
             (gnu packages gl)
             (gnu packages glib)
             (gnu packages gnome)
             (gnu packages gnupg)
             (gnu packages iso-codes)
             (gnu packages networking)
             (gnu packages pkg-config)
             (gnu packages polkit)
             (gnu packages pulseaudio)
             
;             (srfi srfi-1)
             )

(define OUT "/gnu/store/p96xaxq0nyvihsvj1rqy3f5ahvibpkvx-kwin-5.10.4")

;;;http://svnweb.mageia.org/packages/cauldron/kf5-macros/releases/5.38.0/1.mga7/SOURCES/kf5.macros?revision=1161289&view=co


(package (inherit kwin)
    (source (local-file "/tmp/guix-build-kwin-prebuild.tar"))
    (native-inputs
     `(("dbus" ,dbus)
       ("xorg-server" ,xorg-server) ; required for running the tests
       ("xorg-server-xwayland" ,xorg-server-xwayland) ; required for running the tests
       ("kwayland-integration" ,kwayland-integration) ; required for running the tests
       ("kwindowsystem" ,kwindowsystem) ; required for running the tests
       ("plasma-framework" ,plasma-framework) ;; maybe
       ("breeze" ,breeze) ;; maybe?
       ("qtwayland" ,qtwayland) ;; meybe propagate with kwayland?
       ("libxkbcommon" ,libxkbcommon) ;; maybe?
       ("strace" ,strace)


       ("breeze" ,breeze)
       ("fontconfig" ,fontconfig)
       ("freetype" ,freetype)
       ("kactivities" ,kactivities)
       ("kcmutils" ,kcmutils)
       ("kcompletion" ,kcompletion)
       ("kconfig" ,kconfig)
       ("kconfigwidgets" ,kconfigwidgets)
       ("kcoreaddons" ,kcoreaddons)
       ("kcrash" ,kcrash)
       ("kdeclarative" ,kdeclarative)
       ("kdecoration" ,kdecoration)
       ("kglobalaccel" ,kglobalaccel)
       ("ki18n" ,ki18n)
       ("kiconthemes" ,kiconthemes)
       ("kidletime" ,kidletime)
       ("kinit" ,kinit)
       ("kio" ,kio)
       ("knewstuff" ,knewstuff)
       ("knotifications" ,knotifications)
       ("kpackage" ,kpackage)
       ("kscreenlocker" ,kscreenlocker)
       ("kservice" ,kservice)
       ("ktextwidgets" ,ktextwidgets)
       ("kwayland" ,kwayland)
       ("kwidgetsaddons" ,kwidgetsaddons)
       ("kwindowsystem" ,kwindowsystem)
       ("kxmlgui" ,kxmlgui)
       ("libdrm" ,libdrm)
       ("libepoxy" ,libepoxy)
       ("libice" ,libice) ;; missing in CMakeList.txt
       ("libinput" ,libinput)
       ("libsm" ,libsm) ;; missing in CMakeList.txt
       ("libxkbcommon" ,libxkbcommon)
       ("plasma-framework" ,plasma-framework)
       ("qtbase" ,qtbase)
       ("qtdeclarative" ,qtdeclarative)
       ("qtmultimedia" ,qtmultimedia)
       ("qtscript" ,qtscript)
       ("qtx11extras" ,qtx11extras)
       ("wayland" ,wayland)
       ("xcb-util-cursor" ,xcb-util-cursor)
       ("xcb-util-image" ,xcb-util-image)
       ("xcb-util-keysyms" ,xcb-util-keysyms)

       
    ;;    ,@(alist-delete
    ;;       "python"
       ,@(package-native-inputs kwin)))
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'chdir
           (lambda _
             (chdir "../build")))
         (delete 'configure)
         (delete 'build)
         (delete 'check)
         (delete 'check-setup)
         (add-after 'install 'check
         ;;   (assoc-ref %standard-phases 'check))
         ;;(replace 'check
           (lambda _
             (zero? (system*
                     ;;"dbus-launch"
                     "strace" "-f" "-e" "trace=all" "-o" "../trace.txt"
                     ;;"autotests/integration/testStart"
                     "ctest" "." ;;"--verbose"
                     "-E" "kwin-testXClipboardSync"
                     ;; ;;"-R" "kwin-testDontCrashGlxgears$"
                     ;;"-R" "kwin-testStart"
                     ))))
         ;;(delete 'install)
         (add-after 'check 'kill-daemons
           (lambda _
             (system "ps as")
             (system "echo ----------------------")
             (system "killall --user")
             (system "ps as")
             (system "echo ----------------------")
             #t))
         (add-before 'check 'check-setup
           (lambda* (#:key inputs outputs #:allow-other-keys)
             ;; make Qt render "offscreen", required for tests
             ;(setenv "QT_QPA_PLATFORM" "offscreen")
             (setenv "DBUS_FATAL_WARNINGS" "0")
             (setenv "XDG_RUNTIME_DIR" "..")
             (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
             (setenv "HOME" (getcwd))
             (setenv "DBUS_FATAL_WARNINGS" "0")
             (setenv "QT_PLUGIN_PATH"
                     (string-append
                      ,OUT "/lib/qt5/plugins:"
                      ;(assoc-ref inputs "kwindowsystem") "/lib/qt5/plugins:"
                      (getenv "QT_PLUGIN_PATH")))
             ;; The test suite requires a running X server, setting
             ;; QT_QPA_PLATFORM=offscreen does not suffice and even make
             ;; some tests fail.
             (system (string-append (assoc-ref inputs "xorg-server")
                                   "/bin/Xvfb :1 -screen 0 640x480x24 &"))
             (setenv "DISPLAY" ":1")
             (system* "ls" "-l"
                      ,OUT
                      ,(string-append OUT "/lib/qt5/plugins"))
             #t))
    ))))