Both sides previous revisionPrevious revisionNext revision | Previous revision |
wiki:creating_extensions [2024/08/24 18:10] – [Abbreviated steps] rhermsen | wiki:creating_extensions [2025/05/23 15:07] (current) – [Abbreviated steps] GNUser |
---|
| |
===== Abbreviated steps ===== | ===== Abbreviated steps ===== |
The Big Steps: | The Big Steps for creating an extension for application named "foo" and submitting the extension for our repository: |
- configure/make/make install | - **$ [compiler flags] ./configure —prefix=/usr/local; make; make DESTDIR=/tmp/package install** (important notes: 1. see recommended compiler flags in the //Installing// section below, 2. ///tmp/package// can be any empty directory) |
- separate out docs, locale info, and development files | - **strip** debug symbols from executable binaries and .so files in ///tmp/package// (see the example //strip// command in the //Installing// section below) in order to decrease the extension size |
- include a copyright/license (if license requires it) in the packages. Most gpl do not need this compliance. | - **remove** documentation, locale, and development files from ///tmp/package// (submitting the development files as a separate extension, //foo-dev.tcz//, is required; submitting the documentation and locale files as //foo-doc.tcz// and //foo-locale.tcz// is optional) |
- squash up everything into your extension(s) | - **sofware license**: common software licenses (e.g., GPL, MIT, BSD) can be specified in the //.tcz.info// file without including the complete text of the license in the extension; text of uncommon licenses should be included in your extension (e.g., ///tmp/package/usr/local/share/doc/foo/COPYING//) |
- write & place support files: dep, info, list, and md5 hash | - **$ mksquashfs /tmp/package foo.tcz** (note that the files inside ///tmp/package// should be already stripped and you should have already separated out documentation, locale, and development files--see steps 2 and 3 above) |
- bcrypt/tar it all | - **create a project directory**: create an empty project directory (you can call it //~/foo_project//, for example) and copy //foo.tcz// into the project directory |
- email it to the Tiny Core Team | - **add these support files to project directory**: source code tarball, text file with notes on how you compiled the applicaiton (you can call it //compile_foo//), //foo.tcz.dep// (only applicable if //foo.tcz// has runtime dependencies), //foo.tcz.info//—note that other than the source code tarball, all other support files are just plaintext files |
Much can be scripted and the payoff is well worth it. For instance, steps 3-6 can be automated with [[http://tcztools.googlecode.com/|tcztools]] (not an official TC tool). Just for the record: | - **$ cd ~/foo_project; submitqc**: run the [[https://github.com/tinycorelinux/submitqc|submitqc script]] in your project directory; the script will run some checks on //foo.tcz// and will create //foo.tcz.list//, //foo.tcz.md5.txt//, and //foo.tcz.zsync// inside your project directory |
<code>*.a *.h *.m4 *.pc -> dev extension (after --strip-debug) | - **final check**: a complete project directory should contain //foo.tcz// (the extension itself), source code tarball, //compile_foo// (your compilation notes), //foo.tcz.dep// (if applicable), //foo.tcz.info//, //foo.tcz.list//, //foo.tcz.md5.txt//, and //foo.tcz.zsync// |
*.so* -> main extension (after --strip-unneeded)</code> | - **$ tar -cvzf foo.tar.gz ~/foo_project; bcrypt foo.tar.gz**: bcrypt is used evade our spam filter, which detects and blocks tarballs; when //bcrypt// prompts you for a password, use //tinycore//; this step produces //foo.tar.gz.bfe// |
**Note** *.la should not be used in the dev extension anymore. See [[http://forum.tinycorelinux.net/index.php/topic,26201.0.html|this topic]]. | - **email** //foo.tar.gz.bfe// as an attachment to Tiny Core Linux team (tcesubmit AT gmail DOT com) |
| |
| **Note** *.la files should not be included in -dev extensions anymore. See [[http://forum.tinycorelinux.net/index.php/topic,26201.0.html|this topic]]. |
| |
===== Installing ===== | ===== Installing ===== |
Before you begin, please do not have any build depend tczs like compiletc, lib* or *dev files ondemand. All depends for building need to be loaded thru onboot or manually such as | Before you begin, please do not have any build depend tczs like compiletc, lib* or *dev files ondemand. All depends for building need to be loaded thru onboot or manually such as |
<code>tce-load -i package</code> | <code>tce-load -wi compiletc foo-dev bar-dev baz-dev</code> |
This means you do not not need to adjust your onboot list, but can use the APPS panel to download (only) packages and then install them when you need them. | This means you do not not need to adjust your onboot list, but can use the APPS panel to download (only) packages and then install them when you need them. |
Use the compiletc extension when compiling your source - it includes the most common tools, all set up for tc (gcc, make, etc). If you are getting strange make errors, try the coreutils extension. Tar errors? Get the tar extension. And so on. | Use the compiletc extension when compiling your source - it includes the most common tools, all set up for tc (gcc, make, etc). If you are getting strange make errors, try the coreutils extension. Tar errors? Get the tar extension. And so on. |
Again, //-pipe// isn't necessary. If you get an error about "-Wl" you can leave it out. | Again, //-pipe// isn't necessary. If you get an error about "-Wl" you can leave it out. |
| |
Suggested compiler flags on RPi (discussed in this forum thread): | Suggested compiler flags for RPi on armhf: |
<code bash>export CFLAGS="-Os -pipe" | |
export CXXFLAGS="-Os -pipe" | <code bash>export CFLAGS="-Os -pipe -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp" |
| export CXXFLAGS="-Os -pipe -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp" |
export LDFLAGS="-Wl,-O1"</code> | export LDFLAGS="-Wl,-O1"</code> |
| |
| Suggested compiler flags for RPi on aarch64: |
| |
| <code bash>export CFLAGS="-Os -pipe -march=armv8-a+crc -mtune=cortex-a72" |
| export CXXFLAGS="-Os -pipe -march=armv8-a+crc -mtune=cortex-a72" |
| export LDFLAGS="-Wl,-O1"</code> |
| |
| |
Again, //-pipe// isn't necessary. If you get an error about "-Wl" you can leave it out. | Again, //-pipe// isn't necessary. If you get an error about "-Wl" you can leave it out. |
If your software needs a startup script then create the folder for it | If your software needs a startup script then create the folder for it |
<code bash>mkdir -p /tmp/package/usr/local/tce.installed</code> | <code bash>mkdir -p /tmp/package/usr/local/tce.installed</code> |
Next, create script as **/tmp/package/usr/local/tce.installed/package_name** if you would like to do something when the package is first installed or again mounted on boot. | Next, create script as **/tmp/package/usr/local/tce.installed/package_name** if you would like to do something when the package is first installed or again mounted on boot. The first line of the script should be <code bash>#!/bin/sh</code> |
A good pattern to follow would be to first rename **/tmp/package/usr/local/etc/package_name.conf** to **package_name.conf.sample**, and for your script to check always whether /usr/local/etc/package_name.conf exists, and if no, copy over /usr/local/etc/package_name.conf.sample into it. This is so that the application's configuration files are fully writable in the natural path, without having to resort to weird paths that you determine on your own. | A good pattern to follow would be to first rename **/tmp/package/usr/local/etc/package_name.conf** to **package_name.conf.sample**, and for your script to check always whether /usr/local/etc/package_name.conf exists, and if no, copy over /usr/local/etc/package_name.conf.sample into it. This is so that the application's configuration files are fully writable in the natural path, without having to resort to weird paths that you determine on your own. |
e.g.: | e.g.: |
Send the resulting extension.tar.gz.bfe file to **tcesubmit @ gmail ... com** (without spaces or extra periods.) | Send the resulting extension.tar.gz.bfe file to **tcesubmit @ gmail ... com** (without spaces or extra periods.) |
| |
For piCore (Raspberry Pi) extensions send it to **picoresubmit @ gmail ... com** (without spaces or extra periods.) | For piCore (Raspberry Pi) extensions send it to **tcesubmit @ gmail ... com** (without spaces or extra periods.) |
| |
| (<del>picoresubmit</del> is currently not accessible) |
| |
For more details, read the submission guidelines thread. | For more details, read the submission guidelines thread. |