diff --git a/srcpkgs/textadept/patches/cmake.patch b/srcpkgs/textadept/patches/cmake.patch new file mode 100644 index 00000000000000..cf34f9199c4198 --- /dev/null +++ b/srcpkgs/textadept/patches/cmake.patch @@ -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) diff --git a/srcpkgs/textadept/template b/srcpkgs/textadept/template index e97f96f2a8c693..b1668989d79eab 100644 --- a/srcpkgs/textadept/template +++ b/srcpkgs/textadept/template @@ -1,10 +1,10 @@ # Template file for 'textadept' pkgname=textadept -version=11.1 +version=12.9 revision=1 -build_wrksrc="src" +build_style=cmake hostmakedepends="tar unzip pkg-config" -makedepends="gtk+3-devel ncurses-devel" +makedepends="qt6-base-devel qt6-qt5compat-devel gtk+3-devel ncurses-devel" short_desc="Fast, minimalist, and extensible text editor for programmers" maintainer="Orphaned " license="MIT" @@ -13,75 +13,62 @@ 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 mkdir -p "${DESTDIR}/usr/share/pixmaps" @@ -90,5 +77,11 @@ do_install() { ln -s "/usr/lib/textadept/core/images/ta_48x48.png" \ "${DESTDIR}/usr/share/pixmaps/textadept.png" - vlicense ../LICENSE + # .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" }