Skip to content

Commit

Permalink
Merge pull request #1342 from b4n/geniuspaste-libsoup3
Browse files Browse the repository at this point in the history
Various GeniusPaste fixes:

* Port to libsoup3
* Avoid GTK3 deprecations
* Fix GLib >= 2.79 support
* Pastebins updates
  • Loading branch information
b4n committed Jun 16, 2024
2 parents b04c1dc + 4e93f0b commit bc2bf39
Show file tree
Hide file tree
Showing 14 changed files with 195 additions and 68 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
jobs:
linux:
name: Linux Build
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

env:
CC: ccache gcc
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
# geany
autopoint
gettext
python-docutils
python3-docutils
# geany-plugins
intltool
check
Expand All @@ -128,16 +128,18 @@ jobs:
libgtkspell3-3-dev
# geaniuspaste/updatechecker
libsoup2.4-dev
libsoup-3.0-dev
# git-changebar
libgit2-dev
# markdown
libmarkdown2-dev
# markdown/webhelper
libwebkit2gtk-4.0-dev
libwebkit2gtk-4.1-dev
# pretty-printer
libxml2-dev
# spellcheck
libenchant-dev
libenchant-2-dev
# cppcheck
cmake
libpcre3-dev
Expand Down
2 changes: 1 addition & 1 deletion build/ci_mingw64_geany_plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ install_dependencies() {
mingw-w64-${ARCH}-gpgme \
mingw-w64-${ARCH}-gtkspell3 \
mingw-w64-${ARCH}-libgit2 \
mingw-w64-${ARCH}-libsoup \
mingw-w64-${ARCH}-libsoup3 \
mingw-w64-${ARCH}-lua51
}

Expand Down
3 changes: 2 additions & 1 deletion build/geniuspaste.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ AC_DEFUN([GP_CHECK_GENIUSPASTE],
GP_ARG_DISABLE([GeniusPaste], [auto])
GP_CHECK_PLUGIN_DEPS([GeniusPaste], GENIUSPASTE,
[libsoup-2.4 >= 2.4.0])
[gtk+-3.0 >= 3.16
libsoup-3.0])
GP_COMMIT_PLUGIN_STATUS([GeniusPaste])
Expand Down
9 changes: 7 additions & 2 deletions build/gtk-bundle-from-msys2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,30 @@ EXE_WRAPPER_64="mingw-w64-x86_64-wine"
# enchant, hunspell - for SpellCheck plugin
# lua51 - for GeanyLua plugin
# gnupg, gpgme - for GeanyPG plugin
# libsoup - for UpdateChecker plugin
# libsoup3 - for UpdateChecker & GeniusPaste plugins
# libgit2 - for GitChangeBar plugin
# gtkspell3 - for GeanyVC plugin
# the rest is dependency-dependency
packages="
ca-certificates
ctags
ctpl-git
curl
enchant
glib-networking
gnupg
gpgme
gsettings-desktop-schemas
http-parser
hunspell
libassuan
libgcrypt
libgit2
libgpg-error
libidn2
libproxy
libpsl
libsoup
libsoup3
libssh2
libsystre
libunistring
Expand All @@ -51,6 +55,7 @@ p11-kit
readline
sqlite3
termcap
zstd
"

gtk3_dependency_pkgs="
Expand Down
4 changes: 2 additions & 2 deletions geniuspaste/README
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ configuration shipped with the plugin, please report the issue to:

Requirements
------------
* GTK+ >= 2.12
* libsoup 2.4 >= 2.4.0
* GTK+ >= 3.16
* libsoup 3.0

Installation
------------
Expand Down
6 changes: 4 additions & 2 deletions geniuspaste/TODO
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ TODO
----

- recent pastes history
- URL shortening

- URL shortening (?)
- authentication (per-pastebin)
- confirmation dialog/infobar? pasted data is potentially sensitive
- support for Gist, which is likely the most used service
3 changes: 2 additions & 1 deletion geniuspaste/data/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ plugin = geniuspaste
pastebinsdir = $(plugindatadir)/pastebins
dist_pastebins_DATA = \
codepad.org.conf \
dpaste.de.conf \
dpaste.com.conf \
dpaste.org.conf \
fpaste.org.conf \
pastebin.geany.org.conf \
paste.debian.net.conf \
Expand Down
89 changes: 89 additions & 0 deletions geniuspaste/data/dpaste.com.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
[pastebin]
name=dpaste.com
url=https://dpaste.com/api/v2/

