Nuevas plantillas

Estas plantillas son para crear la versión git de algunos programas de la suite suckless
This commit is contained in:
Tuxliban Torvalds 2021-12-28 20:10:18 -06:00
parent 9a206e682b
commit bb7d63501a
15 changed files with 678 additions and 0 deletions

View File

@ -0,0 +1,134 @@
diff --git a/dmenu.c b/dmenu.c
--- a/dmenu.c
+++ b/dmenu.c
@@ -32,6 +32,7 @@ struct item {
char *text;
struct item *left, *right;
int out;
+ int distance;
};
static char text[BUFSIZ] = "";
@@ -264,6 +265,86 @@ match(void)
calcoffsets();
}
+int
+compare_distance(const void *a, const void *b)
+{
+ struct item *da = *(struct item **) a;
+ struct item *db = *(struct item **) b;
+
+ if (!db)
+ return 1;
+ if (!da)
+ return -1;
+
+ return da->distance - db->distance;
+}
+
+void
+fuzzymatch(void)
+{
+ /* bang - we have so much memory */
+ struct item *it;
+ struct item **fuzzymatches = NULL;
+ char c;
+ int number_of_matches = 0, i, pidx, sidx, eidx;
+ int text_len = strlen(text), itext_len;
+
+ matches = matchend = NULL;
+
+ /* walk through all items */
+ for (it = items; it && it->text; it++) {
+ if (text_len) {
+ itext_len = strlen(it->text);
+ pidx = 0;
+ sidx = eidx = -1;
+ /* walk through item text */
+ for (i = 0; i < itext_len && (c = it->text[i]); i++) {
+ /* fuzzy match pattern */
+ if (text[pidx] == c) {
+ if(sidx == -1)
+ sidx = i;
+ pidx++;
+ if (pidx == text_len) {
+ eidx = i;
+ break;
+ }
+ }
+ }
+ /* build list of matches */
+ if (eidx != -1) {
+ /* compute distance */
+ /* factor in 30% of sidx and distance between eidx and total
+ * text length .. let's see how it works */
+ it->distance = eidx - sidx + (itext_len - eidx + sidx) / 3;
+ appenditem(it, &matches, &matchend);
+ number_of_matches++;
+ }
+ } else {
+ appenditem(it, &matches, &matchend);
+ }
+ }
+
+ if (number_of_matches) {
+ /* initialize array with matches */
+ if (!(fuzzymatches = realloc(fuzzymatches, number_of_matches * sizeof(struct item*))))
+ die("cannot realloc %u bytes:", number_of_matches * sizeof(struct item*));
+ for (i = 0, it = matches; it && i < number_of_matches; i++, it = it->right) {
+ fuzzymatches[i] = it;
+ }
+ /* sort matches according to distance */
+ qsort(fuzzymatches, number_of_matches, sizeof(struct item*), compare_distance);
+ /* rebuild list of matches */
+ matches = matchend = NULL;
+ for (i = 0, it = fuzzymatches[i]; i < number_of_matches && it && \
+ it->text; i++, it = fuzzymatches[i]) {
+ appenditem(it, &matches, &matchend);
+ }
+ free(fuzzymatches);
+ }
+ curr = sel = matches;
+ calcoffsets();
+}
+
static void
insert(const char *str, ssize_t n)
{
@@ -274,7 +355,7 @@ insert(const char *str, ssize_t n)
if (n > 0)
memcpy(&text[cursor], str, n);
cursor += n;
- match();
+ fuzzymatch();
}
static size_t
@@ -343,7 +424,7 @@ keypress(XKeyEvent *ev)
case XK_k: /* delete right */
text[cursor] = '\0';
- match();
+ fuzzymatch();
break;
case XK_u: /* delete left */
insert(NULL, 0 - cursor);
@@ -492,7 +573,7 @@ insert:
strncpy(text, sel->text, sizeof text - 1);
text[sizeof text - 1] = '\0';
cursor = strlen(text);
- match();
+ fuzzymatch();
break;
}
@@ -653,7 +734,7 @@ setup(void)
}
promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
inputw = MIN(inputw, mw/3);
- match();
+ fuzzymatch();
/* create menu window */
swa.override_redirect = True;

