Skip to content

Commit

Permalink
Merge commit 'refs/merge-requests/16' of git://gitorious.org/sparkles…
Browse files Browse the repository at this point in the history
…hare/sparkleshare into autofoo
  • Loading branch information
hbons committed Jun 18, 2010
2 parents b9bae4e + 2a68903 commit dbcd4fa
Show file tree
Hide file tree
Showing 81 changed files with 1,514 additions and 38 deletions.
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,36 @@
*.exe.mdb
*.userprefs
*.pidb
*.gmo
/SparkleShare/bin
/SparkleShare/obj
/notify-sharp/bin
/notify-sharp/obj
po/POTFILES
Makefile.in
Makefile
POTFILES
intltool-*
configure
config.guess
config.h
config.h.in
config.log
config.status
config.sub
INSTALL
aclocal.m4
autom4te.cache/
bin/
install-sh
libtool
ltmain.sh
missing
po/.intltool-merge-cache
po/Makefile.in.in
po/stamp-it
SparkleShare/AssemblyInfo.cs
build/m4/shave/shave
build/m4/*.m4
build/m4/shave/shave-libtool
Defines.cs
29 changes: 0 additions & 29 deletions Makefile

This file was deleted.

12 changes: 12 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
SUBDIRS = \
build \
notify-sharp \
SparkleShare \
data \
po

DISTCLEANFILES = \
intltool-extract \
intltool-merge \
intltool-update

11 changes: 11 additions & 0 deletions SparkleShare/AssemblyInfo.cs.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* AssemblyInfo.cs
*
* This is free software. See COPYING for details.
*/

using System.Reflection;
using System.Runtime.CompilerServices;

[assembly: AssemblyVersion("@VERSION@")]
[assembly: AssemblyTitle ("SparkleShare")]
28 changes: 28 additions & 0 deletions SparkleShare/Defines.cs.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SparkleShare, an instant update workflow to Git.
// Copyright (C) 2010 Hylke Bons <[email protected]>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

using System;

namespace SparkleShare
{
public class Defines
{
public const string VERSION = "@VERSION@";
public const string LOCALE_DIR = "@prefix@/share/locale";
public const string GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@";
public const string PREFIX = "@prefix@";
}
}
24 changes: 24 additions & 0 deletions SparkleShare/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ASSEMBLY = SparkleShare
TARGET = exe

LINK = $(REF_SPARKLESHARE)


SOURCES = \
Defines.cs \
SparkleBubble.cs \
SparkleDialog.cs \
SparkleHelpers.cs \
SparklePaths.cs \
SparklePlatform.cs \
SparkleRepo.cs \
SparkleShare.cs \
SparkleSpinner.cs \
SparkleStatusIcon.cs \
SparkleUI.cs \
SparkleWindow.cs

include $(top_srcdir)/build/build.mk

bin_SCRIPTS = sparkleshare

2 changes: 1 addition & 1 deletion SparkleShare/SparklePaths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static class SparklePaths

public static string SparkleConfigPath = SparkleHelpers.CombineMore (HomePath, ".config", "sparkleshare");

