Skip to content

Commit ad95767

Browse files
mirabilosmirabilos
authored andcommitted
Merge branch 'staging'
2 parents 73035ad + 6c67b08 commit ad95767

6 files changed

Lines changed: 260 additions & 0 deletions

File tree

.github/deb-workflow/build.sh

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#!/bin/bash
2+
#-
3+
# © mirabilos Ⓕ MirBSD or CC0
4+
5+
echo ::group::Init
6+
switchgroup() {
7+
printf '::%s\n' 'endgroup::' "group::$*"
8+
}
9+
exec 2>&1
10+
set -ex
11+
set -o pipefail
12+
unset LANGUAGE
13+
export LC_ALL=C.UTF-8 DEBIAN_FRONTEND=noninteractive
14+
15+
echo init >.deb.statefile
16+
wd=$(realpath .)
17+
[[ $wd = /* ]]
18+
me=$(realpath "$0")
19+
[[ $me = /* ]]
20+
me=$(dirname "$me")
21+
[[ $me = /* ]]
22+
dr=$wd/result-$2
23+
db=$dr/build
24+
mkdir "$dr"
25+
26+
switchstate() {
27+
printf '%s\n' "$*" >"$wd/.deb.statefile"
28+
}
29+
30+
switchgroup Setup $0 on Debian $2
31+
cat >/etc/apt/apt.conf.d/92bla <<\EOF
32+
debug::pkgproblemresolver "true";
33+
Dpkg::Progress-Fancy "false";
34+
// undo lenny breakage
35+
APT::Install-Recommends "0";
36+
APT::Install-Suggests "0";
37+
APT::Get::Always-Include-Phased-Updates "true";
38+
APT::Periodic::Enable "0";
39+
EOF
40+
rm -f /etc/apt/sources.list /etc/apt/sources.list.d/*
41+
switchstate apt
42+
cp "$me/$1.sources" /etc/apt/sources.list.d/
43+
apt-get clean
44+
apt-get update
45+
apt-get install -y eatmydata
46+
eatmydata apt-get --purge -y dist-upgrade
47+
eatmydata apt-get install -y adduser build-essential debhelper devscripts
48+
49+
switchstate envsetup
50+
switchgroup Set up build environment
51+
cp -r repo "$db"
52+
echo include-binaries >>"$db/debian/source/local-options"
53+
adduser --system --group --shell /bin/bash --home "$dr" --no-create-home bauer
54+
chown -R bauer:bauer "$db"
55+
chgrp bauer "$dr"
56+
chmod 2775 "$dr"
57+
switchstate b-d
58+
eatmydata apt-get -y build-dep "$db"
59+
60+
switchstate uscan
61+
switchgroup Acquire origtgz
62+
su - bauer -c 'cd build && exec uscan --verbose --rename --force-download'
63+
64+
switchstate building
65+
switchgroup Build the package
66+
su - bauer -c 'cd build && exec dpkg-buildpackage -e"Autobuilder <nobody@example.org>" --sanitize-env -us -uc'
67+
68+
switchstate postbuild
69+
switchgroup Post-build steps
70+
cp -r "$db"/dist "$wd/repo/"
71+
# saves space in the upload thingy
72+
(cd "$dr" && tar -cf - build | xz -e >build.txz && rm -rf build || rm -f build.txz)
73+
74+
switchstate apt-lintian
75+
eatmydata apt-get install -y --install-recommends lintian
76+
switchstate lintian
77+
switchgroup Run lintian
78+
su - bauer -c 'lintian -vIiE --pedantic --fail-on none *.changes'
79+
80+
switchgroup Set up NPM, to run the tests
81+
switchstate npm-setup
82+
# phantomjs needs libfontconfig and libfreetype
83+
eatmydata apt-get install -y fontconfig npm
84+
eatmydata env TMPDIR=/tmp npm install -g phantomjs@1.9.7-15
85+
chown -R bauer repo
86+
su - bauer -c 'cd ../repo && eatmydata env TMPDIR=/tmp npm install'
87+
switchstate npm-test-source
88+
switchgroup Run tests
89+
su - bauer -c 'cd ../repo && eatmydata npm run test'
90+
switchstate npm-test-min
91+
su - bauer -c 'cd ../repo && eatmydata npm run test-min'
92+
93+
echo ::endgroup::
94+
switchstate klaar

.github/deb-workflow/post.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
#-
3+
# © mirabilos Ⓕ MirBSD or CC0
4+
5+
echo ::group::Init
6+
switchgroup() {
7+
printf '::%s\n' 'endgroup::' "group::$*"
8+
}
9+
exec 2>&1
10+
set -ex
11+
set -o pipefail
12+
unset LANGUAGE
13+
export LC_ALL=C.UTF-8 DEBIAN_FRONTEND=noninteractive
14+
15+
set +x
16+
switchgroup Check whether build failed anywhere
17+
state=$(cat .deb.statefile || echo state-file-missing)
18+
if [[ $state != klaar ]]; then
19+
echo "E: build failed in: $state"
20+
exit 1
21+
fi
22+
echo "I: nope, ok"
23+
echo ::endgroup::

.github/deb-workflow/sid.sources

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Types: deb
2+
URIs: http://deb.debian.org/debian/
3+
Suites: sid
4+
Components: main
5+
Signed-By: /usr/share/keyrings/debian-archive-keyring.pgp
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Types: deb
2+
URIs: http://deb.debian.org/debian/
3+
Suites: trixie
4+
Components: main
5+
Signed-By: /usr/share/keyrings/debian-archive-keyring.pgp
6+
7+
Types: deb
8+
URIs: http://deb.debian.org/debian-security/
9+
Suites: trixie-security
10+
Components: main
11+
Signed-By: /usr/share/keyrings/debian-archive-keyring.pgp
12+
13+
Types: deb
14+
URIs: http://deb.debian.org/debian/
15+
Suites: trixie-updates
16+
Components: main
17+
Signed-By: /usr/share/keyrings/debian-archive-keyring.pgp
18+
19+
Types: deb
20+
URIs: http://deb.debian.org/debian/
21+
Suites: trixie-proposed-updates
22+
Components: main
23+
Signed-By: /usr/share/keyrings/debian-archive-keyring.pgp

.github/workflows/deb.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"jobs": {
3+
"r13": {
4+
"runs-on": "ubuntu-latest",
5+
"steps": [
6+
{
7+
"uses": "actions/checkout@v7.0.1",
8+
"with": {
9+
"path": "repo"
10+
}
11+
},
12+
{
13+
"uses": "docker://debian:trixie",
14+
"with": {
15+
"args": "sh -c 'bash repo/.github/deb-workflow/build.sh trixie 13 || echo W: nonzero exit status, failing later'"
16+
}
17+
},
18+
{
19+
"uses": "actions/upload-artifact@v7.0.1",
20+
"with": {
21+
"archive": true,
22+
"compression-level": 9,
23+
"if-no-files-found": "error",
24+
"name": "result-13",
25+
"path": "result-13"
26+
}
27+
},
28+
{
29+
"uses": "docker://debian:trixie",
30+
"with": {
31+
"args": "bash repo/.github/deb-workflow/post.sh"
32+
}
33+
}
34+
]
35+
},
36+
"sid": {
37+
"runs-on": "ubuntu-latest",
38+
"steps": [
39+
{
40+
"uses": "actions/checkout@v7.0.1",
41+
"with": {
42+
"path": "repo"
43+
}
44+
},
45+
{
46+
"uses": "docker://debian:sid",
47+
"with": {
48+
"args": "sh -c 'bash repo/.github/deb-workflow/build.sh sid sid || echo W: nonzero exit status, failing later'"
49+
}
50+
},
51+
{
52+
"uses": "actions/upload-artifact@v7.0.1",
53+
"with": {
54+
"archive": true,
55+
"compression-level": 9,
56+
"if-no-files-found": "error",
57+
"name": "result-sid",
58+
"path": "result-sid"
59+
}
60+
},
61+
{
62+
"uses": "docker://debian:sid",
63+
"with": {
64+
"args": "bash repo/.github/deb-workflow/post.sh"
65+
}
66+
}
67+
]
68+
}
69+
},
70+
"name": "deb packages",
71+
"on": {
72+
"push": {
73+
"branches": [
74+
"deb-test"
75+
]
76+
},
77+
"workflow_dispatch": null
78+
},
79+
"permissions": {
80+
"contents": "read",
81+
"id-token": "write"
82+
}
83+
}

scripts/generate-download.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ def file_links(release):
9393
&lt;script type="text/javascript" src="https://cdn.jsdelivr.net/npm/dygraphs@%(version)s/dist/dygraph.min.js"&gt;&lt;/script&gt;
9494
</pre>
9595
96+
<p>Note: if you wish to use jsDelivr’s ESM feature, you need to replace
97+
<tt>import * as dygraphs from 'https://esm.run/dygraphs';</tt>, which is the string they give you, with
98+
<tt>import Dygraph from 'https://esm.run/dygraphs';</tt>, i.e. replace
99+
the <tt>* as dygraphs</tt> part with <tt>Dygraph</tt> so to have that
100+
symbol available.<br />You’ll <em>also</em> still need to include the
101+
CSS separately.</p>
102+
96103
<p>There's a hosted version of dygraphs on <a
97104
href="https://cdnjs.com/libraries/dygraph">cdnjs.com</a>
98105
(note that it may take some time to update to new releases):</p>
@@ -104,6 +111,7 @@ def file_links(release):
104111
<p class="nomarginbottom">But note that use of CDNs violates the EU-GDPR.</p>
105112
106113
</fieldset>
114+
<fieldset><legend>Install from binary packages</legend>
107115
108116
<p>Besides the tarballs
109117
(see above) you can also install dygraphs locally into your project
@@ -113,8 +121,27 @@ def file_links(release):
113121
# dygraphs is now in node_modules/dygraphs/dist/dygraph.{css,js} for
114122
# the browser, and node_modules/dygraphs/index{,.es5}.js for nodejs</pre>
115123
124+
<p>There’s also a Debian package available:</p>
125+
126+
<pre>$ sudo apt-get install libjs-dygraphs
127+
# dygraphs is now in /usr/share/javascript/dygraphs/dygraph.{css,js}
128+
129+
# To access the documentation locally, run in a terminal:
130+
$ cd /usr/share/doc/libjs-dygraphs/site &amp;&amp; python3 -m http.server
131+
# Navigate to http://127.0.0.1:8000/ while this is running.
132+
133+
# When a webserver is running, do:
134+
$ sudo apt-get install javascript-common
135+
$ sudo a2enconf javascript-common.conf &amp;&amp; sudo service apache2 reload
136+
# dygraphs is now also available at /javascript/dygraphs/dygraph.{css,js}
137+
# so it can be used from webpages served by the system in question</pre>
138+
139+
</fieldset>
140+
116141
<p>Most distributions include a source map to facilitate debugging.</p>
117142
143+
<fieldset><legend>Build from source</legend>
144+
118145
<p>To generate your own minified JS, install the prerequisites…</p><ul>
119146
<li><tt>mksh</tt></li>
120147
<li><tt>pax</tt></li>
@@ -130,6 +157,11 @@ def file_links(release):
130157
<p>This will create a <tt>dygraph.min.css</tt> and a <tt>dygraph.min.js</tt>
131158
file in the <code>dist</code> directory.</p>
132159
160+
<p class="nomarginbottom">Building and testing the full distribution
161+
is slightly more intricate.</p>
162+
163+
</fieldset>
164+
133165
<p>You may also download files for previously-released versions:</p>
134166
135167
<ul>

0 commit comments

Comments
 (0)