View File

@ -0,0 +1,50 @@
# Template file for 'dmenu' git version
pkgname=dmenu-git
version=5.0
revision=2
wrksrc="dmenu"
build_style=gnu-makefile
hostmakedepends="git pkg-config"
makedepends="libXinerama-devel libXft-devel freetype-devel"
short_desc="Generic menu for X"
maintainer="Tuxliban Torvalds <tenshalito@gmail.com>"
license="MIT"
homepage="https://tools.suckless.org/dmenu/"
build_options="fuzzymatch"
desc_option_fuzzymatch="Enable Fuzzymatch support"
# Obtener versión más reciente en upstream
do_fetch(){
git clone git://git.suckless.org/dmenu --depth 1
cd ${wrksrc}
git checkout master
}
post_patch() {
if [ "$build_option_fuzzymatch" ]; then
msg_normal "Applying fuzzymatch patches"
patch -slNp1 < "${FILESDIR}/fuzzymatch.patch"
fi
sed -i -e '/CFLAGS/{s/-Os//;s/=/+=/}' \
-e '/LDFLAGS/{s/-s//;s/=/+=/}' config.mk
}
do_build() {
# Si existe una configuración custom del usuario se usará
[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
sed -i -e "s|^FREETYPEINC|#FREETYPEINC|g" \
-e "s|^X11INC|#X11INC|g" \
-e "s|^X11LIB|#X11LIB|g" config.mk
x11inc=$XBPS_CROSS_BASE/usr/include/X11
x11lib=$XBPS_CROSS_BASE/usr/lib
freetypeinc=$XBPS_CROSS_BASE/usr/include/freetype2
make CC="$CC" ${makejobs} X11INC=$x11inc X11LIB=$x11lib FREETYPEINC=$freetypeinc
}
do_install() {
make PREFIX=/usr DESTDIR=${DESTDIR} install
vlicense LICENSE
}

View File

@ -0,0 +1,7 @@
[Desktop Entry]
Encoding=UTF-8
Name=Dwm
Comment=Dynamic window manager
Exec=dwm
Icon=dwm
Type=XSession

View File

@ -0,0 +1,33 @@
# Template file for 'dwm' git version
pkgname=dwm-git
version=6.2
revision=2
wrksrc="dwm"
build_style=gnu-makefile
hostmakedepends="git pkg-config"
makedepends="libXinerama-devel libXft-devel freetype-devel"
short_desc="Dynamic window manager for X"
maintainer="Tuxliban Torvalds <tenshalito@gmail.com>"
license="MIT"
homepage="http://dwm.suckless.org"
# Obtener versión más reciente en upstream
do_fetch(){
git clone git://git.suckless.org/dwm ${wrksrc} --depth 1
cd ${wrksrc}
git checkout master
}
do_build() {
[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
sed -i "/CFLAGS/s|\${CPPFLAGS}|& $CFLAGS|g" config.mk
sed -i "/LDFLAGS/s|\-s|$LDFLAGS|g" config.mk
make CC=$CC INCS="-I. -I${XBPS_CROSS_BASE}/usr/include/freetype2" LIBS="-lX11 -lXinerama -lXft -lfontconfig"
}
do_install() {
make PREFIX=/usr DESTDIR=$DESTDIR install
vinstall README 644 usr/share/doc/$pkgname
vinstall ${FILESDIR}/dwm.desktop 644 usr/share/xsessions
vlicense LICENSE
}

View File

@ -0,0 +1,34 @@
# Template file for 'slock'
pkgname=slock-git
version=1.4
revision=2
wrksrc="slock"
build_style=gnu-makefile
hostmakedepends="git pkg-config"
makedepends="libXrandr-devel"
short_desc="Simple screen locker for X"
maintainer="Tuxliban Torvalds <tenshalito@gmail.com>"
license="MIT"
homepage="http://tools.suckless.org/slock"
# Obtener versión más reciente en upstream
do_fetch(){
git clone git://git.suckless.org/slock --depth 1
cd ${wrksrc}
git checkout master
}
do_build() {
# Si existe una configuración custom del usuario se usará
[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
sed -i 's/CPPFLAGS =/CPPFLAGS +=/g' config.mk
sed -i 's/CFLAGS =/CFLAGS +=/g' config.mk
sed -i 's/LDFLAGS =/LDFLAGS +=/g' config.mk
make CC=$CC INCS="-I." LIBS="-lX11 -lXext -lcrypt -lXrandr" ${makejobs}
}
do_install() {
make PREFIX=/usr DESTDIR=$DESTDIR install
vlicense LICENSE
}

View File

@ -0,0 +1,3 @@
Para usar slstatus, poner lo siguiente en tu archivo "$HOME"/.xinitrc (o similar):
slstatus &

View File

@ -0,0 +1,65 @@
/* See LICENSE file for copyright and license details. */
/* interval between updates (in ms) */
const unsigned int interval = 1000;
/* text to show if no value can be retrieved */
static const char unknown_str[] = "n/a";
/* maximum output string length */
#define MAXLEN 2048
/*
* function description argument (example)
*
* battery_perc battery percentage battery name (BAT0)
* NULL on OpenBSD
* battery_state battery charging state battery name (BAT0)
* NULL on OpenBSD
* battery_remaining battery remaining HH:MM battery name (BAT0)
* NULL on OpenBSD
* cpu_perc cpu usage in percent NULL
* cpu_freq cpu frequency in MHz NULL
* datetime date and time format string (%F %T)
* disk_free free disk space in GB mountpoint path (/)
* disk_perc disk usage in percent mountpoint path (/)
* disk_total total disk space in GB mountpoint path (/")
* disk_used used disk space in GB mountpoint path (/)
* entropy available entropy NULL
* gid GID of current user NULL
* hostname hostname NULL
* ipv4 IPv4 address interface name (eth0)
* ipv6 IPv6 address interface name (eth0)
* kernel_release `uname -r` NULL
* keyboard_indicators caps/num lock indicators format string (c?n?)
* see keyboard_indicators.c
* keymap layout (variant) of current NULL
* keymap
* load_avg load average NULL
* netspeed_rx receive network speed interface name (wlan0)
* netspeed_tx transfer network speed interface name (wlan0)
* num_files number of files in a directory path
* (/home/foo/Inbox/cur)
* ram_free free memory in GB NULL
* ram_perc memory usage in percent NULL
* ram_total total memory size in GB NULL
* ram_used used memory in GB NULL
* run_command custom shell command command (echo foo)
* swap_free free swap in GB NULL
* swap_perc swap usage in percent NULL
* swap_total total swap size in GB NULL
* swap_used used swap in GB NULL
* temp temperature in degree celsius sensor file
* (/sys/class/thermal/...)
* NULL on OpenBSD
* uid UID of current user NULL
* uptime system uptime NULL
* username username of current user NULL
* vol_perc OSS/ALSA volume in percent mixer file (/dev/mixer)
* wifi_perc WiFi signal in percent interface name (wlan0)
* wifi_essid WiFi ESSID interface name (wlan0)
*/
static const struct arg args[] = {
/* function format argument */
{ datetime, "%s", "%F %T" },
};

View File

@ -0,0 +1,29 @@
# Template file for 'slstatus' git version
pkgname=slstatus-git
version=20201130
revision=1
wrksrc="slstatus"
build_style=gnu-makefile
hostmakedepends="git pkg-config"
makedepends="alsa-lib-devel libX11-devel"
short_desc="Suckless status monitor for dwm"
maintainer="Tuxliban Torvalds <tenshalito@gmail.com>"
license="ISC"
homepage="https://tools.suckless.org/slstatus/"
# Obtener versión más reciente en upstream
do_fetch(){
git clone git://git.suckless.org/slstatus ${wrksrc} --depth 1
cd ${wrksrc}
git checkout master
}
pre_build() {
[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
sed -i -e 's|^CFLAGS *=|override CFLAGS +=|g' \
-e 's|^LDFLAGS *=|override LDFLAGS +=|g' config.mk
}
post_install() {
vlicense LICENSE
}

View File

@ -0,0 +1,3 @@
Una ves que se ha copiado el directorio con el contenido de la versión git de st al directorio de plantillas del repositorio de git, se tendrá que crear el siguiente enlace simbólico:
$ ln -s srcpkgs/st-terminfo_git st-terminfo

View File

@ -0,0 +1,5 @@
case "${ACTION}" in
post)
tic -sx usr/share/terminfo/s/st.terminfo
;;
esac

View File

@ -0,0 +1,11 @@
case "${ACTION}" in
pre)
rm usr/share/terminfo/s/st
rm usr/share/terminfo/s/st-bs
rm usr/share/terminfo/s/st-bs-256color
rm usr/share/terminfo/s/st-mono
rm usr/share/terminfo/s/st-meta
rm usr/share/terminfo/s/st-meta-256color
rm usr/share/terminfo/s/st-256color
;;
esac

View File

@ -0,0 +1,42 @@
# Template file for 'st' git version
pkgname=st-git
version=0.8.4
revision=4
wrksrc="st"
build_style=gnu-makefile
hostmakedepends="git pkg-config"
makedepends="fontconfig-devel libX11-devel libXft-devel"
depends="ncurses st-terminfo_git-${version}_${revision}"
short_desc="Simple terminal implementation for X"
maintainer="Tuxliban Torvalds <tenshalito@gmail.com>"
license="MIT"
homepage="https://st.suckless.org"
# Obtener versión más reciente en upstream
do_fetch(){
git clone https://git.suckless.org/st ${wrksrc} --depth 1
cd ${wrksrc}
git checkout master
}
pre_build() {
sed -i 's|Liberation Mono|Monospace|g' config.def.h
# Si existe una configuración custom del usuario se usará
[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
# We will use tic after install. See INSTALL.
vsed -i Makefile -e '/tic/d'
}
post_install() {
vinstall st.info 644 usr/share/terminfo/s st.terminfo
vdoc README
vlicense LICENSE
}
st-terminfo_git_package() {
short_desc+=" - terminfo data"
depends="ncurses"
pkg_install() {
vmove usr/share/terminfo
}
}

View File

@ -0,0 +1,194 @@
/* modifier 0 means no modifier */
static int surfuseragent = 1; /* Append Surf version to default WebKit user agent */
static char *fulluseragent = ""; /* Or override the whole user agent string */
static char *scriptfile = "~/.surf/script.js";
static char *styledir = "~/.surf/styles/";
static char *certdir = "~/.surf/certificates/";
static char *cachedir = "~/.surf/cache/";
static char *cookiefile = "~/.surf/cookies.txt";
/* Webkit default features */
/* Highest priority value will be used.
* Default parameters are priority 0
* Per-uri parameters are priority 1
* Command parameters are priority 2
*/
static Parameter defconfig[ParameterLast] = {
/* parameter Arg value priority */
[AccessMicrophone] = { { .i = 0 }, },
[AccessWebcam] = { { .i = 0 }, },
[Certificate] = { { .i = 0 }, },
[CaretBrowsing] = { { .i = 0 }, },
[CookiePolicies] = { { .v = "@Aa" }, },
[DefaultCharset] = { { .v = "UTF-8" }, },
[DiskCache] = { { .i = 1 }, },
[DNSPrefetch] = { { .i = 0 }, },
[Ephemeral] = { { .i = 0 }, },
[FileURLsCrossAccess] = { { .i = 0 }, },
[FontSize] = { { .i = 12 }, },
[FrameFlattening] = { { .i = 0 }, },
[Geolocation] = { { .i = 0 }, },
[HideBackground] = { { .i = 0 }, },
[Inspector] = { { .i = 0 }, },
[Java] = { { .i = 1 }, },
[JavaScript] = { { .i = 1 }, },
[KioskMode] = { { .i = 0 }, },
[LoadImages] = { { .i = 1 }, },
[MediaManualPlay] = { { .i = 1 }, },
[PreferredLanguages] = { { .v = (char *[]){ NULL } }, },
[RunInFullscreen] = { { .i = 0 }, },
[ScrollBars] = { { .i = 1 }, },
[ShowIndicators] = { { .i = 1 }, },
[SiteQuirks] = { { .i = 1 }, },
[SmoothScrolling] = { { .i = 0 }, },
[SpellChecking] = { { .i = 0 }, },
[SpellLanguages] = { { .v = ((char *[]){ "en_US", NULL }) }, },
[StrictTLS] = { { .i = 1 }, },
[Style] = { { .i = 1 }, },
[WebGL] = { { .i = 0 }, },
[ZoomLevel] = { { .f = 1.0 }, },
};
static UriParameters uriparams[] = {
{ "(://|\\.)suckless\\.org(/|$)", {
[JavaScript] = { { .i = 0 }, 1 },
}, },
};
/* default window size: width, height */
static int winsize[] = { 800, 600 };
static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
WEBKIT_FIND_OPTIONS_WRAP_AROUND;
#define PROMPT_GO "Go:"
#define PROMPT_FIND "Find:"
/* SETPROP(readprop, setprop, prompt)*/
#define SETPROP(r, s, p) { \
.v = (const char *[]){ "/bin/sh", "-c", \
"prop=\"$(printf '%b' \"$(xprop -id $1 "r" " \
"| sed -e 's/^"r"(UTF8_STRING) = \"\\(.*\\)\"/\\1/' " \
" -e 's/\\\\\\(.\\)/\\1/g')\" " \
"| dmenu -p '"p"' -w $1)\" " \
"&& xprop -id $1 -f "s" 8u -set "s" \"$prop\"", \
"surf-setprop", winid, NULL \
} \
}
/* DOWNLOAD(URI, referer) */
#define DOWNLOAD(u, r) { \
.v = (const char *[]){ "st", "-e", "/bin/sh", "-c",\
"curl -g -L -J -O -A \"$1\" -b \"$2\" -c \"$2\"" \
" -e \"$3\" \"$4\"; read", \
"surf-download", useragent, cookiefile, r, u, NULL \
} \
}
/* PLUMB(URI) */
/* This called when some URI which does not begin with "about:",
* "http://" or "https://" should be opened.
*/
#define PLUMB(u) {\
.v = (const char *[]){ "/bin/sh", "-c", \
"xdg-open \"$0\"", u, NULL \
} \
}
/* VIDEOPLAY(URI) */
#define VIDEOPLAY(u) {\
.v = (const char *[]){ "/bin/sh", "-c", \
"mpv --really-quiet \"$0\"", u, NULL \
} \
}
/* styles */
/*
* The iteration will stop at the first match, beginning at the beginning of
* the list.
*/
static SiteSpecific styles[] = {
/* regexp file in $styledir */
{ ".*", "default.css" },
};
/* certificates */
/*
* Provide custom certificate for urls
*/
static SiteSpecific certs[] = {
/* regexp file in $certdir */
{ "://suckless\\.org/", "suckless.org.crt" },
};
#define MODKEY GDK_CONTROL_MASK
/* hotkeys */
/*
* If you use anything else but MODKEY and GDK_SHIFT_MASK, don't forget to
* edit the CLEANMASK() macro.
*/
static Key keys[] = {
/* modifier keyval function arg */
{ MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) },
{ MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
{ MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
{ 0, GDK_KEY_Escape, stop, { 0 } },
{ MODKEY, GDK_KEY_c, stop, { 0 } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_r, reload, { .i = 1 } },
{ MODKEY, GDK_KEY_r, reload, { .i = 0 } },
{ MODKEY, GDK_KEY_l, navigate, { .i = +1 } },
{ MODKEY, GDK_KEY_h, navigate, { .i = -1 } },
/* vertical and horizontal scrolling, in viewport percentage */
{ MODKEY, GDK_KEY_j, scrollv, { .i = +10 } },
{ MODKEY, GDK_KEY_k, scrollv, { .i = -10 } },
{ MODKEY, GDK_KEY_space, scrollv, { .i = +50 } },
{ MODKEY, GDK_KEY_b, scrollv, { .i = -50 } },
{ MODKEY, GDK_KEY_i, scrollh, { .i = +10 } },
{ MODKEY, GDK_KEY_u, scrollh, { .i = -10 } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_k, zoom, { .i = +1 } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_q, zoom, { .i = 0 } },
{ MODKEY, GDK_KEY_minus, zoom, { .i = -1 } },
{ MODKEY, GDK_KEY_plus, zoom, { .i = +1 } },
{ MODKEY, GDK_KEY_p, clipboard, { .i = 1 } },
{ MODKEY, GDK_KEY_y, clipboard, { .i = 0 } },
{ MODKEY, GDK_KEY_n, find, { .i = +1 } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_p, print, { 0 } },
{ MODKEY, GDK_KEY_t, showcert, { 0 } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_a, togglecookiepolicy, { 0 } },
{ 0, GDK_KEY_F11, togglefullscreen, { 0 } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_o, toggleinspector, { 0 } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_c, toggle, { .i = CaretBrowsing } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_f, toggle, { .i = FrameFlattening } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_g, toggle, { .i = Geolocation } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_s, toggle, { .i = JavaScript } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_i, toggle, { .i = LoadImages } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_b, toggle, { .i = ScrollBars } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_t, toggle, { .i = StrictTLS } },
{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } },
};
/* button definitions */
/* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */
static Button buttons[] = {
/* target event mask button function argument stop event */
{ OnLink, 0, 2, clicknewwindow, { .i = 0 }, 1 },
{ OnLink, MODKEY, 2, clicknewwindow, { .i = 1 }, 1 },
{ OnLink, MODKEY, 1, clicknewwindow, { .i = 1 }, 1 },
{ OnAny, 0, 8, clicknavigate, { .i = -1 }, 1 },
{ OnAny, 0, 9, clicknavigate, { .i = +1 }, 1 },
{ OnMedia, MODKEY, 1, clickexternplayer, { 0 }, 1 },
};

