Off-Topic > SCM EXtensions

SCM Basics

(1/22) > >>

Jason W:
Scm's install into /apps, like /apps/leafpad.  The main thing that differentiates the scm from the tcz is the scm is self contained and can be mounted and unmounted.  The degree of being self contained can vary, as the scm can still have dependencies.  The binaries get symlinked into /apps/bin, unless a value is set in the scm's spec file. 

Located here:

The load script scm-load is very similar to tce-load in function.  "scm-load -iw audacious-gtk3.scm" will fetch that extension from the repo and load it.  "scm-load -r audacious-gtk3" will unmount (unload) the extension.  The icon and menu entries get added when the extension is loaded and removed when unloaded.   For the user, using the two different extension types will feel about the same. 

Here is the basic extension structure of an scm.  Lets take leafpad for example.  Inside /apps/leafpad you will find the usual directories:


..and so forth.  The config directory is where the install and spec files are located if they are used.  install is the startup script, just like /usr/local/tce.installed/leafpad.  spec is where variables or flags can be set, the only existing now is the "link_bin=no" if you don't want scm-load to link all the binaries in bin to /apps/bin. 

When building an scm, you do not need to use a DESTDIR variable, just use the ./configure flag "--prefix=/apps/l3afpad"  and your app will install to that as it's base directory.  Certain values need to be set if installing multiple sources that depend on each other into that location.  Basically the below would suffice in most cases:

--- Code: ---export LDFLAGS="-L/apps/l3afpad/lib -L/apps/gtk3/lib"
export CPPFLAGS="-I/apps/l3afpad/include -I/apps/gtk3/include"
export PATH="/apps/l3afpad/bin:/apps/gtk3/bin:$PATH"
export PKG_CONFIG_PATH="/apps/l3afpad/lib/pkgconfig:/apps/gtk3/lib/pkgconfig:$PKG_CONFIG_PATH"

--- End code ---

In the final package, often a wrapper is needed for the binaries so they can find their libraries since the libs are not installed into a path searched by ldconfig.  Here is the one for l3afpad, the gtk3 fork of leafpad.  Essentially you rename l3afpad to l3afpad-bin and create an executable script named l3afpad:

--- Code: ---#!/bin/sh

export LD_LIBRARY_PATH="/apps/gtk3/lib"
export XDG_DATA_DIRS=/apps/gtk3/share

/apps/l3afpad/bin/l3afpad-bin "$@"

--- End code ---

L3afpad depends on gtk3.scm, so we have to specify the LD_LIBRARY_PATH to point to the gtk3 libs, and since it is a gtk3 app, also the XDG_DATA_DIRS.

Freedesktop files are located in /apps/PKGNAME/share/applications, and icons in /apps/PKGNAME/share/pixmaps.  The scm-load script will link and remove those entries into /usr/local/share/applications and /usr/local/share/pixmaps so all desktops can make use of the desktop and icon files. 

send in submissions to


I noticed that /apps/bin is not added to PATH. Is this an oversight, or intentional?

Jason W:
For now intentional, as perhaps some would like it in the front of PATH, others would like it last. 

So its still a mountable squashfs filesystem, like a .tcz?

And how should we pronounce ".scm"?  Is it dot-ess-see-em or dot-scum?  Or maybe dot-scam?  :)

Jason W:
lol.  Have not thought much about pronunciation, as we normally type things here rather than speak them.

Yes, a squashfs file just like tcz, made with mksquashfs, in it's file type. 


[0] Message Index

[#] Next page

Go to full version