Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions srcpkgs/textadept/patches/cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,7 +74,7 @@ set(deps_dir ${CMAKE_BINARY_DIR}/_deps)
if(POLICY CMP0135) # CMake 3.24 adds DOWNLOAD_EXTRACT_TIMESTAMP to FetchContent_Declare()
cmake_policy(SET CMP0135 NEW)
endif()
-function(fetch name url)
+function(fetch name url hash)
string(REGEX MATCH "[^/]+$" archive ${url})
list(FIND nightlies ${name} can_use_nightly)
if(NIGHTLY AND can_use_nightly GREATER -1)
@@ -86,19 +86,19 @@ function(fetch name url)
if(EXISTS ${patch})
set(patch_command PATCH_COMMAND patch -N -p1 < ${patch})
endif()
- FetchContent_Declare(${name} URL ${url} ${patch_command})
+ FetchContent_Declare(${name} URL ${url} URL_HASH SHA256=${hash} ${patch_command})
# Note: cannot FetchContent_MakeAvailable(${name}) here, as name must be a literal.
endfunction()
-fetch(scintilla https://www.scintilla.org/scintilla557.tgz)
-fetch(scinterm https://github.com/orbitalquark/scinterm/archive/scinterm_5.5.zip)
-fetch(scintillua https://github.com/orbitalquark/scintillua/archive/scintillua_6.6.zip)
-fetch(lua https://www.lua.org/ftp/lua-5.4.8.tar.gz)
-fetch(lpeg https://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.1.0.tar.gz)
-fetch(lfs https://github.com/keplerproject/luafilesystem/archive/v1_8_0.zip)
-fetch(regex https://github.com/orbitalquark/lua-std-regex/archive/1.0.zip)
-fetch(cdk https://github.com/ThomasDickey/cdk-snapshots/archive/refs/tags/t20240619.tar.gz)
-fetch(termkey https://www.leonerd.org.uk/code/libtermkey/libtermkey-0.22.tar.gz)
-fetch(reproc https://github.com/DaanDeMeyer/reproc/archive/refs/tags/v14.2.5.zip)
+fetch(scintilla https://www.scintilla.org/scintilla557.tgz b37e1a239ff8c77cebd72db6ce25264b35cbecbbffad60f9ce7e838f5195a21e)
+fetch(scinterm https://github.com/orbitalquark/scinterm/archive/scinterm_5.5.zip 1bf084ccd564c0997c0881664a3b5510e5f56c3aa79e73bd8494775632d07f79)
+fetch(scintillua https://github.com/orbitalquark/scintillua/archive/scintillua_6.6.zip ac5cdaf7f21279eb771ac122f6608cea6525f66a6d05f38a59bc4cc98290bc60)
+fetch(lua https://www.lua.org/ftp/lua-5.4.8.tar.gz 4f18ddae154e793e46eeab727c59ef1c0c0c2b744e7b94219710d76f530629ae)
+fetch(lpeg https://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.1.0.tar.gz 4b155d67d2246c1ffa7ad7bc466c1ea899bbc40fef0257cc9c03cecbaed4352a)
+fetch(lfs https://github.com/keplerproject/luafilesystem/archive/v1_8_0.zip e3a6beca7a8a90522eed31db6ccdc5ed65a433826500c6862784e27671b9e18a)
+fetch(regex https://github.com/orbitalquark/lua-std-regex/archive/1.0.zip 5b684a1ce7ea632a37aa4f98bcf265cd97d9d70c5998c56985295c6aa97e74e1)
+fetch(cdk https://github.com/ThomasDickey/cdk-snapshots/archive/refs/tags/t20240619.tar.gz 69a2c96ce23b3137929ecc011c67b030554cc532ab00a011cbbccf01dacaa611)
+fetch(termkey https://www.leonerd.org.uk/code/libtermkey/libtermkey-0.22.tar.gz 6945bd3c4aaa83da83d80a045c5563da4edd7d0374c62c0d35aec09eb3014600)
+fetch(reproc https://github.com/DaanDeMeyer/reproc/archive/refs/tags/v14.2.5.zip 21b168c38adb22f4b48391d8193dbc3927f1f2e678c2058d6944a29b64acc6c9)
FetchContent_MakeAvailable(scintilla scinterm lua lpeg lfs regex cdk termkey)
if(POLICY CMP0169) # CMake 3.28 adds EXCLUDE_FROM_ALL to FetchContent_MakeAvailable()
cmake_policy(SET CMP0169 OLD)
@@ -110,7 +110,7 @@ if(WIN32)
FetchContent_MakeAvailable(pdcurses iconv)
endif()
if(QT)
- fetch(singleapp https://github.com/itay-grudev/SingleApplication/archive/refs/tags/v3.5.3.zip)
+ fetch(singleapp https://github.com/itay-grudev/SingleApplication/archive/refs/tags/v3.5.3.zip ec8a68a24da974397668370a5a9d1fe281bfcbd7390ed1b14642921634f1881f)
set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication")
set(QT_DEFAULT_MAJOR_VERSION ${QT_VERSION_MAJOR})
FetchContent_MakeAvailable(singleapp)
115 changes: 54 additions & 61 deletions srcpkgs/textadept/template
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Template file for 'textadept'
pkgname=textadept
version=11.1
version=12.9
revision=1
build_wrksrc="src"
hostmakedepends="tar unzip pkg-config"
makedepends="gtk+3-devel ncurses-devel"
build_style=cmake
hostmakedepends="tar unzip pkg-config qt6-base"
makedepends="qt6-base-private-devel qt6-qt5compat-devel gtk+3-devel ncurses-devel"
short_desc="Fast, minimalist, and extensible text editor for programmers"
maintainer="Orphaned <orphan@voidlinux.org>"
license="MIT"
Expand All @@ -13,82 +13,75 @@ homepage="https://orbitalquark.github.io/textadept/"
# for distfiles and skip_extraction variables on every new release (and
# checksums updated accordingly). This is so that XBPS can cache them. Details:
# https://github.com/void-linux/void-packages/pull/15627#issuecomment-549018252
# This goes for cmake.patch as well.
distfiles="https://github.com/orbitalquark/textadept/archive/textadept_${version}.tar.gz
https://www.scintilla.org/scintilla445.tgz
https://github.com/orbitalquark/scinterm/archive/6a774158d8a3c7bc7ea120bc01cdb016fa351a7e.zip
https://github.com/orbitalquark/scintillua/archive/scintillua_4.4.5-2.zip
https://www.lua.org/ftp/lua-5.3.5.tar.gz
http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.0.2.tar.gz
https://www.scintilla.org/scintilla557.tgz
https://github.com/orbitalquark/scinterm/archive/scinterm_5.5.zip
https://github.com/orbitalquark/scintillua/archive/scintillua_6.6.zip
https://www.lua.org/ftp/lua-5.4.8.tar.gz
https://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.1.0.tar.gz
https://github.com/keplerproject/luafilesystem/archive/v1_8_0.zip
https://github.com/orbitalquark/gtdialog/archive/64587546482a1a6324706d75c80b77d2f87118a4.zip
https://invisible-mirror.net/archives/cdk/cdk-5.0-20200923.tgz
http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.20.tar.gz"
checksum="55d153fba03aa2e12c2865f38f378154bbc7d2d3e3448a3682b46ee17056fb4c
4f2168684b4024dc3d6b267320fff1d729192047f4a1b79aeab9ec7c64f733ec
3b1e3cc3ee48bb158d1d666c7c86d190905c973918914876f6ab3712f8dd7d20
ccd5b3d615116b8c4376086cf1d03b6ef1f67a565e57446b15eba3f39ef0c180
0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac
48d66576051b6c78388faad09b70493093264588fcd0f258ddaab1cdd4a15ffe
https://github.com/orbitalquark/lua-std-regex/archive/1.0.zip
https://github.com/ThomasDickey/cdk-snapshots/archive/refs/tags/t20240619.tar.gz
https://www.leonerd.org.uk/code/libtermkey/libtermkey-0.22.tar.gz
https://github.com/DaanDeMeyer/reproc/archive/refs/tags/v14.2.5.zip
https://github.com/itay-grudev/SingleApplication/archive/refs/tags/v3.5.3.zip"
checksum="b675549ea3a77638f7bc02cf0f065c35eb2b3eb8ea721c40ea4539752a14b08b
b37e1a239ff8c77cebd72db6ce25264b35cbecbbffad60f9ce7e838f5195a21e
1bf084ccd564c0997c0881664a3b5510e5f56c3aa79e73bd8494775632d07f79
ac5cdaf7f21279eb771ac122f6608cea6525f66a6d05f38a59bc4cc98290bc60
4f18ddae154e793e46eeab727c59ef1c0c0c2b744e7b94219710d76f530629ae
4b155d67d2246c1ffa7ad7bc466c1ea899bbc40fef0257cc9c03cecbaed4352a
e3a6beca7a8a90522eed31db6ccdc5ed65a433826500c6862784e27671b9e18a
093a4f973196083610c4489e8d9272f340ebf82d48c064f1542c6464eda2af82
007f5de880cb2eebd8556df7e4cd8673d5e64c9970147eee6923a814c29faaed
6c0d87c94ab9915e76ecd313baec08dedf3bd56de83743d9aa923a081935d2f5"
skip_extraction="scintilla445.tgz
6a774158d8a3c7bc7ea120bc01cdb016fa351a7e.zip
scintillua_4.4.5-2.zip
lua-5.3.5.tar.gz
lpeg-1.0.2.tar.gz
v1_8_0.zip
64587546482a1a6324706d75c80b77d2f87118a4.zip
cdk-5.0-20200923.tgz
libtermkey-0.20.tar.gz"
5b684a1ce7ea632a37aa4f98bcf265cd97d9d70c5998c56985295c6aa97e74e1
69a2c96ce23b3137929ecc011c67b030554cc532ab00a011cbbccf01dacaa611
6945bd3c4aaa83da83d80a045c5563da4edd7d0374c62c0d35aec09eb3014600
21b168c38adb22f4b48391d8193dbc3927f1f2e678c2058d6944a29b64acc6c9
ec8a68a24da974397668370a5a9d1fe281bfcbd7390ed1b14642921634f1881f"
skip_extraction="scintilla557.tgz
scinterm_5.5.zip
scintillua_6.6.zip
lua-5.4.8.tar.gz
lpeg-1.1.0.tar.gz
v1_8_0.zip
1.0.zip
t20240619.tar.gz
libtermkey-0.22.tar.gz
v14.2.5.zip
v3.5.3.zip"

post_extract() {
# We copy the downloaded dep files to src directory so that they are found
# and not downloaded again by the build process. This helps to utilize caching.
# We copy the downloaded dep files to build directory so that cmake doesn't try to redownload them.
# This prevents build errors (xbps-src cmake can't use FetchContent) and improves caching.
mkdir -p "${wrksrc}/${build_wrksrc}/${cmake_builddir:=build}/_deps"
echo "${skip_extraction}" | while read archive; do
if [ -f "${XBPS_SRCDISTDIR}/${sourcepkg}-${version}/${archive}" ]; then
cp "${XBPS_SRCDISTDIR}/${sourcepkg}-${version}/${archive}" \
"${wrksrc}/${build_wrksrc}/"
"${wrksrc}/${build_wrksrc}/${cmake_builddir:=build}/_deps"
fi
done
}

pre_configure() {
# For cross builds
vsed -i \
-e '/^CC =/d' \
-e '/^CFLAGS =/d' \
-e '/^CXX =/d' \
-e 's/^CXXFLAGS =.*/CXXFLAGS += -std=c++17/' Makefile
}

do_build() {
make deps
# fix build with gcc 12 https://github.com/orbitalquark/textadept/issues/110
# from https://aur.archlinux.org/cgit/aur.git/commit/PKGBUILD?h=textadept&id=c07c879175c8bea2f43169c71887bd9ebdf8969d
vsed -i '1008s/volatile//;1099s/volatile//;' scintilla/gtk/ScintillaGTKAccessible.cxx
make ${makejobs} GTK3=1
make ${makejobs} curses
}

do_install() {
make PREFIX=/usr DESTDIR="${DESTDIR}" install
make curses PREFIX=/usr DESTDIR="${DESTDIR}" install

# Binaries in /usr/share/textadept are not allowed
# So we relocate to /usr/lib/textadept
post_install() {
# Binaries in /usr/share/textadept are not allowed, so we relocate to /usr/lib/textadept
mkdir -p "${DESTDIR}/usr/bin"
mv "${DESTDIR}/usr/share/textadept" "${DESTDIR}/usr/lib/textadept"
ln -sf "/usr/lib/textadept/textadept" "${DESTDIR}/usr/bin/textadept"
ln -sf "/usr/lib/textadept/textadept-curses" \
"${DESTDIR}/usr/bin/textadept-curses"
ln -sf "/usr/lib/textadept/textadept-gtk" "${DESTDIR}/usr/bin/textadept-gtk"
ln -sf "/usr/lib/textadept/textadept-curses" "${DESTDIR}/usr/bin/textadept-curses"

# For icons
# Link icons
mkdir -p "${DESTDIR}/usr/share/pixmaps"
ln -s "/usr/lib/textadept/core/images/textadept.svg" \
"${DESTDIR}/usr/share/pixmaps/textadept.svg"
ln -s "/usr/lib/textadept/core/images/ta_48x48.png" \
"${DESTDIR}/usr/share/pixmaps/textadept.png"

vlicense ../LICENSE
# Link .desktop entries
# We don't link the GTK entry, as it has the same name as the QT entry
mkdir -p "${DESTDIR}/usr/share/applications"
ln -s "/usr/lib/textadept/textadept.desktop" "${DESTDIR}/usr/share/applications"
ln -s "/usr/lib/textadept/textadept-curses.desktop" "${DESTDIR}/usr/share/applications"

vlicense "${wrksrc}/${build_wrksrc}/LICENSE"
}
Loading