# HG changeset patch # User Christophe Lincoln # Date 1303998190 -7200 # Node ID acf34ef74c4b2f5f30eec93b620fe68135ec9ca7 # Parent afa852ea51a0c0938a33d8c53057ebc5e894d36f en: Add GUI guideline info in forge diff -r afa852ea51a0 -r acf34ef74c4b en/devel/forge.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/en/devel/forge.php Thu Apr 28 15:43:10 2011 +0200 @@ -0,0 +1,378 @@ + + + + SliTaz - Forge (en) + + + + + " /> + + + + + + + + + + +
+ +
+

Navigation

+ + +
+ +
+

Forge

+

+ Tools, guideline and services used to created and build SliTaz +

+

+ users.png + Join us on SCN and + the mailing list +

+
+
+ + +
+ +

Collaborative management

+ + + + +

KISS and comply to standards

+

+ Keep it simple: follow the best standards, carefully draft and write + high quality documentation, provide a stable and robust system and keep + the rootfs on the LiveCD light enough to run on machines with at + least 128 MB RAM. It's also possible to use GTK+2, Dialog, SHell scripts, + or PHP coding tools on the distribution. The idea is not to duplicate and + to think small... +

+ + +

Tank - Build host & home

+

+ Each contributor may have an account on the project server with secure + access, disk space, a public directory and all development tools. + Developers can compile packages and maintainers of the mirror can handle + sychronization. Tank also hosts the website, web boot and mercurial + repositories: tank.slitaz.org +

+

+ Instructions on using the build host are described in the Cookbook: + + SliTaz Build Host (tank). +

+ + +

Mercurial repositories

+

+ SliTaz Mercurial or Hg repos can be browsed or cloned by anyone using + the URL: http://hg.slitaz.org/. People + with write access can directly use repos.slitaz.org which + requires authentication. Mercurial uses Python and is installable with: + tazpkg get-install mercurial +

+ +

~/.hgrc

+

+ Before you push your first commit onto the server, be sure that you have a + correct Hg configuration file with your name and email address, and remember + to check that you are not root. Personal ~/.hgrc file example: +

+
+[ui]
+username = FirstName LastName <you@example.org>
+
+

Clone, modify, commit and push

+

+Clone a repo, example for wok: +

+
+ $ hg clone http://repos.slitaz.org/wok
+
+

+Change directory to wok, note you must be in the repository to be able +to use 'hg' commands. To check all logs or just the last log: +

+
+ $ hg log
+ $ hg head
+
+

+Add or modify one or more files and commit: +

+
+ $ hg add
+ $ hg status
+ $ hg commit -m "Log message..."
+ $ hg log
+
+

+Note that you can use the command rollback to roll back to the last +transaction. Before pushing changes to the server, it is safe to pull once: +

+
+ $ hg pull
+ $ hg push
+
+

+Done, your changes, code or corrections are now on the server. +

+

Updating a local wok

+

+To update your wok with the local server (pull to pull the changes): +

+
+ $ hg pull -u
+
+

Useful commands

+

+Hg commands that can be used. +

+ + + +

GUI - Pure C/GTK, Yad, Vala/Genie and CGI/web

+ +

+ We have many way to create user interface in the open source world. From + the start of the project until 3.0 we mainly used a tool called Gtkdialo + who let us create nice and quiet complex interfaces in GTK but with a + scripting language, no compilation, just run. But gtkdialog in unmaintained + and lack about new GTK features, so we switched to Yad for simple GUI boxes. + For all the admin, packages and configuration tools we switched to TazPanel, + a CGI/web interface with all the gui in xHTML 5 and CSS 3. +

+

+ Now we Yad is very simple and dont allow us to create complex interface even + if we just need 2 or 3 entry with label and a few buttons, so an other way + must be used. The advantage of a scripting language is the fact we dont need + to compile and can code in relatime, but it produce a slower applications. + All in C is complex and we got less contributor since SHell script are easier + to understand, so the guide line now is to keep and continue improving our + cmdline tools and provide frontend in GTK or CGI/web. +

+

