From a4d02eae5691985fc2dee973849b5edb74dbd9ba Mon Sep 17 00:00:00 2001 From: Ruben Rodriguez <ruben@trisquel.info> Date: Wed, 28 Apr 2021 16:10:47 -0400 Subject: [PATCH] hplip: Backport a newer version that removes dependency on binary plugin --- helpers/DATA/hplip/Common.h | 74 +++++++++++++++++++++++++++++++++++++ helpers/make-hplip | 45 +++++++++++----------- 2 files changed, 98 insertions(+), 21 deletions(-) create mode 100755 helpers/DATA/hplip/Common.h diff --git a/helpers/DATA/hplip/Common.h b/helpers/DATA/hplip/Common.h new file mode 100755 index 00000000..edc02310 --- /dev/null +++ b/helpers/DATA/hplip/Common.h @@ -0,0 +1,74 @@ +#ifndef _COMMON_H +#define _COMMON_H + +#include<iostream> +#include<string> +#include<string.h> +#include<fstream> +#include<unistd.h> +#include<sstream> +#include<vector> +#include<map> +#include<algorithm> +#include<sstream> + +using namespace std; + + +typedef pair <string, string> STRING_STRING_PAIR; + +typedef vector<STRING_STRING_PAIR> PAIR_VECTOR; + +/** typedef struct _MODEL_DICT_ */ +typedef struct _MODEL_DICT_ MODEL_DICT; + +/** typedef map< string, MODEL_DICT> */ +typedef map< string, MODEL_DICT> MODEL_DICT_MAP; + +/** typedef vector <string> */ +typedef vector <string> STRING_VECTOR; + +/** typedef map<string, string> */ +typedef map<string, string> STRING_PAIR; + +/** @struct _MODEL_DICT_ + + * @brief This structure contains models.dat info + * @var _MODEL_DICT_::s_tech_class + * Member 's_tech_class' contains tech_class info + + * @var _MODEL_DICT_::s_sub_class + * Member 's_sub_class' contains sub_class info + + * @var _MODEL_DICT_::s_family_class + * Member 's_family_class' contains family_class info + + * @var _MODEL_DICT_::s_normal_model_name + * Member 's_normal_model_name' contains update model_name info + + * @var _MODEL_DICT_::s_plugin + * Member 's_plugin' contains plugin info + + * @var _MODEL_DICT_::s_plugin_reason + * Member 's_plugin_reason' contains plugin-reason info + + * @var _MODEL_DICT_::model_variants + * Member 'model_variants' contains vector info of model variants + +*/ +struct _MODEL_DICT_ +{ + string s_tech_class; + string s_sub_class; + string s_family_class; + string s_normal_model_name; + int s_plugin; + int s_plugin_reason; + STRING_VECTOR model_variants; + +}; + + + + +#endif diff --git a/helpers/make-hplip b/helpers/make-hplip index 4d4bcf15..3e44e6a1 100644 --- a/helpers/make-hplip +++ b/helpers/make-hplip @@ -1,7 +1,7 @@ #!/bin/sh # # Copyright (C) 2011 MPA -# Copyright (C) 2013-2017 Ruben Rodriguez <ruben@trisquel.info> +# Copyright (C) 2013-2021 Ruben Rodriguez <ruben@trisquel.info> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,8 +20,28 @@ VERSION=1 +# note, we need version 3.20.6 or higher, the binary plugin requirement +# was reworked on that version. + +EXTERNAL='deb-src http://archive.ubuntu.com/ubuntu hirsute main universe' +QUILT=skip + . ./config +sed '/debhelper-compat/s/13/12/' -i debian/control + +# This is somehow missing from the source tarball, fetched from Debian git +cp $DATA/Common.h . + +rm debian/patches/*-Fix-building-with-Python-3.8.patch +sed -i '/Fix-building-with-Python-3.8/d' debian/patches/series +rm debian/patches/*-Install-check-plugin.py-as-a-script.patch +sed -i '/Install-check-plugin.py-as-a-script.patch/d' debian/patches/series +sed '/plugin/d' -i debian/hplip-gui.manpages debian/hplip.manpages debian/hplip-gui.install debian/hplip.install + +export QUILT_PATCHES=debian/patches +quilt push -a + echo Removing printers not supported with free drivers from the database tmp=`mktemp` output=`mktemp` @@ -40,28 +60,11 @@ done cp $output $printers - -#grep -B 7 'download=True' $printers|grep "\["|/bin/sed 's/\[//g; s/\]//g' > $tmp2 -#grep -B 18 'plugin=1' $printers|grep "\["|/bin/sed 's/\[//g; s/\]//g' >> $tmp2 -#grep -B 33 'support-type=0' $printers|grep "\["|/bin/sed 's/\[//g; s/\]//g' >> $tmp2 -#sort -u < $tmp2 > $tmp -#for i in `cat $tmp`; do -# /bin/sed -i '/\['"$i"'\]/,/^$/d' $printers -#done -sed -i 's/plugin=2/plugin=0/g' $printers +# Set plugin-optional entries to not-required +/bin/sed -i 's/plugin=2/plugin=0/g' $printers debian/patches/* rm $tmp $tmp2 -rm debian/patches/hp_photosmart_pro_b9100_support.patch -sed -i '/hp_photosmart_pro_b9100_support.patch/d' debian/patches/series -rm debian/local/scripts/hp-plugin-ubuntu -sed /hp-plugin-ubuntu/d ./debian/rules -i - -# disable downloader -#rm plugin.py -#sed s/plugin.py//g -i ./hplip.list.in ./Makefile.in ./Makefile.am -#sed '/run_plugin_command/s/$/\n return/' -i ./base/pkit.py - -changelog "Removed printers with propietary drivers (required and optional)" +changelog "Removed printers with propietary drivers" compile -- GitLab