View File

@ -0,0 +1,29 @@
# Template file for 'surf' git version
pkgname=surf-git
version=2.1
revision=2
wrksrc="surf"
build_style=gnu-makefile
hostmakedepends="git pkg-config"
makedepends="webkit2gtk-devel gcr-devel"
depends="xprop dmenu"
short_desc="Simple web browser based on WebKit/GTK+"
maintainer="Tuxliban Torvalds <tenshalito@gmail.com>"
license="MIT"
homepage="http://surf.suckless.org"
# Obtener versión más reciente en upstream
do_fetch(){
git clone git://git.suckless.org/surf --depth 1
cd ${wrksrc}
git checkout surf-webkit2
}
pre_build() {
# Si existe una configuración custom del usuario se usará
[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
}
post_install() {
vlicense LICENSE
}

View File

@ -0,0 +1,39 @@
# Template file for 'tabbed' git version
pkgname=tabbed-git
version=0.6
revision=5
wrksrc="tabbed"
build_style=gnu-makefile
make_build_args="INCS=-I. LIBS=-lX11"
hostmakedepends="git pkg-config"
makedepends="freetype-devel libX11-devel libXft-devel"
short_desc="Tab interface for application supporting Xembed"
maintainer="Tuxliban Torvalds <tenshalito@gmail.com>"
license="MIT"
homepage="http://tools.suckless.org/tabbed/"
# Obtener versión más reciente en upstream
do_fetch(){
git clone https://git.suckless.org/tabbed --depth 1
cd ${wrksrc}
git checkout master
}
pre_build() {
sed -i 's|-O0 ||g' config.mk
sed -i 's|^CPPFLAGS =|override CPPFLAGS +=|g' config.mk
sed -i 's|^CFLAGS =|override CFLAGS +=|g' config.mk
sed -i 's|^LDFLAGS =|override LDFLAGS +=|g' config.mk
# Remove BSD_SOURCE warning
sed -i 's/-D_BSD_SOURCE/-D_DEFAULT_SOURCE/g' config.mk
}
do_build() {
# Si existe una configuración custom del usuario se usará
[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
make CC=$CC INCS="-I. -I${XBPS_CROSS_BASE}/usr/include/freetype2" LIBS="-lX11 -lXft -lfontconfig"
}
post_install() {
vlicense LICENSE
}