[format]
content=%contents%
title=%title%
syntax=%language%
#expiry_days=%expire_days%
poster=%user%

[parse]

[defaults]
language=plain
expire_days=7

# map GeanyFileType=PastebinFileType
[languages]
ActionScript=actionscript
Ada=ada
Arduino=arduino
AutoIt=autoit
Batch=batch
BibTeX=bibtex
CAML=ocaml
C=c
C++=cpp
C#=csharp
Clojure=clojure
CMake=cmake
COBOL=cobol
CoffeeScript=coffeescript
Conf=ini
CSS=css
CUDA=cuda
Cython=cython
D=d
Diff=diff
Docbook=xml
Erlang=erlang
F77=fortran
Forth=forth
Fortran=fortran
GDScript=gdscript
GLSL=glsl
Go=go
Graphviz=graphviz
Groovy=groovy
Haskell=haskell
Haxe=haxe
HTML=html
Java=java
Javascript=js
JSON=json
Julia=julia
Kotlin=kotlin
Lisp=common-lisp
Lua=lua
Make=make
Markdown=md
Matlab/Octave=octave
Meson=meson
Nim=nimrod
NSIS=nsis
Objective-C=objective-c
Perl=perl
PHP=php
Po=pot
PowerShell=powershell
Python=python
reStructuredText=rst
Raku=perl6
Ruby=rb
Rust=rust
Scala=scala
Sh=bash
Smalltalk=smalltalk
SQL=sql
Swift=swift
Tcl=tcl
TypeScript=ts
Vala=vala
Verilog=verilog
VHDL=vhdl
XML=xml
YAML=yaml
Zephir=zephir
None=text
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[pastebin]
name=dpaste.de
url=https://dpaste.de/api/
name=dpaste.org
url=https://dpaste.org/api/

[format]
filename=%title%
Expand All @@ -10,44 +10,51 @@ lexer=%language%

[parse]
search=^"(.+)"$
replace=\1
replace=\\1

[defaults]
# default language to plain which means "Code"
language=plain
expire=604800
language=_code
expire=2592000

# map GeanyFileType=PastebinFileType
[languages]
# list as of 2016-01-14
None=text
None=_text
ActionScript=as
Arduino=arduino
Batch=bat
C=c
# better than nothing
# better than nothing, because the configuration has "cpp" disabled
C++=c
#CAML=ocaml
C#=csharp
CAML=ocaml
Clojure=clojure
CMake=cmake
COBOL=cobol
CoffeeScript=coffee-script
Conf=ini
CSS=css
CUDA=cuda
D=d
Diff=diff
Docbook=xml
Erlang=erlang
F77=fortran
Forth=forth
Fortran=fortran
GLSL=C
GLSL=glsl
Go=go
Haskell=haskell
HTML=html
Java=java
Javascript=js
JSON=json
LaTeX=tex
Kotlin=kotlin
Lisp=common-lisp
Lua=lua
Make=make
Matlab/Octave=matlab
Objective-C=objc
Objective-C=objective-c
Perl=perl
PHP=php
PowerShell=powershell
Expand All @@ -59,6 +66,7 @@ Scala=scala
Sh=bash
SQL=sql
Tcl=tcl
Swift=swift
XML=xml
YAML=yaml
Zephir=php
Zephir=zephir
2 changes: 1 addition & 1 deletion geniuspaste/data/fpaste.org.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ title=%title%

[parse]
search="url" *: *"([^"]+)"
replace=\1
replace=\\1

# map GeanyFileType=PastebinFileType
[languages]
Expand Down
2 changes: 1 addition & 1 deletion geniuspaste/data/paste.debian.net.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[pastebin]
name=paste.debian.net
url=http://paste.debian.net/
url=https://paste.debian.net/

[format]
code=%contents%
Expand Down
2 changes: 1 addition & 1 deletion geniuspaste/data/pastebin.geany.org.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ lexer=%language%

[parse]
search=^.+$
replace=\0
replace=\\0

[defaults]
language=text
Expand Down
2 changes: 1 addition & 1 deletion geniuspaste/data/sprunge.us.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sprunge=%contents%

[parse]
search=^[[:space:]]*(.+?)[[:space:]]*$
replace=\1?%language%
replace=\\1?%language%

# map GeanyFileType=PastebinFileType
[languages]
Expand Down
Loading

0 comments on commit bc2bf39

Please sign in to comment.