diff --git a/www-client/surf/files/surf-9999-gentoo.patch b/www-client/surf/files/surf-9999-gentoo.patch new file mode 100644 index 0000000..7b783e8 --- /dev/null +++ b/www-client/surf/files/surf-9999-gentoo.patch @@ -0,0 +1,31 @@ +diff --git a/config.mk b/config.mk +index 5e68e38..fa45b55 100644 +--- a/config.mk ++++ b/config.mk +@@ -4,18 +4,18 @@ VERSION = 2.0 + # Customize below to fit your system + + # paths +-PREFIX = /usr/local ++PREFIX = /usr + MANPREFIX = $(PREFIX)/share/man + LIBPREFIX = $(PREFIX)/lib + LIBDIR = $(LIBPREFIX)/surf + +-X11INC = `pkg-config --cflags x11` +-X11LIB = `pkg-config --libs x11` ++X11INC = $(shell $(PKG_CONFIG) --cflags x11) ++X11LIB = $(shell $(PKG_CONFIG) --libs x11) + +-GTKINC = `pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.0` +-GTKLIB = `pkg-config --libs gtk+-3.0 gcr-3 webkit2gtk-4.0` +-WEBEXTINC = `pkg-config --cflags webkit2gtk-4.0 webkit2gtk-web-extension-4.0` +-WEBEXTLIBS = `pkg-config --libs webkit2gtk-4.0 webkit2gtk-web-extension-4.0` ++GTKINC = $(shell $(PKG_CONFIG) --cflags gtk+-3.0 gcr-3 webkit2gtk-4.0) ++GTKLIB = $(shell $(PKG_CONFIG) --libs gtk+-3.0 gcr-3 webkit2gtk-4.0) ++WEBEXTINC = $(shell $(PKG_CONFIG) --cflags webkit2gtk-4.0 webkit2gtk-web-extension-4.0) ++WEBEXTLIBS = $(shell $(PKG_CONFIG) --libs webkit2gtk-4.0 webkit2gtk-web-extension-4.0) + + # includes and libs + INCS = $(X11INC) $(GTKINC) + diff --git a/www-client/surf/metadata.xml b/www-client/surf/metadata.xml new file mode 100644 index 0000000..4a8cfc9 --- /dev/null +++ b/www-client/surf/metadata.xml @@ -0,0 +1,10 @@ + + + + +jer@gentoo.org + + +Without a saved config.h, this package depends on net-misc/curl and x11-terms/st for a default download mechanism + + diff --git a/www-client/surf/surf-9999.ebuild b/www-client/surf/surf-9999.ebuild new file mode 100644 index 0000000..2382f11 --- /dev/null +++ b/www-client/surf/surf-9999.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit git-r3 savedconfig toolchain-funcs + +DESCRIPTION="a simple web browser based on WebKit/GTK+" +HOMEPAGE="https://surf.suckless.org/" +EGIT_REPO_URI="https://git.odrling.xyz/odrling/surf.git" +EGIT_BRANCH="surf-webkit2" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="" + +COMMON_DEPEND=" + app-crypt/gcr[gtk] + dev-libs/glib:2 + net-libs/webkit-gtk:4 + x11-libs/gtk+:3 + x11-libs/libX11 +" +DEPEND=" + ${COMMON_DEPEND} + virtual/pkgconfig +" +RDEPEND=" + !sci-chemistry/surf + ${COMMON_DEPEND} + !savedconfig? ( + >=x11-misc/dmenu-4.7 + net-misc/curl + x11-apps/xprop + x11-terms/st + ) +" +PATCHES=( + "${FILESDIR}"/${PN}-9999-gentoo.patch +) + +pkg_setup() { + if ! use savedconfig; then + elog "The default config.h assumes you have" + elog " net-misc/curl" + elog " x11-terms/st" + elog "installed to support the download function." + elog "Without those, downloads will fail (gracefully)." + elog "You can fix this by:" + elog "1) Installing these packages, or" + elog "2) Setting USE=savedconfig and changing config.h accordingly." + fi +} + +src_prepare() { + default + + restore_config config.h + + tc-export CC PKG_CONFIG +} + +src_install() { + default + + save_config config.h +}