WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Bringing milkytracker to TCE (1st package attempt)  (Read 39 times)

Offline coderofsalvation

  • Newbie
  • *
  • Posts: 3


Hi, milkytracker maintainer here (https://milkytracker.org).

For our next release, we want to introduce a tcz extension to our userbase.
Milkytracker is a perfect fit for old hardware & TC, as it does not need much..so potato-laptops can be revived as dedicated 'musictracker-devices'  8)
First we want to offer it as a download (for the latest TC) which can simply be installed via wget + tce-load:


Code: [Select]
$ wget https://....../milkytracker-1.06.tcz
$ tce-load -i milkytracker-1.06.tcz

So far I've been able to create these files:

Code: [Select]
$ ls -la milkytracker-1.06.*
-rw-r--r-- 1 leon users     700 Jun 22 14:09 milkytracker-1.06.err
-rw-r--r-- 1 leon users 1409024 Jun 22 14:01 milkytracker-1.06.tcz
-rw-r--r-- 1 leon users       9 Jun 22 14:01 milkytracker-1.06.tcz.dep
-rw-r--r-- 1 leon users     481 Jun 22 14:01 milkytracker-1.06.tcz.info
-rw-r--r-- 1 leon users      48 Jun 22 14:01 milkytracker-1.06.tcz.list

$ unsquashfs -l milkytracker-1.06.tcz
squashfs-root
squashfs-root/usr
squashfs-root/usr/bin
squashfs-root/usr/bin/milkytracker
squashfs-root/usr/bin/milkytracker.build

Important addition is `milkytracker.build`, as shellscript which is the build-script (for reproducability/tinkering purposes..something which binary-packages usually lack):

Code: [Select]
$ unsquashfs milkytracker-1.06.tcz
$ cat  squashfs-root/usr/bin/milkytracker.build
#!/bin/sh
# this script is for reproducability purposes in case the binary does not work

# install deps
tce-load -wi git.tcz SDL2-dev.tcz gcc.tcz cmake.tcz make.tcz glibc_base-dev.tcz linux-6.18_api_headers.tcz squashfs-tools.tcz

test -d milkytracker || {
  git clone https://github.com/milkytracker/milkytracker
}

set -x
set -e
cd milkytracker
export VERSION=$(git tag | tail -n1)
git submodule update --init
mkdir build
cd build
cmake ..
make

# package
test -d /tmp/package && rm -rf /tmp/package
mkdir -p /tmp/package/usr/bin
cp $0 /tmp/package/usr/bin/milkytracker.build # copy buildscript
cp src/tracker/milkytracker /tmp/package/usr/bin/.
strip /tmp/package/usr/bin/milkytracker
mksquashfs /tmp/package milkytracker-$VERSION.tcz

All works **almost** fine, when running:

Code: [Select]
$ tce-load -i milkytracker-1.06.tgz
$ milkytracker
SDL: SDL_CreateWindow (width: 1280, height: 960) failed: Failed loading libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
Retrying with default size...SDL: SDL_CreateWindow (width: 640, height: 480) failed: Failed loading libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
Giving up.
SDL: Could not create window.
ASCIISYNTH IMPORT: 'M1(C*(51)D)vA)/)M),(Xt@()((((((('
DISPLAY: set env-var SCREEN=640x480 to specify windowsize
DISPLAY: set env-var FULLSCREEN=1 to specify fullscreen
DISPLAY: assuming screenscalefactor 2
DISPLAY: set env-var NO_SCALE=1 to disable scaling
DISPLAY: set env-var NO_OPENGL=1 to disable hardware acceleration

This will error on a basic TC (which has no libGL installed)...which is probably MOST of the users.
This can be remediated by running this instead:

```
$ NO_OPENGL=1 NO_SCALE=1 SCREEN=640x480 milkytracker`
```

How can I make this a default behaviour in a flexible way?
First I was thinking in renaming /usr/bin/milkytracker to /usr/bin/milkytracker.app and then defining /usr/bin/milkytracker:

Code: [Select]
#!/bin/sh
find /lib | grep libGL || export NO_OPENGL=1
milkytracker

However, these overrides would jail the user into those settings forever  ::)

Questions / Feedback for improvements

1. Any feedback/suggestions so far?

2. Where to put a 'milkytracker'  alias/shellscript-wrapper (which can be edited by the user)..should I perhaps go for a wbar icon/cmd? (which can be edited by the user?)
« Last Edit: Today at 08:56:08 AM by coderofsalvation »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12861
Re: Bringing milkytracker to TCE (1st package attempt)
« Reply #1 on: Today at 10:21:05 AM »
Hi coderofsalvation
... So far I've been able to create these files:

Code: [Select]
$ ls -la milkytracker-1.06.*
-rw-r--r-- 1 leon users     700 Jun 22 14:09 milkytracker-1.06.err
-rw-r--r-- 1 leon users 1409024 Jun 22 14:01 milkytracker-1.06.tcz
-rw-r--r-- 1 leon users       9 Jun 22 14:01 milkytracker-1.06.tcz.dep
-rw-r--r-- 1 leon users     481 Jun 22 14:01 milkytracker-1.06.tcz.info
-rw-r--r-- 1 leon users      48 Jun 22 14:01 milkytracker-1.06.tcz.list

 ----- Snip -----
...

You are missing  milkytracker-1.06.tcz.md5,txt.
I recommend installing  submitqc.tcz  if you plan on submitting extensions.

Then:
Code: [Select]
cd directory/containing/.tcz/files
submitqc --libs
submitqc  will create  .tcz.md5.txt  and  .tcz.list  if not present or incorrect.


Quote
... All works **almost** fine, when running:

Code: [Select]
$ tce-load -i milkytracker-1.06.tgz
$ milkytracker
SDL: SDL_CreateWindow (width: 1280, height: 960) failed: Failed loading libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory
Retrying with default size...SDL: SDL_CreateWindow (width: 640, height: 480) failed: Failed loading libGL.so.1: libGL.so.1: cannot open shared object file: No such file or directory

 ----- Snip -----

This will error on a basic TC (which has no libGL installed)...which is probably MOST of the users.

 ----- Snip -----

First I was thinking in renaming /usr/bin/milkytracker to /usr/bin/milkytracker.app and then defining /usr/bin/milkytracker:

Code: [Select]
#!/bin/sh
find /lib | grep libGL || export NO_OPENGL=1
milkytracker

However, these overrides would jail the user into those settings forever  ::) ...
I'd like to share a few thoughts here:
1. Without libGl, the program fails. The script tests for and handles that.
2. With libGl, the program works. The script tests for and handles that.
3. The export is not system wide. It only exists for that instance of milkytracker.
4. If libGL gets installed while milkytracker is running, exit and restart milkytracker.

I don't see a forever here.

If someone wishes to edit a script, they can replace the link
with a copy of the file it points to:
Code: [Select]
sudo busybox cp /Path/To/Link/LinkName /Path/To/Link/
If they want that file to persist between reboots, they can add
it to their backup.