Permalink
Browse files

Improve the build system

  • Loading branch information...
David Mohr
David Mohr committed Apr 19, 2010
1 parent 9751fdc commit e24231ea9289d372ff1e6d390a3a08993eb72576
Showing with 95 additions and 19 deletions.
  1. +18 −0 EXPAT
  2. +32 −15 grub-choose-default.sgml
  3. +16 −0 icons/wscript_build
  4. +1 −1 src/grub-choose-default-window.c
  5. +28 −3 wscript
View
18 EXPAT
@@ -0,0 +1,18 @@
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -20,7 +20,7 @@ manpage.1: manpage.sgml
<!ENTITY dhfirstname "<firstname>Kjell</firstname>">
<!ENTITY dhsurname "<surname>Braden</surname>">
<!-- Please adjust the date whenever revising the manpage. -->
- <!ENTITY dhdate "<date>2008-05-29</date>">
+ <!ENTITY dhdate "<date>2010-04-18</date>">
<!-- SECTION should be 1-8, maybe w/ subsection other parameters are
allowed: see man(7), man(1). -->
<!ENTITY dhsection "<manvolnum>8</manvolnum>">
@@ -44,7 +44,7 @@ manpage.1: manpage.sgml
&dhsurname;
</author>
<copyright>
- <year>2007</year>
+ <year>2010</year>
<holder>&dhusername;</holder>
</copyright>
&dhdate;
@@ -63,42 +63,59 @@ manpage.1: manpage.sgml
<cmdsynopsis>
<command>&dhpackage;</command>
- <arg><option>-r</option></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>DESCRIPTION</title>
<para><command>&dhpackage;</command> is a small GUI program which displays
your grub entries in a menu and lets you quickly change the default
- without having to go to the command line as well as looking up the index
- of the new default.</para>
+ without having to go to the command line.</para>
<para>Additionally <command>&dhpackage;</command> works also under the
- certain other operating system which resembles an opening in the wall,
- since it is written in Python. Other OSes have not been tested.</para>
+ certain other operating system which resembles an opening in the wall.
+ Other OSes have not been tested, but Unix-like ones are expected to work.</para>
- <para>At this point in time it only works for legacy grub (0.xx).</para>
+ <para>This version only works for the new grub (1.98 or newer).</para>
</refsect1>
+
<refsect1>
<title>OPTIONS</title>
<variablelist>
<varlistentry>
- <term><option>-r</option>
+ <term><option>--help</option>
</term>
<listitem>
- <para>If used, <command>&dhpackage;</command> will show the reboot
- option, which is disabled by default.</para>
- <para>Note that this only controls the display of the reboot button,
- the actual reboot logic is outside of the scope of this program.
- Please check the included support scripts, which provide the
- functionality for some desktop environments.</para>
+ <para>This option lists the default gtk command line
+ parameters.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
+
+ <refsect1>
+ <title>PERMISSIONS</title>
+
+ <para>Setting the grub default requires root permissions.
+ <command>&dhpackage;</command> uses <command>sudo</command> to call
+ <command>grub-set-default</command>. This call is non-interactive; as a
+ result a NOPASSWD sudo configuration is required.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>SESSION SUPPORT</title>
+
+ <para><command>&dhpackage;</command> allows a script to be run to immediate
+ end the current session. Since ending the session is dependent on the desktop
+ environment, the user has to install the appropriate script as
+ <filename>$XDG_CONFIG_DIR/grub-set-default/reboot</filename>. Examples scripts
+ can be found in the reboot directory of the source distribution.
+ </para>
+ </refsect1>
+
<refsect1>
<title>AUTHOR</title>
View
@@ -0,0 +1,16 @@
+#! /usr/bin/env python
+# WAF build script for midori
+# This file is licensed under the terms of the expat license, see the file EXPAT.
+
+import Utils
+import os
+
+for size in [16, 22, 24, 32, 48, 'scalable']:
+ try:
+ s = int (size)
+ d = str(size) + 'x' + str(size)
+ except ValueError, e:
+ d = str(size)
+
+ bld.install_files ('${PREFIX}/usr/share/icons/hicolor/' + d + '/' + 'category',
+ d + '/grub-choose-default.*')
@@ -321,7 +321,7 @@ perform_reboot (GrubChooseDefaultWindow *win)
g_set_error (&error,
GCHD_ERROR, GCHD_ERROR_NO_REBOOT_SCRIPT,
- "Could not find any reboot scripts.\nYou can install one in %s/%s.",
+ "Could not find any reboot scripts.\nYou can install one in %s/%s .",
config_dir, script);
grub_choose_default_error (GTK_WIDGET (win), error);
g_error_free (error);
View
31 wscript
@@ -1,7 +1,15 @@
#!/usr/bin/env python
+#
+# Copyright 2010 David Mohr <david@mcbf.net>
+#
+# Licensed under the EXPAT license.
+#
+# In parts based on midori's wscript
#from __future__ import print_function
+
import Options
+import Utils
top = '.'
if Options.platform == 'win32':
@@ -11,6 +19,17 @@ else:
APPNAME = 'grub-choose-default'
VERSION = '0.6'
+IS_DEV=True
+
+
+if IS_DEV:
+ try:
+ git = Utils.cmd_output (['git', 'rev-parse', '--short', 'HEAD'], silent=True)
+ if git:
+ VERSION = (VERSION + '-' + git).strip ()
+ except:
+ pass
+
def set_options (opt):
opt.add_option ('--debug', action='store_true', default=False, help='Enable debugging code', dest='debug')
@@ -26,6 +45,11 @@ def configure (ctx):
ctx.check_tool ('gcc')
ctx.check_cfg (package='gtk+-2.0', args='--cflags --libs', uselib_store='GTK', mandatory=True)
+ if Options.platform != 'win32':
+ if ctx.find_program ('docbook-to-man', var='DOCBOOKTOMAN'):
+ manpage = 'yes'
+ else:
+ manpage = 'no'
if Options.platform == 'win32':
ctx.check_cfg (package='gio-2.0', args='--cflags --libs', uselib_store='GIO', mandatory=True)
@@ -49,11 +73,12 @@ def configure (ctx):
def build (ctx):
#ctx.recurse ('src')
ctx.add_subdirs ('src')
+ ctx.add_subdirs ('icons')
- if Options.platform != 'win32':
+ if Options.platform != 'win32' and ctx.env.DOCBOOKTOMAN:
ctx(
- rule = 'docbook-to-man ${SRC} > ${TGT}',
+ rule = ctx.env.DOCBOOKTOMAN + ' ${SRC} > ${TGT}',
source = 'grub-choose-default.sgml',
target = 'grub-choose-default.8',
- install_path = '${MANDIR}/man8',
+ install_path = '${PREFIX}/usr/share/man/man8',
)

0 comments on commit e24231e

Please sign in to comment.