From 08f725d0d0b141800c46b2f99ff88971d53d00c5 Mon Sep 17 00:00:00 2001 From: Giuseppe Penone Date: Sun, 18 Oct 2020 21:58:20 +0100 Subject: [PATCH] removed build dependency from python3-lxml --- .travis.yml | 6 ++---- README.md | 11 +++++------ debian/control | 1 - scripts/gresource_to_c.py | 12 ++++++------ 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5d7fe6f13..0f549ad0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ before_install: linux) sudo apt install build-essential cmake libgtkmm-3.0-dev xvfb sudo apt install libgtksourceviewmm-3.0-dev libxml++2.6-dev libsqlite3-dev - sudo apt install libcpputest-dev gettext python3-lxml libgspell-1-dev libcurl4-openssl-dev + sudo apt install libcpputest-dev gettext libgspell-1-dev libcurl4-openssl-dev ;; windows) [[ ! -f C:/tools/msys64/msys2_shell.cmd ]] && rm -rf C:/tools/msys64 @@ -50,15 +50,13 @@ before_install: $msys2 pacman --sync --noconfirm --needed mingw-w64-x86_64-sqlite3 $msys2 pacman --sync --noconfirm --needed mingw-w64-x86_64-gspell $msys2 pacman --sync --noconfirm --needed mingw-w64-x86_64-curl - $msys2 pacman --sync --noconfirm --needed mingw-w64-x86_64-python3-lxml taskkill //IM gpg-agent.exe //F # https://travis-ci.community/t/4967 export PATH=/C/tools/msys64/mingw64/bin:$PATH export MAKE=mingw32-make # so that Autotools can find it ;; osx) brew update - brew install python3 pip3 cmake pkg-config gtksourceviewmm3 gnome-icon-theme gspell libxml++ cpputest - pip3 install lxml + brew install python3 cmake pkg-config gtksourceviewmm3 gnome-icon-theme gspell libxml++ cpputest ;; esac install: diff --git a/README.md b/README.md index 2b0694d19..c3cc02983 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ cpack -G DEB Install dependencies:: ```sh -sudo apt install build-essential libxml2-utils cmake libgtkmm-3.0-dev libgtksourceviewmm-3.0-dev libxml++2.6-dev libsqlite3-dev libcpputest-dev gettext python3-lxml libgspell-1-dev libcurl4-openssl-dev +sudo apt install build-essential libxml2-utils cmake libgtkmm-3.0-dev libgtksourceviewmm-3.0-dev libxml++2.6-dev libsqlite3-dev libcpputest-dev gettext libgspell-1-dev libcurl4-openssl-dev ``` Get cherrytree source, compile and run: ```sh @@ -76,7 +76,7 @@ xdg-open /usr/share/doc/libgspell-1-dev/html/index.html Install dependencies: ```sh -sudo pacman -S gtksourceviewmm libxml++2.6 python-lxml gspell +sudo pacman -S gtksourceviewmm libxml++2.6 gspell sudo pamac build cpputest ``` @@ -94,7 +94,7 @@ make -j$(nproc --all) Installd dependencies: ```sh -sudo dnf install @development-tools gcc-c++ libtool autoconf gtkmm30-devel gtksourceviewmm3-devel libxml++-devel libsq3-devel gettext-devel gettext intltool python3-lxml libxml2 gspell-devel +sudo dnf install @development-tools gcc-c++ libtool autoconf gtkmm30-devel gtksourceviewmm3-devel libxml++-devel libsq3-devel gettext-devel gettext intltool libxml2 gspell-devel ``` Install CppUTest: @@ -137,7 +137,6 @@ xdg-open /usr/share/doc/libxml++2.6/reference/html/index.html Install dependencies: ```sh brew install python3 cmake pkg-config gtksourceviewmm3 gnome-icon-theme gspell libxml++ cpputest -pip3 install lxml ``` Get cherrytree source, compile and run: @@ -173,8 +172,8 @@ Install required packages to build cherrytree: pacman -S --needed --noconfirm mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake # gtkmm3, gtksourceviewmm3, libxml++2.6, sqlite3, gspell, curl pacman -S --needed --noconfirm mingw-w64-x86_64-gtkmm3 mingw-w64-x86_64-gtksourceviewmm3 mingw-w64-x86_64-libxml++2.6 mingw-w64-x86_64-sqlite3 mingw-w64-x86_64-gspell mingw-w64-x86_64-curl -# python3-lxml, gettext, git, nano, meld3 -pacman -S --needed --noconfirm mingw-w64-x86_64-python3-lxml mingw-w64-x86_64-gettext git nano mingw-w64-x86_64-meld3 +# gettext, git, nano, meld3 +pacman -S --needed --noconfirm mingw-w64-x86_64-gettext git nano mingw-w64-x86_64-meld3 # cpputest (missing package, we need to build manually) pacman -S --needed --noconfirm autoconf automake libtool make wget https://github.com/cpputest/cpputest/releases/download/v3.8/cpputest-3.8.tar.gz diff --git a/debian/control b/debian/control index eede55d2f..e9a5a4712 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,6 @@ Build-Depends: debhelper (>= 9), desktop-file-utils, gettext, - python3-lxml, cmake (>= 3.13.2), libcpputest-dev, libxml2-utils, diff --git a/scripts/gresource_to_c.py b/scripts/gresource_to_c.py index 507f77015..5d3e2f3c0 100755 --- a/scripts/gresource_to_c.py +++ b/scripts/gresource_to_c.py @@ -6,7 +6,7 @@ import os import subprocess import glob -from lxml import etree +import xml.etree.ElementTree as ET import html SCRIPTS_DIR = os.path.dirname(os.path.realpath(__file__)) @@ -27,13 +27,13 @@ def main(args): # write gresource xml - gresources_Element = etree.Element("gresources") - gresource_Element = etree.SubElement(gresources_Element, "gresource", prefix="/icons") + gresources_Element = ET.Element("gresources") + gresource_Element = ET.SubElement(gresources_Element, "gresource", prefix="/icons") for svg_filepath in glob.glob(os.path.join(ICONS_DIR, "*.svg")): - file_Element = etree.SubElement(gresource_Element, "file", preprocess="xml-stripblanks", compressed="true") + file_Element = ET.SubElement(gresource_Element, "file", preprocess="xml-stripblanks", compressed="true") file_Element.text = html.escape(os.path.basename(svg_filepath)) - gresources_ElementTree = etree.ElementTree(gresources_Element) - gresources_ElementTree.write(GRESOURCE_XML_FILEPATH, xml_declaration=True, encoding='UTF-8', pretty_print=True) + gresources_ElementTree = ET.ElementTree(gresources_Element) + gresources_ElementTree.write(GRESOURCE_XML_FILEPATH, xml_declaration=True, encoding='UTF-8') # convert gresource xml to source file shell_cmd = ("glib-compile-resources", "--target="+GRESOURCE_SOURCE_FILEPATH_NOEXT+".cc", "--generate-source", GRESOURCE_XML_FILEPATH)