aboutsummaryrefslogtreecommitdiff
path: root/system/epson-printer-utility/epson-printer-utility.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'system/epson-printer-utility/epson-printer-utility.SlackBuild')
-rw-r--r--system/epson-printer-utility/epson-printer-utility.SlackBuild79
1 files changed, 64 insertions, 15 deletions
diff --git a/system/epson-printer-utility/epson-printer-utility.SlackBuild b/system/epson-printer-utility/epson-printer-utility.SlackBuild
index fa010d0817920..c8fc095f2dbd3 100644
--- a/system/epson-printer-utility/epson-printer-utility.SlackBuild
+++ b/system/epson-printer-utility/epson-printer-utility.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for epson-printer-utility
-# Copyright 2020 Tim Dickson
+# Copyright 2020/2022 Tim Dickson
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -31,13 +31,16 @@
# - stop writing to $CWD. use a top-level build dir instead.
# - fix hardcoded /usr/lib64 in rm command (fix build on 32-bit)!
+# 20220522 tim dickson: Build=5: update README.models to include new
+# - models. Also major patching to get working with qt5, removing qt4 dep
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=epson-printer-utility
VERSION=${VERSION:-1.1.1}
EXTRABIT=1lsb3.2
TARNAM=$PRGNAM-$VERSION.tar.gz
-BUILD=${BUILD:-4}
+BUILD=${BUILD:-5}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -79,7 +82,8 @@ set -e
TOPDIR=$TMP/$PRGNAM-$VERSION-build
-source /etc/profile.d/qt4.sh; export PATH
+##this is my attempt to patch the software to work with qt5
+#source /etc/profile.d/qt4.sh; export PATH
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
@@ -121,10 +125,21 @@ sed -i 'sZInklow.png</file>ZInklow.png</file>\n <file>Images/Inklow_.png<
#we need to regenerate qrc_Resources.cpp (which would have been generated by qmake)
#as the one shipped has all the png's with iCCP invalid sRGB profiles.
#echo "create new qrc_resources.cpp file using our patched Resources.qrc file"
+#and patch source so it can find class definition for qt5
+
cd PrinterUtility
+sed -i '1i_QT += widgets' PrinterUtility.pro
rm -f qrc_Resources.cpp
rcc -o qrc_Resources.cpp Resources.qrc
+sed -i 's_QWidget>_QWidget>\n#include "qboxlayout.h"\n#include "qlabel.h"_g' EPUView.h
+sed -i 's_Controller.h"_Controller.h"\n#include "qpushbutton.h"_g' EPUMaintenanceGuideView.h
+sed -i 's_QDialog>_QDialog>\n#include "qlistview.h"\n#include "qpushbutton.h"\n#include "qboxlayout.h"\n#include "qapplication.h"_g' EPUPrinterListDialog.h
+sed -i 's_QTimer>_QTimer>\n#include "qgroupbox.h"_g' EPUMainView.h
+sed -i 's_QTimer>_QTimer>\n#include "qapplication.h"_g' EPUMainController.cpp
+sed -i 's_QFont>_QFont>\n#include "qapplication.h"\n#include "qdesktopwidget.h"_g' EPUMainWindow.cpp
+
cd ..
+
#echo "now we have a resources file with fixed pngs embeded in it"
#lets run qmake :-) - or lets not. it looks like a bunch of stuff is missing.!
#the list of stuff reported missing by qmake was sent to linux-printer@epson.jp 28/09/2020
@@ -136,21 +151,29 @@ cd ..
#qmake PrinterUtility.pro
#cd ..
+echo "===fix Makefile.am files prior to running autoreconf==="
+#fix hardcoded /opt/lsb stuff so that autoreconf generates correct Makefile.in
+sed -i 's_/opt/lsb_/usr_g' EPSCommonLib/Makefile.am
+sed -i 's_/libQt_/libQt5_g' EPSCommonLib/Makefile.am
+sed -i 's_usr/include_usr/include/qt5_g' EPSCommonLib/Makefile.am
+
+sed -i 's_/opt/lsb_/usr_g' PrinterUtility/Makefile.am
+sed -i 's_usr/include_usr/include/qt5_g' PrinterUtility/Makefile.am
+sed -i 's_qt5/QtNetwork_qt5/QtNetwork \\\n -I/usr/include/qt5/QtWidgets_g' PrinterUtility/Makefile.am
+sed -i 's_libQt_libQt5_g' PrinterUtility/Makefile.am
+sed -i 's_libcups.so_libcups.so \\\n /usr/\$\(LIBARCH\)/libQt5Widgets.so_g' PrinterUtility/Makefile.am
+
echo "running aclocal"
aclocal
echo "running autoreconf"
autoreconf --install --force
-#we still have to fix the Makefile.am files that autoreconf didn't sort out
-#fix hardcoded /opt/lsb stuff
-sed -i 's_/opt/lsb_/usr_g' EPSCommonLib/Makefile.am
-#patch qtlibs reference in wrong place
-sed -i "s_/usr/include/QtCore_/usr/lib${LIBDIRSUFFIX}/qt4/include/QtCore_g" EPSCommonLib/Makefile.am
-sed -i 's_/opt/lsb_/usr_g' PrinterUtility/Makefile.am
-sed -i "s_/usr/include/QtCore_/usr/lib${LIBDIRSUFFIX}/qt4/include/QtCore_g" PrinterUtility/Makefile.am
-sed -i "s_/usr/include/QtGui_/usr/lib${LIBDIRSUFFIX}/qt4/include/QtGui_g" PrinterUtility/Makefile.am
-sed -i "s_include/QtNetwork_lib${LIBDIRSUFFIX}/qt4/include/QtNetwork_g" PrinterUtility/Makefile.am
+echo "================="
echo "running configure"
+echo "================="
+#CFLAGS="$SLKCFLAGS -fpermissive -I/usr/include/qt5 -I/usr/include/qt5/QtCore" \
+#CXXFLAGS="$SLKCFLAGS -fpermissive -I/usr/include/qt5 -I/usr/include/qt5/QtCore" \
+
CC=/usr/bin/c++ \
CXX=/usr/bin/c++ \
@@ -159,6 +182,7 @@ CXXFLAGS="$SLKCFLAGS -fpermissive" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
+ --includedir=/usr/include/qt5 \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
@@ -171,17 +195,41 @@ echo "more patching of source files"
#add missing header for sleep
sed -i "1 i #include <unistd.h>" PrinterUtility/EPUMainController.cpp
sed -i "1 i #include <unistd.h>" PrinterUtility/EPUPrinterListDialog.cpp
-#we need to patch the moc files so they work with qt 4.8.7 that ships with slackware 14.2
-#when the source is complete and we can run qmake, that should fix this.
+#we need to patch the moc files so they work with qt 5.15.3 that ships with slackware 15.0
+#when the source is complete and we can run qmake, that should fix this
+#for qt 5.15.3 MOC_OUTPUT_REVISION is 67 this number can be found in
+#/usr/include/qt5/QtCore/qobjectdefs.h
+
+#fix moc files so version check works with qt5.15.3
+#we do this because epson is missing the NozzlecheckResultView.h
+#file, so we can't recreate it.
for i in `ls PrinterUtility/moc_*.cpp`; do
- sed -i 's/59/63/g' $i
+ sed -i 's/59/67/g' $i
done
+#lets recreate moc files from .h files
+cd PrinterUtility
+ for i in EPUMainView EPUMainWindow EPUMaintenanceGuideView EPUOperationView EPUPrinterListDialog EPUView ;do
+ rm moc_$i.cpp #remove existing moc file
+ moc $i.h >moc_$i.cpp #create new moc file
+ done
+ rm moc_EThread.cpp
+ moc ../EPUCommon/EThread.h >moc_EThread.cpp
+cd ..
+#this one is taken from outside the directory
+
#patch hardcoded path in Main.cpp so it can find language files
sed -i "s_/opt/epson_/usr/share/epson_g" PrinterUtility/Main.cpp
+#fix linking to qt5 stuff instead of qt4. should be fixed with .am fix
+#sed -i "s_libQt_libQt5_g" EPSCommonLib/Makefile.in
+echo "=================="
echo "running make"
+echo "============="
+
make
+echo "============"
echo "running make install"
+
make install DESTDIR=$PKG
#as make install doesn't do much we do it manually
mkdir -p $PKG/usr/bin
@@ -197,6 +245,7 @@ cp PrinterUtility/Images/AppIcon.png $PKG/usr/share/pixmaps/epson-printer-utilit
#+-----------------------------------------------------------+
#| we now have to process the communication daemon |
#+-----------------------------------------------------------+
+echo "qt part of utility done, now for daemon"
cd $TOPDIR
rm -rf epson-backend-$VERSION
tar xvf epson-backend-$VERSION.tar.gz