diff --git a/srcpkgs/wordgrinder-x11 b/srcpkgs/wordgrinder-x11 new file mode 120000 index 0000000000..b4bdd9ace5 --- /dev/null +++ b/srcpkgs/wordgrinder-x11 @@ -0,0 +1 @@ +wordgrinder \ No newline at end of file diff --git a/srcpkgs/wordgrinder/patches/fix-objdir.patch b/srcpkgs/wordgrinder/patches/fix-objdir.patch new file mode 100644 index 0000000000..b4fa19a5ab --- /dev/null +++ b/srcpkgs/wordgrinder/patches/fix-objdir.patch @@ -0,0 +1,11 @@ +--- Makefile.orig ++++ Makefile +@@ -11,7 +11,7 @@ + DESTDIR ?= + + # Where do the temporary files go? +-OBJDIR = /tmp/wg-build ++OBJDIR = wg-build + + # The compiler used for the native build (curses, X11) + CC ?= cc diff --git a/srcpkgs/wordgrinder/patches/fix-xft-include.patch b/srcpkgs/wordgrinder/patches/fix-xft-include.patch new file mode 100644 index 0000000000..9ad9fc815f --- /dev/null +++ b/srcpkgs/wordgrinder/patches/fix-xft-include.patch @@ -0,0 +1,11 @@ +--- src/c/arch/unix/x11/x11.h.orig ++++ src/c/arch/unix/x11/x11.h +@@ -7,7 +7,7 @@ + #define X11_H + + #include +-#include ++#include + #include "uthash.h" + + #define MAX(x, y) (((x) > (y)) ? (x) : (y)) diff --git a/srcpkgs/wordgrinder/patches/musl.patch b/srcpkgs/wordgrinder/patches/musl.patch new file mode 100644 index 0000000000..8a559f0ddd --- /dev/null +++ b/srcpkgs/wordgrinder/patches/musl.patch @@ -0,0 +1,11 @@ +--- src/c/arch/unix/cursesw/dpy.c ++++ src/c/arch/unix/cursesw/dpy.c +@@ -12,6 +12,8 @@ + + #define KEY_TIMEOUT (KEY_MAX + 1) + ++typedef uint64_t u_int64_t; ++ + #if defined A_ITALIC + static bool has_italics = false; + #endif diff --git a/srcpkgs/wordgrinder/patches/osexec-bool.patch b/srcpkgs/wordgrinder/patches/osexec-bool.patch new file mode 100644 index 0000000000..713181b0bd --- /dev/null +++ b/srcpkgs/wordgrinder/patches/osexec-bool.patch @@ -0,0 +1,31 @@ +--- build.lua.orig ++++ build.lua +@@ -24,7 +24,7 @@ + if package == "builtin" then + return true + end +- return os.execute("pkg-config "..package) == 0 ++ return os.execute("pkg-config "..package) + end + + local function detect_package(name, package) +@@ -54,7 +54,7 @@ + end + + local function has_binary(binary) +- return os.execute("type "..binary.." >/dev/null 2>&1") == 0 ++ return os.execute("type "..binary.." >/dev/null 2>&1") + end + + local function package_flags(package, kind) +@@ -68,8 +68,8 @@ + end + + local filename = os.tmpname() +- local e = os.execute("pkg-config "..kind.." "..package.." > "..filename) +- if e ~= 0 then ++ ++ if os.execute("pkg-config "..kind.." "..package.." > "..filename) == false then + error("required package "..package.." is not available") + end + local s = io.open(filename):read("*a") diff --git a/srcpkgs/wordgrinder/template b/srcpkgs/wordgrinder/template new file mode 100644 index 0000000000..f07f9dba04 --- /dev/null +++ b/srcpkgs/wordgrinder/template @@ -0,0 +1,41 @@ +# Template file for 'wordgrinder' +pkgname=wordgrinder +version=0.7.1 +revision=1 +hostmakedepends="pkg-config ninja lua" +makedepends="ncurses-devel lua-devel zlib-devel libXft-devel libX11-devel + freetype-devel" +short_desc="A terminal-based word processor" +maintainer="Andrew Benson " +license="MIT" +homepage="http://cowlark.com/wordgrinder" +distfiles="https://github.com/davidgiven/wordgrinder/archive/${version}.tar.gz" +checksum=54085af7963e1f67342bc0b1b20d1ccc75494f2e23d401b601cf3089acea747c + +do_configure() { + export PKG_CONFIG_PATH=${XBPS_CROSS_BASE}/usr/lib/pkgconfig:${XBPS_CROSS_BASE}/usr/share/pkgconfig + export PKG_CONFIG_LIBDIR=${XBPS_CROSS_BASE}/usr/lib/pkgconfig + export PKG_CONFIG_SYSROOT_DIR=${XBPS_CROSS_BASE} + make wg-build/build.ninja LUA_PACKAGE=lua LUA_INTERPRETER=/usr/bin/lua XFT_PACKAGE=xft +} + +do_build() { + ninja -f wg-build/build.ninja bin/xwordgrinder-builtin-x11-release + ninja -f wg-build/build.ninja bin/wordgrinder-builtin-curses-release + ninja -f wg-build/build.ninja bin/wordgrinder.1 +} + +do_install() { + vbin bin/wordgrinder-builtin-curses-release wordgrinder + vbin bin/xwordgrinder-builtin-x11-release xwordgrinder + vman bin/wordgrinder.1 + vlicense licenses/COPYING.WordGrinder +} + +wordgrinder-x11_package() { + short_descr+=" - x11 frontend" + depends="${sourcepkg}-${version}_${revision}" + pkg_install() { + vmove usr/bin/xwordgrinder + } +}