tdf#163956 calculate line height differently in FORMTEXT
[LibreOffice.git] / .configurations / user_steps.dsc.yaml
blob21646c12cc7472d91cd60a72269b34d1912845de
1 # yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
3 # configuration to setup the dependencies in ~/lo and add make, jom and clang-format to ~/bin
4 # and install a wsl distro with the required packages
5 # this configuration is meant to be applied as the build user, and after the admin_java_and_deps one
6 # has been applied. It also creates a ~/lo/autogen.input with some sensible defaults that can be
7 # used as a template for own modifications
9 properties:
10   assertions:
11     - resource: xPSDesiredStateConfiguration/xScript
12       id: prerequisitecheck
13       directives:
14         description: check that everything had been downloaded by the admin-step
15       settings:
16         GetScript: return $false
17         SetSCript: return $false
18         # the empty string element is so that each file can be specified with trailing comma
19         TestScript: |
20           $files = @(
21               "WindowsUCRT.zip",
22               "apache-ant-1.10.15-bin.zip",
23               "clang-format-5.0.0-win.exe",
24               "jom_1_1_4.zip",
25               "junit-4.10.jar",
26               "make-4.2.1-msvc.exe",
27               "strawberry-perl-5.40.0.1-64bit-portable.zip",
28           "")
29           !(($files | foreach {Test-Path "$env:PUBLIC/Downloads/$_"}) -contains $false)
30     - resource: xPSDesiredStateConfiguration/xScript
31       id: wsl-check
32       directives:
33         description: check that wsl utility is available/working - i.e. whether wsl is installed
34       settings:
35         TestScript: wsl.exe --status ; return ![bool]$LASTEXITCODE
36         GetScript: return $false
37         SetScript: return $false
38   resources:
39     - resource: xPSDesiredStateConfiguration/xScript
40       id: bindir
41       directives:
42         description: create the ~/bin directory
43       settings:
44         TestScript: Test-Path -Path "$env:UserProfile/bin" -PathType "Container"
45         GetScript:  Test-Path -Path "$env:UserProfile/bin" -PathType "Container"
46         SetScript: New-Item -ItemType "directory" -Path "$env:UserProfile" -Name "bin"
47     - resource: xPSDesiredStateConfiguration/xScript
48       id: lodir
49       directives:
50         description: create the ~/lo directory
51       settings:
52         TestScript: Test-Path -Path "$env:UserProfile/lo" -PathType "Container"
53         GetScript:  Test-Path -Path "$env:UserProfile/lo" -PathType "Container"
54         SetScript: New-Item -ItemType "directory" -Path "$env:UserProfile" -Name "lo"
55     - resource: xPSDesiredStateConfiguration/xScript
56       id: make
57       dependsOn:
58         - bindir
59       directives:
60         description: copy make.exe to the ~/bin directory
61       settings:
62         TestScript: Test-Path -Path "$env:USERPROFILE/bin/make.exe"
63         GetScript:  Test-Path -Path "$env:USERPROFILE/bin/make.exe"
64         SetScript: Copy-Item -Path "$env:PUBLIC/Downloads/make-4.2.1-msvc.exe" -Destination "$env:USERPROFILE/bin/make.exe"
65     - resource: xPSDesiredStateConfiguration/xScript
66       id: clang-format
67       dependsOn:
68         - bindir
69       directives:
70         description: copy clang-format.exe to the ~/bin directory
71       settings:
72         TestScript: Test-Path -Path "$env:USERPROFILE/bin/clang-format.exe"
73         GetScript:  Test-Path -Path "$env:USERPROFILE/bin/clang-format.exe"
74         SetScript: Copy-Item -LiteralPath "$env:PUBLIC/Downloads/clang-format-5.0.0-win.exe" -Destination "$env:USERPROFILE/bin/clang-format.exe"
75     - resource: xPSDesiredStateConfiguration/xScript
76       id: junit
77       dependsOn:
78         - lodir
79       directives:
80         description: copy junit to the ~/lo directory
81       settings:
82         TestScript: Test-Path -Path "$env:USERPROFILE/lo/junit-4.10.jar"
83         GetScript:  Test-Path -Path "$env:USERPROFILE/lo/junit-4.10.jar"
84         SetScript: Copy-Item -LiteralPath "$env:PUBLIC/Downloads/junit-4.10.jar" -Destination "$env:USERPROFILE/lo/junit-4.10.jar"
85     # the DSC Archive module doesn't operate with $env:FOO / would need hardcoded paths
86     - resource: xPSDesiredStateConfiguration/xScript
87       id: ant-extract
88       dependsOn:
89         - lodir
90       directives:
91         description: extract ant to the ~/lo directory
92       settings:
93         TestScript: Test-Path -Path "$env:USERPROFILE/lo/apache-ant-1.10.15/bin/ant"
94         GetScript:  Test-Path -Path "$env:USERPROFILE/lo/apache-ant-1.10.15/bin/ant"
95         SetScript: Expand-Archive -LiteralPath "$env:PUBLIC/Downloads/apache-ant-1.10.15-bin.zip" -Destination "$env:USERPROFILE/lo/"
96     - resource: xPSDesiredStateConfiguration/xScript
97       id: ucrt-extract
98       dependsOn:
99         - lodir
100       directives:
101         description: extract ucrts to the ~/lo directory
102       settings:
103         TestScript: Test-Path -Path "$env:USERPROFILE/lo/ucrt/Windows8.1-KB2999226-x64.msu"
104         GetScript:  Test-Path -Path "$env:USERPROFILE/lo/ucrt/Windows8.1-KB2999226-x64.msu"
105         SetScript: Expand-Archive -LiteralPath "$env:PUBLIC/Downloads/WindowsUCRT.zip" -Destination "$env:USERPROFILE/lo/ucrt"
106     - resource: xPSDesiredStateConfiguration/xScript
107       id: spp-extract
108       dependsOn:
109         - lodir
110       directives:
111         description: extract strawberry-perl-portable to the ~/lo directory
112       settings:
113         TestScript: Test-Path -Path "$env:USERPROFILE/lo/spp/perl/bin/perl.exe"
114         GetScript:  Test-Path -Path "$env:USERPROFILE/lo/spp/perl/bin/perl.exe"
115         SetScript: Expand-Archive -LiteralPath "$env:PUBLIC/Downloads/strawberry-perl-5.40.0.1-64bit-portable.zip" -Destination "$env:USERPROFILE/lo/spp"
116     - resource: xPSDesiredStateConfiguration/xScript
117       id: spp-install-font-ttf
118       dependsOn:
119         - spp-extract
120       directives:
121         description: install perl-font-TTF to spp via cpan
122       settings:
123         TestScript: Test-Path -Path "$env:USERPROFILE/lo/spp/perl/site/lib/Font/TTF.pm"
124         GetScript:  Test-Path -Path "$env:USERPROFILE/lo/spp/perl/site/lib/Font/TTF.pm"
125         SetScript: |
126           $env:Path = "$env:USERPROFILE/lo/spp/c/bin;$env:USERPROFILE/lo/spp/perl/bin;$env:path"
127           cpanm Font::TTF
128     - resource: xPSDesiredStateConfiguration/xScript
129       id: jom
130       dependsOn:
131         - bindir
132         - lodir
133       directives:
134         description: extract and copy jom to the ~/bin directory
135       settings:
136         TestScript: Test-Path -Path "$env:USERPROFILE/bin/jom.exe"
137         GetScript:  Test-Path -Path "$env:USERPROFILE/bin/jom.exe"
138         SetScript: |
139           Expand-Archive -LiteralPath "$env:PUBLIC/Downloads/jom_1_1_4.zip" -Destination "$env:USERPROFILE/lo/jom_unpack"
140           Copy-Item -LiteralPath "$env:USERPROFILE/lo/jom_unpack/jom.exe" -Destination "$env:USERPROFILE/bin/jom.exe"
141           Remove-Item -LiteralPath "$env:USERPROFILE/lo/jom_unpack" -Recurse
142     - resource: xPSDesiredStateConfiguration/xScript
143       id: gitsettings
144       directives:
145         description: configure git to use protocol.version 2 and core.autocrlf false
146       settings:
147         TestScript: return $false
148         GetScript:  return $false
149         SetScript: |
150           git config --global core.autocrlf false
151           git config --global protocol.version 2
152     - resource: xPSDesiredStateConfiguration/xScript
153       id: autogensnippet
154       dependsOn:
155         - lodir
156       directives:
157         description: create an autogen.input snippet with some sensible defaults
158       settings:
159         TestScript: Test-Path -Path "$env:USERPROFILE/lo/autogen.input"
160         GetScript:  Test-Path -Path "$env:USERPROFILE/lo/autogen.input"
161         SetScript: |
162           New-Item -Path "$env:USERPROFILE/lo" -Name "autogen.input" -ItemType "file" -Value "# adjust to your needs
163           --host=x86_64-pc-cygwin
164           #--host=i686-pc-cygwin
165           --disable-ccache
166           --with-visual-studio=2022
167           --enable-python=fully-internal
168           --without-lxml
169           --disable-online-update
170           --with-external-tar=$env:USERPROFILE\lo\lo-externaltar
171           --with-strawberry-perl-portable=$env:USERPROFILE\lo\spp
172           --with-ant-home=$env:USERPROFILE\lo\apache-ant-1.10.15
173           --with-junit=$env:USERPROFILE\lo\junit-4.10.jar
174           --with-doxygen=$env:USERPROFILE\lo\spp\c\bin\doxygen.exe
175           --with-ucrt-dir=$env:USERPROFILE\lo\ucrt
176           #--enable-odk
177           #--disable-dependency-tracking
178           #--enable-dbgutil
179           #--with-lang=fr ja
180           "
181     - resource: xPSDesiredStateConfiguration/xScript
182       id: cloud-init-dir
183       directives:
184         description: create the ~/.cloud-init directory
185       settings:
186         TestScript: Test-Path -Path "$env:UserProfile/.cloud-init" -PathType "Container"
187         GetScript:  Test-Path -Path "$env:UserProfile/.cloud-init" -PathType "Container"
188         SetScript: New-Item -ItemType "directory" -Path "$env:UserProfile" -Name ".cloud-init"
189     - resource: xPSDesiredStateConfiguration/xScript
190       id: cloud-init-config
191       dependsOn:
192         - cloud-init-dir
193       directives:
194         description: create a cloud-init configuration to automate the installation of Ubuntu 24.04
195       settings:
196         TestScript: Test-Path -Path "$env:USERPROFILE/.cloud-init/Ubuntu-24.04.user-data"
197         GetScript:  Test-Path -Path "$env:USERPROFILE/.cloud-init/Ubuntu-24.04.user-data"
198         SetScript: |
199           New-Item -Path "$env:USERPROFILE/.cloud-init" -Name "Ubuntu-24.04.user-data" -ItemType "file" -Value '#cloud-config
200           users:
201             - name: ubuntu
202               # ubuntu
203               password: "$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0"
204               groups: [user, adm, dialout, cdrom, floppy, sudo, audio, dip, video, plugdev, netdev]
205               shell: /bin/bash
207           write_files:
208           - path: /etc/wsl.conf
209             append: true
210             content: |
211               [user]
212               default=ubuntu
214           packages: [pkg-config, automake, make, gperf, bison, nasm, flex, zip, libfont-ttf-perl]
215           '
216     - resource: xPSDesiredStateConfiguration/xScript
217       id: install-Ubuntu
218       dependsOn:
219         - cloud-init-config
220       directives:
221         description: installs Ubuntu with help of the cloud-init file
222       settings:
223         TestScript: wsl.exe --list ; return ![bool]$LASTEXITCODE
224         GetScript:  wsl.exe --list ; return ![bool]$LASTEXITCODE
225         SetScript: |
226           wsl.exe --install --no-launch --distribution Ubuntu-24.04
227           ubuntu2404.exe install --root
228           ubuntu2404.exe run cloud-init status --wait
229   configurationVersion: 0.2.0