summaryrefslogtreecommitdiff
path: root/qscintilla.spec
blob: 93c6857e903126631b54c25d2bf0c253ec77bb40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
%global scintilla_ver 3.10.1
%global sip_ver 4.19.7
%global py3_sipdir %{_datadir}/sip
%global py3_sip %{_bindir}/sip
Name:                qscintilla
Version:             2.11.6
Release:             1
License:             GPL-3.0-only
Summary:             A Scintilla port to Qt
Url:                 https://github.com/opencor/qscintilla
Source0:             https://github.com/opencor/qscintilla/archive/refs/tags/v%{version}.tar.gz
Patch100:            QScintilla_gpl-2_10_7-sip_check.patch
Patch101:            QScintilla_gpl-2_11-QUrl.patch
Patch102:            fix-build-error.patch
BuildRequires:       gcc-c++
BuildRequires:       pkgconfig(Qt5Designer) pkgconfig(Qt5Gui) pkgconfig(Qt5Widgets)
Provides:            bundled(scintilla) = %{scintilla_ver}

%description
QScintilla is a port of Scintilla to the Qt GUI toolkit.
%{?scintilla_ver:This version of QScintilla is based on Scintilla v%{scintilla_ver}.}

%package qt5
Summary:             A Scintilla port to Qt5
Provides:            bundled(scintilla) = %{scintilla_ver}

%description qt5
%{summary}.

%package qt5-devel
Summary:             QScintilla Development Files
Requires:            %{name}-qt5%{?_isa} = %{version}-%{release} qt5-qtbase-devel

%description qt5-devel
%{summary}.

%package -n python3-qscintilla-qt5
Summary:             QScintilla-qt5 python3 bindings
BuildRequires:       python3-qt5 python3-qt5-devel python3-sip-devel >= %{sip_ver}
Provides:            %{name}-qt5-python3 = %{version}-%{release}
Requires:            %{name}-qt5%{?_isa} = %{version}-%{release}
Requires:            python3-qt5%{?pyqt5_version: >= %{pyqt5_version}}
%{?_sip_api:Requires: python3-pyqt5-sip-api(%{_sip_api_major}) >= %{_sip_api}}

%description -n python3-qscintilla-qt5
%{summary}.

%package -n python3-qscintilla-qt5-devel
Summary:             Development files for QScintilla-qt5 python3 bindings
Provides:            %{name}-qt5-python3-devel = %{version}-%{release}
Requires:            python3-qt5-devel
BuildArch:           noarch

%description -n python3-qscintilla-qt5-devel
%{summary}.

%prep
%autosetup -p1 -n qscintilla-%{version}

%build
PATH=%{_qt5_bindir}:$PATH; export PATH

pushd Qt4Qt5
%{qmake_qt5} qscintilla.pro
%make_build
popd

QMAKEFEATURES=`pwd`/Qt5/features; export QMAKEFEATURES
pushd designer-Qt4Qt5
%{qmake_qt5} designer.pro INCLUDEPATH+=../Qt4Qt5 LIBS+=-L../Qt4Qt5
%make_build
popd

pushd Python
%{__python3} \
  configure.py --verbose \
    --pyqt=PyQt5 \
    --sip=/usr/bin/sip-pyqt5 \
    --qsci-incdir=../Qt4Qt5 --qsci-libdir=../Qt4Qt5

cat Qsci/Qsci.pro
make sub-Qsci-qmake_all
sed -i \
    -e '#^CXXFLAGS#s#$# %{build_cxxflags}#' \
    -e '#^LFLAGS#s#$# %{build_ldflags}#'\
    -e '/^INCPATH/s/$/ -I%{_qt5_includedir}\/QtWidgets/' \
    -e '/^LIBS/s/$/ %{_qt5_libdir}\/libQt5Widgets.so/'\
    Qsci/Makefile
cat Qsci/Makefile
%make_build
popd

%install
make -C Qt4Qt5 install INSTALL_ROOT=%{buildroot}
ln -s libqscintilla2_qt5.so %{buildroot}%{_qt5_libdir}/libqscintilla2-qt5.so
make -C designer-Qt4Qt5 install INSTALL_ROOT=%{buildroot}
make -C Python install DESTDIR=%{buildroot} INSTALL_ROOT=%{buildroot}
test -x   %{buildroot}%{python3_sitearch}/PyQt5/Qsci.so || \
chmod a+x %{buildroot}%{python3_sitearch}/PyQt5/Qsci.so

%find_lang qscintilla --with-qt
grep "%{_qt5_translationdir}" qscintilla.lang > qscintilla-qt5.lang

%files qt5 -f qscintilla-qt5.lang
%doc NEWS
%license LICENSE
%{_qt5_libdir}/libqscintilla2_qt5.so.15*
%{_qt5_plugindir}/designer/libqscintillaplugin.so

%files qt5-devel
%doc doc/html-Qt4Qt5 doc/Scintilla example-Qt4Qt5
%{_qt5_headerdir}/Qsci/
%{_qt5_libdir}/libqscintilla2_qt5.so
%{_qt5_archdatadir}/mkspecs/features/qscintilla2.prf
%{_qt5_libdir}/libqscintilla2-qt5.so

%files -n python3-qscintilla-qt5
%{python3_sitearch}/PyQt5/Qsci.*
%{_qt5_datadir}/qsci/
%{python3_sitearch}/QScintilla-%{version}.dist-info/

%files -n python3-qscintilla-qt5-devel
%{py3_sipdir}/PyQt5/Qsci/

%changelog
* Sun Jan 05 2025 Funda Wang <fundawang@yeah.net> - 2.11.6-1
- update to 2.11.6
- drop redunctant conditions regarding qt5 and python3, as we only provide
  single flavour for now

* Fri Feb 18 2022 liwu <liwu13@huawei.com> - 2.11.2-2
- Fix build error of qscintilla

* Mon Jan 11 2021 leiju <leiju4@huawei.com> - 2.11.2-1
- package init