WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: SCM Basics  (Read 132816 times)

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
SCM Basics
« on: January 28, 2012, 05:18:27 PM »
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:

http://distro.ibiblio.org/tinycorelinux/4.x/x86/scm/

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:

/apps/leafpad/bin
/apps/leafpad/config
/apps/leafpad/etc
/apps/leafpad/lib
/apps/leafpad/share

..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. 


BUILDING
#####
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: [Select]
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"

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: [Select]
#!/bin/sh

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

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

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 scmsubmit@gmail.com

#####

« Last Edit: January 29, 2012, 05:21:48 PM by Jason W »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: SCM Basics
« Reply #1 on: January 28, 2012, 05:30:13 PM »
I noticed that /apps/bin is not added to PATH. Is this an oversight, or intentional?

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: SCM Basics
« Reply #2 on: January 28, 2012, 05:35:45 PM »
For now intentional, as perhaps some would like it in the front of PATH, others would like it last. 

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: SCM Basics
« Reply #3 on: January 28, 2012, 05:41:43 PM »
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?  :)
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: SCM Basics
« Reply #4 on: January 28, 2012, 06:21:53 PM »
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. 

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: SCM Basics
« Reply #5 on: January 28, 2012, 07:57:25 PM »
I'm not sure what it is but sounds like "scrim"

The idea of cleanly unmounting a app sounds cool
« Last Edit: January 28, 2012, 08:04:19 PM by coreplayer2 »

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: SCM Basics
« Reply #6 on: January 28, 2012, 08:21:24 PM »
Scum, like "scuzzy" for scsi, I guess.  lol

But anyway, the scm is just a simple putting back into practice the compressed mountable image - .uci - that Robert pioneered many years ago which I am personally getting once again hooked on.  I like that it can be a safe playground where we can go ahead and use gtk3, python3, other new things, etc, without having to wait on a migration in the tcz area.

Don't get me wrong, I plan to maintain my tcz extensions, and the tcz area remains of utmost importance as it is our 'system', whereas the scm's are self contained and basically affect nothing else outside themselves.  Though Robert (gutmensch) has taken the lead in the tcz repo since I have my hands full right now with scms.
« Last Edit: January 28, 2012, 08:23:02 PM by Jason W »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: SCM Basics
« Reply #7 on: January 28, 2012, 08:40:39 PM »
Let me see if I get this.

The objective is to have both tcz's and scm's installed simultaneously, one with deps and the other may be completely self contained and likely have duplicates of some deps already installed for the tcz's.

Interesting.

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: SCM Basics
« Reply #8 on: January 28, 2012, 08:48:52 PM »
Basically, tcz's can support scms as dependencies, but scms do not interfere with either the base system or the system provided by the installed tcz extensions.

Scm's only install into /apps, and if writable space is needed, then /opt/scm/APPNAME is used and symlinked to from inside the scm.  So scm's do not in any way interfere with the installed system, only affecting /apps (and /opt/scm/APPNAME if needed).

One selling point of course, is the quick, clean-and-pristine, and officially supported uninstalling of extensions.
« Last Edit: January 28, 2012, 08:50:25 PM by Jason W »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: SCM Basics
« Reply #9 on: January 28, 2012, 09:33:49 PM »
scm's can be a tcz dep?  there's an interesting dynamic for sure. 

Important to note that tcz's are not being depreciated :) 

So scm's are supplemental to the system where we can use additional versions of a lib already installed through a tcz dep yet functioning within a sandbox so to speak??

is there going to be a submitscm audit script available soon?  to make sure we get it right.

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: SCM Basics
« Reply #10 on: January 28, 2012, 09:52:11 PM »
No, scm's will not be listed as dependencies of tcz's.

And yes, by their nature scm's are supplemental in that they do not impose on the underlying system, and are free to use what dependencies they want configured like they want, all contained in the scm package. and affecting nothing outside of it's own scm package.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: SCM Basics
« Reply #11 on: January 28, 2012, 10:14:36 PM »
Cool thanks for explaining :)

More choice , I like that.


and any submitscm soon ??

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Re: SCM Basics
« Reply #12 on: January 29, 2012, 02:20:57 AM »
these scm are similar to the request for a GoboLinux package system like that someone asked a few months ago?

Offline uggla

  • Sr. Member
  • ****
  • Posts: 438
Re: SCM Basics
« Reply #13 on: January 29, 2012, 06:06:19 AM »
Theoretically, what system directories could be removed in a scm-only remaster?

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: SCM Basics
« Reply #14 on: January 29, 2012, 06:21:13 AM »
Gobolinux does more like a tcz, installing packages into their own directories and then symlinking them into the system, or at least to certain paths.

As for system directories, I don't think there really is any in base that would be a good idea to remove.