From 521949b567683b9f81529614f37b0eb835d57fbf Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 13 Feb 2021 09:56:15 +0100 Subject: [PATCH 1/8] travis: push i3 autobuild packages to balto instead of bintray (#4345) related to https://github.com/i3/i3/issues/4340 --- .travis.yml | 26 +++++--------------- travis/bintray-autobuild-debian.json | 36 ---------------------------- travis/bintray-autobuild-ubuntu.json | 36 ---------------------------- travis/prep-bintray.sh | 6 ----- travis/push-balto.sh | 23 ++++++++++++++++++ 5 files changed, 29 insertions(+), 98 deletions(-) delete mode 100644 travis/bintray-autobuild-debian.json delete mode 100644 travis/bintray-autobuild-ubuntu.json delete mode 100755 travis/prep-bintray.sh create mode 100644 travis/push-balto.sh diff --git a/.travis.yml b/.travis.yml index 9935cb631..81dd2b168 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,7 @@ env: - secure: "uJuuefmnJUuEH15ZD8xQilibx7EeBvMHBLoIZ8bgGHeleEImBD0XbD1ypvhYJKpviOmw5BkZmc9bVO8DGDEHYbSlIa2xDlF6vGrwgCEaxcMIhOAhv+dW9C/maJVieLOEPM01/fK2qdKESZaLvlopkWmxZwDyMObI9L7AMW9zQD8=" # BINTRAY_USER - secure: "L3aPSNLySPXtWCW+xf8h/AAdquwNgxyTQpYOwexJmTPav82Qx8uQlp1yJkUmt+a+FLZDFfQeMivaHq0311RvuQVmkAJx49DjaddrwqOJut2UPsoVDn1WeuAcSHIXOq/0H+zgFMr/PGY0HXIsw1mTMhgheGJNqg09BvYWROCEAcA=" # BINTRAY_KEY - secure: "sBMVn4C/WRWgoAytEFGx4CC5O55Q63h02AcuBnb1jXcBm0RenoBpzUPtxSseJwDPUA1o/UkuEDDjm3PosT5NF+dvED01VDFMsPVE11K0u6+avYy3jYXqyUEDW3G2o6Wo/2aqNjmd++8jskBdS9+Cx9gaFbgxfzSp0Yfu3oJm/4c=" # GH_TOKEN + - secure: "HPMBtknjHM9CjaEoTVLiNtjg7JxmEZ+6AzqjT1LsA0e52dIlWzcRLVLL4uAR8SqMfR1iSj4lW74DzFXEnJCKa+04hiTp9Z/6zw/tX/mFOkkpz8H2gVttXh68NRHLJSJrRX/5fGCcl7AHypADBaoybjEmwjFxYRZ1Nwf81SwQVik=" # BALTO_TOKEN install: - if [ -a .git/shallow ]; then git fetch --unshallow; fi - docker pull ${BASENAME} || ./travis/docker-build-and-push.sh ${BASENAME} travis/travis-base.Dockerfile @@ -40,25 +41,9 @@ script: - ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME_386} linux32 ./travis/debian-build.sh deb/debian-i386/DIST - ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME_UBUNTU_386} linux32 ./travis/debian-build.sh deb/ubuntu-i386/DIST - ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/docs.sh - - ./travis/skip-pkg.sh || travis/prep-bintray.sh + - ./travis/skip-pkg.sh || travis/push-balto.sh deploy: - - provider: bintray - file: travis/bintray-autobuild-debian.json - user: $BINTRAY_USER - key: $BINTRAY_KEY - skip_cleanup: true - on: - branch: next - condition: $CC = gcc - - provider: bintray - file: travis/bintray-autobuild-ubuntu.json - user: $BINTRAY_USER - key: $BINTRAY_KEY - skip_cleanup: true - on: - branch: next - condition: $CC = gcc - provider: script script: travis/deploy-github-pages.sh skip_cleanup: true @@ -66,6 +51,7 @@ deploy: branch: next condition: $CC = gcc -after_deploy: - - travis/cleanup-bintray.pl i3-autobuild - - travis/cleanup-bintray.pl i3-autobuild-ubuntu +# TODO: implement cleanup if we stick with balto +#after_deploy: +# - travis/cleanup-bintray.pl i3-autobuild +# - travis/cleanup-bintray.pl i3-autobuild-ubuntu diff --git a/travis/bintray-autobuild-debian.json b/travis/bintray-autobuild-debian.json deleted file mode 100644 index d01b7dbaa..000000000 --- a/travis/bintray-autobuild-debian.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "package": { - "name": "i3-wm", - "repo": "i3-autobuild", - "subject": "i3" - }, - - "version": { - "name": "%version%", - "desc": "TODO", - "gpgSign": false - }, - - "files": [ - { - "includePattern": "distbuild/deb/debian-amd64/(.*\\.deb)$", - "matrixParams": { - "deb_distribution": "sid", - "deb_component": "main", - "deb_architecture": "amd64" - }, - "uploadPattern": "$1" - }, - { - "includePattern": "distbuild/deb/debian-i386/(.*\\.deb)$", - "matrixParams": { - "deb_distribution": "sid", - "deb_component": "main", - "deb_architecture": "i386" - }, - "uploadPattern": "$1" - } - ], - - "publish": true -} diff --git a/travis/bintray-autobuild-ubuntu.json b/travis/bintray-autobuild-ubuntu.json deleted file mode 100644 index 4c0d6114c..000000000 --- a/travis/bintray-autobuild-ubuntu.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "package": { - "name": "i3-wm", - "repo": "i3-autobuild-ubuntu", - "subject": "i3" - }, - - "version": { - "name": "%version%", - "desc": "TODO", - "gpgSign": false - }, - - "files": [ - { - "includePattern": "distbuild/deb/ubuntu-amd64/(.*\\.deb)$", - "matrixParams": { - "deb_distribution": "bionic", - "deb_component": "main", - "deb_architecture": "amd64" - }, - "uploadPattern": "$1" - }, - { - "includePattern": "distbuild/deb/ubuntu-i386/(.*\\.deb)$", - "matrixParams": { - "deb_distribution": "bionic", - "deb_component": "main", - "deb_architecture": "i386" - }, - "uploadPattern": "$1" - } - ], - - "publish": true -} diff --git a/travis/prep-bintray.sh b/travis/prep-bintray.sh deleted file mode 100755 index 4ea56dcd4..000000000 --- a/travis/prep-bintray.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -set -e -set -x - -sed -i "s,%version%,$(git describe --tags),g" travis/bintray-autobuild-*.json diff --git a/travis/push-balto.sh b/travis/push-balto.sh new file mode 100644 index 000000000..ffa5ee15a --- /dev/null +++ b/travis/push-balto.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +set -e + +for fn in distbuild/deb/debian-amd64/*.deb distbuild/deb/debian-i386/*.deb +do + echo "pushing $fn to balto" + curl \ + --header "Authorization: Bearer ${BALTO_TOKEN}" \ + --form "package=@${fn}" \ + --form distribution=all \ + https://i3.baltorepo.com/i3/i3-autobuild/upload/ +done + +for fn in distbuild/deb/ubuntu-amd64/*.deb distbuild/deb/ubuntu-i386/*.deb +do + echo "pushing $fn to balto" + curl \ + --header "Authorization: Bearer ${BALTO_TOKEN}" \ + --form "package=@${fn}" \ + --form distribution=all \ + https://i3.baltorepo.com/i3/i3-autobuild-ubuntu/upload/ +done From b95bab0e34365d7637cc87f11e0b3e5fa0956dfb Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 13 Feb 2021 10:10:59 +0100 Subject: [PATCH 2/8] mark travis/push-balto.sh as executable (#4347) related to https://github.com/i3/i3/issues/4340 --- travis/push-balto.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 travis/push-balto.sh diff --git a/travis/push-balto.sh b/travis/push-balto.sh old mode 100644 new mode 100755 From 0e1a82800327f7130b3299712b85ae8d06cf7799 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 15 Nov 2020 19:22:09 +0100 Subject: [PATCH 3/8] cherry-pick release.sh changes into stable branch related to https://github.com/i3/i3/issues/4350 --- release.sh | 45 ++++++++++++++++++--------------------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/release.sh b/release.sh index c6b045c0a..4477ebfe2 100755 --- a/release.sh +++ b/release.sh @@ -1,8 +1,10 @@ #!/bin/zsh # This script is used to prepare a new release of i3. +set -eu + export RELEASE_VERSION="4.19" -export PREVIOUS_VERSION="4.18" +export PREVIOUS_VERSION="4.18.3" export RELEASE_BRANCH="next" if [ ! -e "../i3.github.io" ] @@ -24,12 +26,6 @@ then exit 1 fi -if git diff-files --quiet --exit-code debian/changelog -then - echo "Expected debian/changelog to be changed (containing the changelog for ${RELEASE_VERSION})." - exit 1 -fi - eval $(gpg-agent --daemon) export GPG_AGENT_INFO @@ -52,28 +48,32 @@ if [ ! -e "${STARTDIR}/RELEASE-NOTES-${RELEASE_VERSION}" ]; then exit 1 fi git checkout -b release-${RELEASE_VERSION} +git rm RELEASE-NOTES-* cp "${STARTDIR}/RELEASE-NOTES-${RELEASE_VERSION}" "RELEASE-NOTES-${RELEASE_VERSION}" git add RELEASE-NOTES-${RELEASE_VERSION} -git rm RELEASE-NOTES-${PREVIOUS_VERSION} -sed -i "s/^\s*version: '${PREVIOUS_VERSION}'/ version: '${RELEASE_VERSION}'/" meson.build +# Update the release version: +sed -i "s/^\s*version: '4.[^']*'/ version: '${RELEASE_VERSION}'/" meson.build +cp meson.build "${TMPDIR}/meson.build" +# Inject the release date into meson.build for the dist tarball: +sed -i "s/'-non-git'/' ($(date +'%Y-%m-%d'))'/" meson.build git commit -a -m "release i3 ${RELEASE_VERSION}" git tag "${RELEASE_VERSION}" -m "release i3 ${RELEASE_VERSION}" --sign --local-user=0x4AC8EE1D mkdir build (cd build && meson .. && ninja dist) -cp build/meson-build/i3-${RELEASE_VERSION}.tar.xz . +cp build/meson-dist/i3-${RELEASE_VERSION}.tar.xz . echo "Differences in the release tarball file lists:" diff --color -u \ - <(tar tf ../i3-${PREVIOUS_VERSION}.tar.xz | sed "s,i3-${PREVIOUS_VERSION}/,,g" | sort) \ - <(tar tf i3-${RELEASE_VERSION}.tar.xz | sed "s,i3-${RELEASE_VERSION}/,,g" | sort) + <(tar tf ../i3-${PREVIOUS_VERSION}.tar.* | sed "s,i3-${PREVIOUS_VERSION}/,,g" | sort) \ + <(tar tf i3-${RELEASE_VERSION}.tar.xz | sed "s,i3-${RELEASE_VERSION}/,,g" | sort) || true gpg --armor -b i3-${RELEASE_VERSION}.tar.xz -echo "${RELEASE_VERSION}-non-git" > I3_VERSION -git add I3_VERSION -git commit -a -m "Set non-git version to ${RELEASE_VERSION}-non-git." +mv "${TMPDIR}/meson.build" . +git add meson.build +git commit -a -m "Restore non-git version suffix" if [ "${RELEASE_BRANCH}" = "stable" ]; then git checkout stable @@ -94,17 +94,12 @@ git config --add remote.origin.push "+refs/heads/next:refs/heads/next" git config --add remote.origin.push "+refs/heads/stable:refs/heads/stable" ################################################################################ -# Section 2: Debian packaging +# Section 2: Debian packaging (for QA) ################################################################################ cd "${TMPDIR}" mkdir debian -# Copy over the changelog because we expect it to be locally modified in the -# start directory. -cp "${STARTDIR}/debian/changelog" i3/debian/changelog -(cd i3 && git add debian/changelog && git commit -m 'Update debian/changelog') - cat > ${TMPDIR}/Dockerfile < Date: Sat, 27 Feb 2021 10:37:57 +0100 Subject: [PATCH 4/8] release i3 4.19.2 --- RELEASE-NOTES-4.19.1 => RELEASE-NOTES-4.19.2 | 10 ++++------ meson.build | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) rename RELEASE-NOTES-4.19.1 => RELEASE-NOTES-4.19.2 (73%) diff --git a/RELEASE-NOTES-4.19.1 b/RELEASE-NOTES-4.19.2 similarity index 73% rename from RELEASE-NOTES-4.19.1 rename to RELEASE-NOTES-4.19.2 index 72e479c78..df859a8a2 100644 --- a/RELEASE-NOTES-4.19.1 +++ b/RELEASE-NOTES-4.19.2 @@ -1,6 +1,6 @@ ┌──────────────────────────────┐ - │ Release notes for i3 v4.19.1 │ + │ Release notes for i3 v4.19.2 │ └──────────────────────────────┘ This is i3 v4.19. This version is considered stable. All users of i3 are @@ -12,9 +12,7 @@ This is a bugfix release for v4.19 │ Bugfixes │ └────────────────────────────┘ - • fix workspaces not moving to assigned output after output becomes available - • fix duplicate bindcode after i3-config-wizard - • fix commented-out rofi call in default i3 config + • fix release tarball version number and debug log settings ┌────────────────────────────┐ │ Thanks! │ @@ -22,6 +20,6 @@ This is a bugfix release for v4.19 Thanks for testing, bugfixes, discussions and everything I forgot go out to: - Anaël Beutot, Imran Virani, Orestis Floros + Stuart Henderson --- Michael Stapelberg, 2021-02-01 +-- Michael Stapelberg, 2021-02-27 diff --git a/meson.build b/meson.build index 14faf2d30..39fcbbe35 100644 --- a/meson.build +++ b/meson.build @@ -6,7 +6,7 @@ project( 'i3', 'c', - version: '4.19.1', + version: '4.19.2', default_options: [ 'c_std=c11', 'warning_level=1', # enable all warnings (-Wall) @@ -63,7 +63,7 @@ config_h = declare_dependency( sources: vcs_tag( input: config_h_in, output: 'config.h', - fallback: meson.project_version() + '-non-git', + fallback: meson.project_version() + ' (2021-02-27)', ) ) From 4ef47087d4f10247b29378f0077e9e6fa3f9edc8 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 27 Feb 2021 10:38:13 +0100 Subject: [PATCH 5/8] Restore non-git version suffix --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 39fcbbe35..047c6dbe5 100644 --- a/meson.build +++ b/meson.build @@ -63,7 +63,7 @@ config_h = declare_dependency( sources: vcs_tag( input: config_h_in, output: 'config.h', - fallback: meson.project_version() + ' (2021-02-27)', + fallback: meson.project_version() + '-non-git', ) ) From 7da136dca494073a5de9a38df9eb1ee220cf6006 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 27 Feb 2021 10:38:13 +0100 Subject: [PATCH 6/8] Update debian/changelog --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2605a9f9b..96b855f95 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -i3-wm (4.19.1-1) unstable; urgency=medium +i3-wm (4.19.2-1) unstable; urgency=medium * New upstream release. - -- Michael Stapelberg Mon, 01 Feb 2021 09:00:07 +0100 + -- Michael Stapelberg Sat, 27 Feb 2021 10:32:17 +0100 i3-wm (4.19-1) unstable; urgency=medium From 8d645d0de6f02de4bf0dac701892f7bd6d87e5f1 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 5 Mar 2021 11:36:09 +0100 Subject: [PATCH 7/8] Remove draw_text_ascii() This function is unused since commit fa488d721dfd1e1 from 2017. Signed-off-by: Uli Schlachter --- include/libi3.h | 7 ------- libi3/font.c | 35 ----------------------------------- 2 files changed, 42 deletions(-) diff --git a/include/libi3.h b/include/libi3.h index e693c3ad4..7945134ce 100644 --- a/include/libi3.h +++ b/include/libi3.h @@ -451,13 +451,6 @@ bool font_is_pango(void); void draw_text(i3String *text, xcb_drawable_t drawable, xcb_gcontext_t gc, xcb_visualtype_t *visual, int x, int y, int max_width); -/** - * ASCII version of draw_text to print static strings. - * - */ -void draw_text_ascii(const char *text, xcb_drawable_t drawable, - xcb_gcontext_t gc, int x, int y, int max_width); - /** * Predict the text width in pixels for the given text. Text must be * specified as an i3String. diff --git a/libi3/font.c b/libi3/font.c index 5ed58b8d7..26e90e44a 100644 --- a/libi3/font.c +++ b/libi3/font.c @@ -380,41 +380,6 @@ void draw_text(i3String *text, xcb_drawable_t drawable, xcb_gcontext_t gc, } } -/* - * ASCII version of draw_text to print static strings. - * - */ -void draw_text_ascii(const char *text, xcb_drawable_t drawable, - xcb_gcontext_t gc, int x, int y, int max_width) { - assert(savedFont != NULL); - - switch (savedFont->type) { - case FONT_TYPE_NONE: - /* Nothing to do */ - return; - case FONT_TYPE_XCB: { - size_t text_len = strlen(text); - if (text_len > 255) { - /* The text is too long to draw it directly to X */ - i3String *str = i3string_from_utf8(text); - draw_text(str, drawable, gc, NULL, x, y, max_width); - i3string_free(str); - } else { - /* X11 coordinates for fonts start at the baseline */ - int pos_y = y + savedFont->specific.xcb.info->font_ascent; - - xcb_image_text_8(conn, text_len, drawable, gc, x, pos_y, text); - } - break; - } - case FONT_TYPE_PANGO: - /* Render the text using Pango */ - draw_text_pango(text, strlen(text), - drawable, root_visual_type, x, y, max_width, false); - return; - } -} - static int xcb_query_text_width(const xcb_char2b_t *text, size_t text_len) { /* Make the user know we’re using the slow path, but only once. */ static bool first_invocation = true; From b23c8875f70c5c142ba499d4704b51802138d071 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 5 Mar 2021 11:37:03 +0100 Subject: [PATCH 8/8] font: Get rid of temporary cairo surface i3 actually manages to have two different cairo surfaces referring to the same drawable. One comes from the code in draw_util. The second is temporarily created while rendering text via draw_text(). No idea how well cairo handles this case. This commit instead changes the code to pass the already existing cairo surface from the caller through. This might or might not fix https://github.com/i3/i3/pull/4357. My thinking here is that cairo now knows the actual size of the drawable and thus does not clip the drawing to a smaller size. Signed-off-by: Uli Schlachter --- include/libi3.h | 4 +++- libi3/draw_util.c | 2 +- libi3/font.c | 14 ++++---------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/libi3.h b/include/libi3.h index 7945134ce..d17892f8b 100644 --- a/include/libi3.h +++ b/include/libi3.h @@ -445,11 +445,13 @@ bool font_is_pango(void); * specified coordinates (from the top left corner of the leftmost, uppermost * glyph) and using the provided gc. * + * The given cairo surface must refer to the specified X drawable. + * * Text must be specified as an i3String. * */ void draw_text(i3String *text, xcb_drawable_t drawable, xcb_gcontext_t gc, - xcb_visualtype_t *visual, int x, int y, int max_width); + cairo_surface_t *surface, int x, int y, int max_width); /** * Predict the text width in pixels for the given text. Text must be diff --git a/libi3/draw_util.c b/libi3/draw_util.c index 313dc29ac..18cd0459c 100644 --- a/libi3/draw_util.c +++ b/libi3/draw_util.c @@ -133,7 +133,7 @@ void draw_util_text(i3String *text, surface_t *surface, color_t fg_color, color_ CAIRO_SURFACE_FLUSH(surface->surface); set_font_colors(surface->gc, fg_color, bg_color); - draw_text(text, surface->id, surface->gc, surface->visual_type, x, y, max_width); + draw_text(text, surface->id, surface->gc, surface->surface, x, y, max_width); /* Notify cairo that we (possibly) used another way to draw on the surface. */ cairo_surface_mark_dirty(surface->surface); diff --git a/libi3/font.c b/libi3/font.c index 26e90e44a..514328f62 100644 --- a/libi3/font.c +++ b/libi3/font.c @@ -82,12 +82,10 @@ static bool load_pango_font(i3Font *font, const char *desc) { * */ static void draw_text_pango(const char *text, size_t text_len, - xcb_drawable_t drawable, xcb_visualtype_t *visual, int x, int y, - int max_width, bool pango_markup) { + xcb_drawable_t drawable, cairo_surface_t *surface, + int x, int y, int max_width, bool pango_markup) { /* Create the Pango layout */ /* root_visual_type is cached in load_pango_font */ - cairo_surface_t *surface = cairo_xcb_surface_create(conn, drawable, - visual, x + max_width, y + savedFont->height); cairo_t *cr = cairo_create(surface); PangoLayout *layout = create_layout_with_dpi(cr); gint height; @@ -115,7 +113,6 @@ static void draw_text_pango(const char *text, size_t text_len, /* Free resources */ g_object_unref(layout); cairo_destroy(cr); - cairo_surface_destroy(surface); } /* @@ -358,11 +355,8 @@ static void draw_text_xcb(const xcb_char2b_t *text, size_t text_len, xcb_drawabl * */ void draw_text(i3String *text, xcb_drawable_t drawable, xcb_gcontext_t gc, - xcb_visualtype_t *visual, int x, int y, int max_width) { + cairo_surface_t *surface, int x, int y, int max_width) { assert(savedFont != NULL); - if (visual == NULL) { - visual = root_visual_type; - } switch (savedFont->type) { case FONT_TYPE_NONE: @@ -375,7 +369,7 @@ void draw_text(i3String *text, xcb_drawable_t drawable, xcb_gcontext_t gc, case FONT_TYPE_PANGO: /* Render the text using Pango */ draw_text_pango(i3string_as_utf8(text), i3string_get_num_bytes(text), - drawable, visual, x, y, max_width, i3string_is_markup(text)); + drawable, surface, x, y, max_width, i3string_is_markup(text)); return; } }