+ They is many new languages who let use GTK such as Genie, Vala or GTKaml. + But keep in mind ther are not so popular than C and GTK and finaly not realy + easier to learn and use, at least for simple fronted you finally use SHell + scripts to perform tasks. Use can use Vala if you like but look at a pure + GTK single window, it only 12 lines: +

+
+#include >gtk/gtk.h<
+
+int main(int argc, char *argv[])
+{
+  GtkWidget *window;
+  
+  gtk_init(&argc, &argv);
+  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+  gtk_widget_show(window);
+  gtk_main();
+  return 0;
+}
+
+

+ If you not sure about the language to use, discuss it on the mailing list. + If you just want a small GUI function, look at tazbox in the slitaz-tools + repo, it have tiny desktop tools such as a logout box. By the way the first + SliTaz sub-project all written in pure GTK is TazWeb and you may learn + some way to use system() to include system commands in your frontend. For + example TazWeb use wget for downloads and sed to add bookmarks. +

+

+ Yad scripts should follow TazYad guidelines: + + README and + + exmaple code +

+ + +

Implementation of iconv()

+

+SliTaz uses iconv() provided by GNU glibc - any packages that offer +libiconv must use the library contained in glibc-locale. +There is therefore no longer a libiconv package (1.2 MB) in SliTaz. +

+ + +

Tazpkg Packages

+

+The tazpkg packages in SliTaz are automatically created via Tazwok and a +receipt in the wok. The Cookbook describes the +use of tools +and the format of receipts. +These are required reading before we begin. +

+

+In terms of choice of package, the idea is to offer a package by task or +functionality, ie. the lightest application in the field and not duplicated. +Note that the current packages are not immutable, if you find an alternative +that is lighter, with more features or more sexy for a few extra KB, +you can suggest it on the Mailing List. Particular attention is given to +packages for the LiveCD, these should be stripped, removing unnecesary +dependancies and compiler options. In general candidate packages for the core +LiveCD are discussed on the Mailing List. +

+

+Before you begin to compile and create packages for SliTaz, be sure that the +work doesn't already exist in the +undigest +wok provided by the primary SliTaz mirror. Don't forget that the members +of the list are there to help you and that the documentation of the +wok and tools +exists to help you get started. +

+ + +

Naming of packages

+

+In most cases the package name is the same as the source, except for +Python, Perl, PHP, Ruby and Lua modules. For example, the package +providing a Kid template system written in Python and XML is named: +python-kid. +

+ + +

Website Management

+

+ The website is managed via a mercurial repository, they can be cloned by: +

+
+ $ hg clone http://hg.slitaz.org/website
+  Or if you have the proper permissions:
+ $ hg clone http://repos.slitaz.org/website
+
+ +

xHTML coding style

+

+The pages and different books are coded in xHTML 1.0 +transitional. The title of level 1 is used only once (at the top), +level 2 is the title of the document and levels 3 and 4 are then used for +the subtitles. If a list is used instead using smart anchors; +then that starts at the top, just after the title of level 2. +Paragraphs are contained in the tags <p></p>. +For indentation, we use tabs - the reason being semantics and to take +up less space in terms of octets (bytes). To put code, like the name of +a command inside a paragraph: <code> is the preferred +method. To view commands or to utilize a terminal, the web pages use +<pre> to display the formatted text. Example: +

+
+ $ command
+
+

+To view text that can be copied and pasted, such as scripts, +bits of code, sample configuration files, etc - we also use +<pre>, but with a CSS class named "script". Example: +

+
+<pre class="script">
+
+code...
+
+</pre>
+
+

+The emphasized words put themselves in the tag <em> +and internal links are relative. Remember to check the validity +of the code via the online validator of the W3C. +

+ + +

Diff and patch

+

+The utilities diff and patch are command-line tools +for creating and implementing a file containing differences between two files. +This technique is often used for collaboration and the changes made to the +original file can be clearly extracted. To create a diff file +readable by humans in a simple text editor, you must supply the -u option: +

+
+ $ diff -u file.orig file.new > file.diff
+
+

+To apply a patch: +

+
+ $ patch file.orig file.diff
+
+ + +
+ + + + + +