From e034b3b92a49fe23f9b8e19b9d41448c8e32a991 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Mon, 4 Apr 2022 17:07:01 -0400 Subject: scite 5.2.2 with emitunicode patch, for fedora --- scite-fedora/scite.spec | 107 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 74 insertions(+), 33 deletions(-) (limited to 'scite-fedora/scite.spec') diff --git a/scite-fedora/scite.spec b/scite-fedora/scite.spec index 1b6a692..fe90350 100644 --- a/scite-fedora/scite.spec +++ b/scite-fedora/scite.spec @@ -1,14 +1,41 @@ -# el is on 3.x, fc is on 5.x -%global pkgversion 5.2.1 +# Tunables +# el7 is on 3.x, el8/fc is on 5.x +%global pkgversion 5.2.2 +# Use lua +%define with_lua 1 +# Use bundled lua. If 0, then use distro lua +%define with_bundled_lua 0 +# Add my emitUnicode lua script +%define with_emitunicode 1 +# Choose GTK=2 or GTK=3. El6 is hardcoded to 2. +%define gtk_ 3 + +# Calculated or derived flags. Do not mess with these. %define tarballversion %( echo %pkgversion | tr -d '.' ) +%define luaflag NO_LUA=1 +%if 0%{with_lua} +%define luaflag %nil +%endif +%define gtkflag GTK3=1 +%if 0%{gtk_} == 2 +%define gtkflag %nil +%endif +# Turn off lto for local builds but leave them on for copr +%if !0%{?copr_username:1} +%global _lto_cflags %nil +%endif %global __brp_check_rpaths %{nil} - %define scl_env %{nil} %define scl_buildreq coreutils %if 0%{?el6} %define scl_env devtoolset-7 %define scl_buildreq devtoolset-7-toolchain + %define gtk_ 2 %endif +%global all_build_flags '%{?_smp_mflags} LDFLAGS="%{?__global_ldflags} -shared -dynamiclib" \ + CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" %{gtkflag} DEBUG=1 %{luaflag} libdir=%{_libdir}' +# Just for vim: +#' Name: scite Version: %{pkgversion} @@ -20,15 +47,26 @@ Url: http://www.scintilla.org/SciTE.html Packager: B. Stack Source0: https://www.scintilla.org/scite%{tarballversion}.tgz +%if 0%{with_emitunicode} +Source1: emitUnicode.lua +%endif Patch0: scite-utf8.patch +Patch1: add-emitUnicode.patch +%if 0%{with_lua} && !0%{with_bundled_lua} +Patch2: use-lua5.4.4.patch +%endif BuildRequires: desktop-file-utils BuildRequires: gcc-c++ BuildRequires: %{scl_buildreq} -%if !0%{?el6} +%if 0%{gtk_} == 3 BuildRequires: gtk3-devel -%endif +%else BuildRequires: gtk2-devel +%endif +%if 0%{with_lua} && !0%{with_bundled_lua} +BuildRequires: lua-devel +%endif Provides: bundled(scintilla) = %{version} @@ -38,41 +76,37 @@ Scintilla, it has grown to be a generally useful editor with facilities for building and running programs. %prep +echo "USING gtkflag=\"%{gtkflag}\"" %setup -q -c %patch0 +%if !0%{with_lua} #remove bundled lua rm -rf scite/lua +%else +%if !0%{with_bundled_lua} +# Use distro lua +rm -rf scite/lua +%patch2 -p1 +%endif +%endif +%patch1 -p1 %build - -%if 0%{?el6} - %if "%{?scl_env}" != "" - scl enable %{scl_env} /bin/bash <<'EOFSCL' - %endif - make %{?_smp_mflags} LDFLAGS="%{?__global_ldflags} -shared -dynamiclib" \ - CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" DEBUG=1 -C lexilla/src \ - libdir=%{_libdir} - make %{?_smp_mflags} LDFLAGS="%{?__global_ldflags} -shared -dynamiclib" \ - CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" DEBUG=1 -C scintilla/gtk \ - libdir=%{_libdir} - #Build without lua support - make %{?_smp_mflags} LDFLAGS="%{?__global_ldflags}" \ - CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" DEBUG=1 NO_LUA=1 -C scite/gtk \ - libdir=%{_libdir} - %if "%{?scl_env}" != "" +%if "%{?scl_env}" != "" + scl enable %{scl_env} /bin/bash <<'EOFSCL' +%endif +make %{?_smp_mflags} LDFLAGS="%{?__global_ldflags} -shared -dynamiclib" \ + CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" %{gtkflag} DEBUG=1 %{luaflag} -C lexilla/src \ + libdir=%{_libdir} +make %{?_smp_mflags} LDFLAGS="%{?__global_ldflags} -shared -dynamiclib" \ + CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" %{gtkflag} DEBUG=1 %{luaflag} -C scintilla/gtk \ + libdir=%{_libdir} +#Build without lua support +make %{?_smp_mflags} LDFLAGS="%{?__global_ldflags}" \ + CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" %{gtkflag} DEBUG=1 %{luaflag} -C scite/gtk \ + libdir=%{_libdir} +%if "%{?scl_env}" != "" EOFSCL - %endif -%else - make %{?_smp_mflags} LDFLAGS="%{?__global_ldflags} -shared -dynamiclib" \ - CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" GTK3=1 DEBUG=1 -C lexilla/src \ - libdir=%{_libdir} - make %{?_smp_mflags} LDFLAGS="%{?__global_ldflags} -shared -dynamiclib" \ - CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" GTK3=1 DEBUG=1 -C scintilla/gtk \ - libdir=%{_libdir} - #Build without lua support - make %{?_smp_mflags} LDFLAGS="%{?__global_ldflags}" \ - CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" GTK3=1 DEBUG=1 NO_LUA=1 -C scite/gtk \ - libdir=%{_libdir} %endif %install @@ -88,6 +122,9 @@ desktop-file-install --delete-original \ --remove-key Encoding \ %{buildroot}%{_datadir}/applications/SciTE.desktop +%if 0%{with_emitunicode} +install -D -p -m 644 %{SOURCE1} %{buildroot}%{_datadir}/scite/emitUnicode.lua +%endif %if 0%{?fedora} %posttrans /usr/bin/update-desktop-database &> /dev/null || : @@ -110,6 +147,10 @@ desktop-file-install --delete-original \ %{_libdir}/* %changelog +* Mon Apr 04 2022 B. Stack - 5.2.2-1/3.7.6-1 +- Update version +- Add tunables: gtk, lua, bundled lua, add emitunicode + * Thu Mar 24 2022 B. Stack - 5.2.1-1/3.7.6-1 - Update version -- cgit From 3e77defcfdf085b03b0c8cc6d7742e48c5b46b44 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Tue, 5 Apr 2022 15:49:43 -0400 Subject: use full global.properties in rpm --- scite-fedora/scite.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scite-fedora/scite.spec') diff --git a/scite-fedora/scite.spec b/scite-fedora/scite.spec index fe90350..d51ddd2 100644 --- a/scite-fedora/scite.spec +++ b/scite-fedora/scite.spec @@ -50,8 +50,8 @@ Source0: https://www.scintilla.org/scite%{tarballversion}.tgz %if 0%{with_emitunicode} Source1: emitUnicode.lua %endif +Source2: SciTEGlobal.properties Patch0: scite-utf8.patch -Patch1: add-emitUnicode.patch %if 0%{with_lua} && !0%{with_bundled_lua} Patch2: use-lua5.4.4.patch %endif @@ -89,7 +89,6 @@ rm -rf scite/lua %patch2 -p1 %endif %endif -%patch1 -p1 %build %if "%{?scl_env}" != "" @@ -110,7 +109,7 @@ EOFSCL %endif %install -make DESTDIR=%{buildroot} -C scite/gtk install libdir=%{_libdir} +make DESTDIR=%{buildroot} %{gtkflag} -C scite/gtk install libdir=%{_libdir} ln -s SciTE %{buildroot}%{_bindir}/scite # include man-page @@ -125,6 +124,7 @@ desktop-file-install --delete-original \ %if 0%{with_emitunicode} install -D -p -m 644 %{SOURCE1} %{buildroot}%{_datadir}/scite/emitUnicode.lua %endif +install -D -p -m 666 %{SOURCE2} %{buildroot}%{_datadir}/scite/SciTEGlobal.properties %if 0%{?fedora} %posttrans /usr/bin/update-desktop-database &> /dev/null || : @@ -150,6 +150,7 @@ install -D -p -m 644 %{SOURCE1} %{buildroot}%{_datadir}/scite/emitUnicode.lua * Mon Apr 04 2022 B. Stack - 5.2.2-1/3.7.6-1 - Update version - Add tunables: gtk, lua, bundled lua, add emitunicode +- Add customized SciTEGlobal.properties * Thu Mar 24 2022 B. Stack - 5.2.1-1/3.7.6-1 - Update version -- cgit From 6253daa83d11aa07027476d05b4385295c3fe944 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Thu, 7 Apr 2022 09:43:17 -0400 Subject: fix #29: add functions to scite stackrpms.lua --- scite-fedora/scite.spec | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'scite-fedora/scite.spec') diff --git a/scite-fedora/scite.spec b/scite-fedora/scite.spec index d51ddd2..1cc96e7 100644 --- a/scite-fedora/scite.spec +++ b/scite-fedora/scite.spec @@ -5,8 +5,8 @@ %define with_lua 1 # Use bundled lua. If 0, then use distro lua %define with_bundled_lua 0 -# Add my emitUnicode lua script -%define with_emitunicode 1 +# Add my custom lua script +%define with_custom_script 1 # Choose GTK=2 or GTK=3. El6 is hardcoded to 2. %define gtk_ 3 @@ -47,8 +47,8 @@ Url: http://www.scintilla.org/SciTE.html Packager: B. Stack Source0: https://www.scintilla.org/scite%{tarballversion}.tgz -%if 0%{with_emitunicode} -Source1: emitUnicode.lua +%if 0%{with_custom_script} +Source1: stackrpms.lua %endif Source2: SciTEGlobal.properties Patch0: scite-utf8.patch @@ -121,8 +121,8 @@ desktop-file-install --delete-original \ --remove-key Encoding \ %{buildroot}%{_datadir}/applications/SciTE.desktop -%if 0%{with_emitunicode} -install -D -p -m 644 %{SOURCE1} %{buildroot}%{_datadir}/scite/emitUnicode.lua +%if 0%{with_custom_script} +install -D -p -m 644 %{SOURCE1} %{buildroot}%{_datadir}/scite/stackrpms.lua %endif install -D -p -m 666 %{SOURCE2} %{buildroot}%{_datadir}/scite/SciTEGlobal.properties %if 0%{?fedora} @@ -147,9 +147,9 @@ install -D -p -m 666 %{SOURCE2} %{buildroot}%{_datadir}/scite/SciTEGlobal.proper %{_libdir}/* %changelog -* Mon Apr 04 2022 B. Stack - 5.2.2-1/3.7.6-1 +* Mon Apr 04 2022 B. Stack - 5.2.2-2/3.7.6-1 - Update version -- Add tunables: gtk, lua, bundled lua, add emitunicode +- Add tunables: gtk, lua, bundled lua, add stackrpms.lua - Add customized SciTEGlobal.properties * Thu Mar 24 2022 B. Stack - 5.2.1-1/3.7.6-1 -- cgit