Off-Topic > SCM EXtensions

SCM buildin how-to

(1/6) > >>

Today I started trying to understand how work these scm, I'm downloading ffmpeg package (very big for my line) as mentioned in this topic
I think it's important that other people try to create this type of package or it would risk a low diffusion.
I translated to my language (italian) first post of SCM basis to figure out what to do.
I found an application that works securely and has few dependencies for testing:

However I did not understand the part of code in the first post of SCM Basics, I ask if you can create a mini howto step by step for create a .scm package

Ok, I'm investigating the discourse of environment variables; I just finished building ffmpeg (it took several hours), but where is the scm?

--- Code: ---...
INSTALL libavutil/pixfmt.h
INSTALL libavutil/random_seed.h
INSTALL libavutil/rational.h
INSTALL libavutil/samplefmt.h
INSTALL libavutil/sha.h
INSTALL libavutil/sha1.h
INSTALL libavutil/avconfig.h
INSTALL libavutil/libavutil.pc

--- End code ---

Ok, i change target of my test (nut does not have .configure file, this is a problem for --prefix)

I try with circuslinux and write this script:

--- Code: ---build_circuslinux() {
BUILDDEPS="compiletc.tcz SDL-dev.tcz"
#DEPS="libmikmod.tcz SDL.tcz"

export LDFLAGS="-L$PKGPATH/lib"
export CPPFLAGS="-I$PKGPATH/include"
export PATH="$PKGPATH/bin:$PATH"

tar xvzf circuslinux-1.0.3.tar.gz || exit 1
cd circuslinux-1.0.3 || exit 1
./configure  --prefix="$PKGPATH" || exit 1
make || exit 1
make install || exit 1

cd "$HERE"

--- End code ---

--- Code: ---tc@box:~/circus$ ./buildscm /apps/circux
./buildscm: line 46: command not found

--- End code ---

for now this is naturally wrong, but I hope you'll give me a hand to correct and understand some things.

Here are some of the first questions that come to mind:
1)This SCM pack is the software, plus all its dependencies installed in /apps/packagename ?
1.2)so I must try to have only "BUILDEPS" and not "DEPS" ?

2)in the series of "export" I need to enter the directory where the libraries will be installed and searched?
2.1)how should I choose them whereas circuslinux need the sdl and libmikmod?

Jason W:
Scm's don't need tcz deps, just build deps, as the rule now is for scm's not to depend on tcz's.  So libmikmod and sdl will need to be built into the circuslinux scm package.  All needed libraries not found in base need to be in the scm if at all possible, except for gtk2 or other library collections.

Also, when ffmpeg finishes building, you make the scm this way, thougn it can also be scripted.

cd /apps
mksquashfs ffmpeg-shared/ ffmpeg-shared.scm

You would first want to perhaps clean out unwanted files though, depending on the purpose of the package.

Also if you are using the command "buildscm /apps/circus" , then the function in the file needs to be build_circus.  Also, the file needs to be named with the suffix to work with the buildscm script.

Jason W:
Ok, I made some source files for circuslinux, located below, be sure to download all the files.  I will let you make the package, this can just be a guide.

Use the command:

buildscm /apps/circuslinux

and it should just work.  Study each source file to see what is going on.  Also, a wrapper is usually needed to make the resulting binaries work.  For this one do ths:

mv /apps/circuslinux/bin /apps/circuslinux/localbin
mkdir /apps/circuslinux/bin

Then create this file to be your /apps/circuslinux/bin/circuslinux file:

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

export LD_LIBRARY_PATH=/apps/circuslinux/lib
export PATH=/apps/circuslinux/localbin:$PATH

/apps/circuslinux/localbin/circuslinux "$@"

--- End code ---

Then make that file executable.  The icon and menu stuff can be easily done using existing examples. 

Oh, and FWIW, circuslinux is able to be converted directly from tcz's with the same result.


[0] Message Index

[#] Next page

Go to full version