Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FreeBSD build #56

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions gtk3-nocsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@

#include <gobject/gvaluecollector.h>

#ifdef __FreeBSD__
#include <sys/elf_generic.h>
#define ElfW(t) Elf##_##t
#endif

typedef void (*gtk_window_buildable_add_child_t) (GtkBuildable *buildable, GtkBuilder *builder, GObject *child, const gchar *type);
typedef GObject* (*gtk_dialog_constructor_t) (GType type, guint n_construct_properties, GObjectConstructParam *construct_params);
typedef char *(*gtk_check_version_t) (guint required_major, guint required_minor, guint required_micro);
Expand Down
7 changes: 5 additions & 2 deletions gtk3-nocsd.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@
# program to call as its arguments.
#

OS=$(uname | tr "[:upper:]" "[:lower:]")
RLINK_ARGS=$([ "$OS" = "freebsd" ] && echo "-f" || echo "-fe")

GTK3_NOCSD_NAME=libgtk3-nocsd.so.0

# Determine if this script are installed in the system path
GTK3_NOCSD_BINARY="$(readlink -fe "$(which "$0")")"
GTK3_NOCSD_BINARY="$(readlink ${RLINK_ARGS} "$(which "$0")")"
case "${GTK3_NOCSD_BINARY%/*}" in
/sbin|/bin|/usr/bin|/usr/sbin|/usr/local/bin|/usr/local/sbin) IN_SYSTEM_PATH=1 ;;
*) IN_SYSTEM_PATH=0 ;;
Expand Down Expand Up @@ -73,7 +76,7 @@ fi
# Find the real program (the first one that's not symlinked to get3-nocsd)
APPNAME="$(basename "$0")"
for APPPATH in $(which -a "$APPNAME") /bin/false; do
APPPATH_LINK="$(readlink -fe "$APPPATH")"
APPPATH_LINK="$(readlink ${RLINK_ARGS} "$APPPATH")"
[ x"${APPPATH_LINK##*/}"x = x"gtk3-nocsd"x ] || break
done

Expand Down