public static string SparkleInstallPath = SparkleHelpers.CombineMore ("usr", "share",
public static string SparkleInstallPath = SparkleHelpers.CombineMore (Defines.PREFIX,
"sparkleshare", "icons", "hicolor");

public static string SparkleAvatarPath {
Expand Down
2 changes: 1 addition & 1 deletion SparkleShare/SparkleShare.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void Main (string [] args)
{

// Use translations
Catalog.Init ("i18n", "locale");
Catalog.Init (Defines.GETTEXT_PACKAGE, Defines.LOCALE_DIR);

// Check if git is installed
Process Process = new Process ();
Expand Down
8 changes: 4 additions & 4 deletions SparkleShare/SparkleStatusIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void ShowMenu (object o, EventArgs Args)
Menu.Add (StatusMenuItem);
Menu.Add (new SeparatorMenuItem ());

Action FolderAction = new Action ("", "SparkleShare");
Gtk.Action FolderAction = new Gtk.Action ("", "SparkleShare");
FolderAction.IconName = "folder-sparkleshare";
FolderAction.IsImportant = true;
FolderAction.Activated += delegate {
Expand All @@ -100,12 +100,12 @@ public void ShowMenu (object o, EventArgs Args)
};
Menu.Add (FolderAction.CreateMenuItem ());

Action [] FolderItems =
new Action [SparkleShare.Repositories.Length];
Gtk.Action [] FolderItems =
new Gtk.Action [SparkleShare.Repositories.Length];

int i = 0;
foreach (SparkleRepo SparkleRepo in SparkleShare.Repositories) {
FolderItems [i] = new Action ("", SparkleRepo.Name);
FolderItems [i] = new Gtk.Action ("", SparkleRepo.Name);
FolderItems [i].IconName = "folder";
FolderItems [i].IsImportant = true;
FolderItems [i].Activated += CreateWindowDelegate (SparkleRepo);
Expand Down
6 changes: 3 additions & 3 deletions sparkleshare → SparkleShare/sparkleshare.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [[ "$1" == "start" ]]; then
echo -n "Starting SparkleShare..."
mkdir -p /tmp/sparkleshare/
# Start SparkleShare in the background and save the pid
mono /usr/local/share/sparkleshare/SparkleShare.exe $2 &
mono "@expanded_libdir@/@PACKAGE@/SparkleShare.exe" $2 &
PID=$!
echo $PID > /tmp/sparkleshare/sparkleshare.pid
echo " Done."
Expand Down Expand Up @@ -52,13 +52,13 @@ if [[ "$1" == "restart" ]]; then
echo -n "Starting SparkleShare..."

# Start SparkleShare in the background and save the pid
mono /usr/local/share/sparkleshare/SparkleShare.exe $2 &
mono "@expanded_libdir@/@PACKAGE@/SparkleShare.exe" $2 &
PID=$!
echo $PID > /tmp/sparkleshare/sparkleshare.pid
echo " Done."
fi
fi

if [[ "$1" == "--help" ]]; then
mono /usr/local/share/sparkleshare/SparkleShare.exe --help
mono "@expanded_libdir@/@PACKAGE@/SparkleShare.exe" --help
fi
85 changes: 85 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/usr/bin/env bash

PROJECT=sparkleshare

function error () {
echo "Error: $1" 1>&2
exit 1
}

function check_autotool_version () {
which $1 &>/dev/null || {
error "$1 is not installed, and is required to configure $PACKAGE"
}

version=$($1 --version | head -n 1 | cut -f4 -d' ')
major=$(echo $version | cut -f1 -d.)
minor=$(echo $version | cut -f2 -d.)
rev=$(echo $version | cut -f3 -d. | sed 's/[^0-9].*$//')
major_check=$(echo $2 | cut -f1 -d.)
minor_check=$(echo $2 | cut -f2 -d.)
rev_check=$(echo $2 | cut -f3 -d.)

if [ $major -lt $major_check ]; then
do_bail=yes
elif [[ $minor -lt $minor_check && $major = $major_check ]]; then
do_bail=yes
elif [[ $rev -lt $rev_check && $minor = $minor_check && $major = $major_check ]]; then
do_bail=yes
fi

if [ x"$do_bail" = x"yes" ]; then
error "$1 version $2 or better is required to configure $PROJECT"
fi
}

function run () {
echo "Running $@ ..."
$@ 2>.autogen.log || {
cat .autogen.log 1>&2
rm .autogen.log
error "Could not run $1, which is required to configure $PROJECT"
}
rm .autogen.log
}

srcdir=$(dirname $0)
test -z "$srcdir" && srcdir=.

(test -f $srcdir/configure.ac) || {
error "Directory \"$srcdir\" does not look like the top-level $PROJECT directory"
}

# MacPorts on OS X only seems to have glibtoolize
WHICHLIBTOOLIZE=$(which libtoolize || which glibtoolize)
if [ x"$WHICHLIBTOOLIZE" == x"" ]; then
error "libtool is required to configure $PROJECT"
fi
LIBTOOLIZE=$(basename $WHICHLIBTOOLIZE)

check_autotool_version aclocal 1.9
check_autotool_version automake 1.9
check_autotool_version autoconf 2.53
check_autotool_version $LIBTOOLIZE 1.4.3
check_autotool_version intltoolize 0.35.0
check_autotool_version pkg-config 0.14.0

run intltoolize --force --copy
run $LIBTOOLIZE --force --copy --automake
run aclocal -I build/m4/sparkleshare -I build/m4/shamrock -I build/m4/shave $ACLOCAL_FLAGS
run autoconf

run automake --gnu --add-missing --force --copy \
-Wno-portability -Wno-portability

if [ ! -z "$NOCONFIGURE" ]; then
echo "Done. ./configure skipped."
exit $?
fi

if [ $# = 0 ]; then
echo "WARNING: I am going to run configure without any arguments."
fi

run ./configure --enable-maintainer-mode $@

6 changes: 6 additions & 0 deletions build/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SUBDIRS = m4

EXTRA_DIST = \
icon-theme-installer

MAINTAINERCLEANFILES = Makefile.in
45 changes: 45 additions & 0 deletions build/build.environment.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Initializers
MONO_BASE_PATH =
MONO_ADDINS_PATH =

# Install Paths
DEFAULT_INSTALL_DIR = $(pkglibdir)


## Directories
DIR_DOCS = $(top_builddir)/docs

DIR_ICONS = $(top_builddir)/icons
DIR_NOTIFYSHARP = $(top_builddir)/notify-sharp
DIR_SRC = $(top_builddir)/src

DIR_BIN = $(top_builddir)/bin


# External libraries to link against, generated from configure
LINK_SYSTEM = -r:System
LINK_MONO_POSIX = -r:Mono.Posix

LINK_GLIB = $(GLIBSHARP_LIBS)
LINK_GTK = $(GTKSHARP_LIBS)
LINK_GNOME = $(GNOME_SHARP_LIBS)
LINK_DBUS = $(NDESK_DBUS_LIBS) $(NDESK_DBUS_GLIB_LIBS)
LINK_DBUS_NO_GLIB = $(NDESK_DBUS_LIBS)


REF_NOTIFY_SHARP = $(LINK_SYSTEM) $(LINK_DBUS) $(GTKSHARP_LIBS) $(GLIBSHARP_LIBS)
LINK_NOTIFY_SHARP = -r:$(DIR_BIN)/NotifySharp.dll
LINK_NOTIFY_SHARP_DEPS = $(REF_NOTIFY_SHARP) $(LINK_NOTIFY_SHARP)

REF_SPARKLESHARE = $(LINK_SYSTEM) $(LINK_GTK) $(LINK_DBUS) $(LINK_NOTIFY_SHARP_DEPS) $(LINK_MONO_POSIX)
LINK_SPARKLESHARE = -r:$(DIR_BIN)/SparkleShare.exe
LINK_SPARKLESHARE_DEPS = $(REF_SPARKLESHARE) $(LINK_SPARKLESHARE)

# Cute hack to replace a space with something
colon:= :
empty:=
space:= $(empty) $(empty)

# Build path to allow running uninstalled
RUN_PATH = $(subst $(space),$(colon), $(MONO_BASE_PATH))

3 changes: 3 additions & 0 deletions build/build.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include $(top_srcdir)/build/build.environment.mk
include $(top_srcdir)/build/build.rules.mk

Loading

0 comments on commit dbcd4fa

Please sign in to comment.