Active Topics

 


Reply
Thread Tools
Posts: 263 | Thanked: 301 times | Joined on Oct 2021 @ Poland
#1
Hello

I recently had some fun compiling modern CLI things for Nokia N9.
So far I did:

- Python 3.9.18 (CPython) compiled against OpenSSL 1.1.0h. This resulted in Python having all modules except tkinker (although some cmath / float tests failed during optimizing - but only few. Modules itself work.). Even with working ssl (TLS 1.2) and pip.

./configure arguments used:

Code:
--prefix=/opt/python.3.9.18 --enable-shared --enable-optimizations --with-ensurepip=install --with-openssl=/opt/openssl.1.1.0h --with-ssl-default-suites=openssl
- OpenSSL 1.1.0h. TLS 1.2 supported, but there are no any certs yet, so curl / wget rejects downloading, unless --insecure / --no-check-certificate specified.

./config arguments used:

[CODE]shared --prefix=/opt/openssl.1.1.0h --openssldir=/opt/openssl.1.1.0h -Wl,-rpath=/opt/openssl.1.1.0h/lib

- Curl 8.3.0 against OpenSSL 1.1.0h. postinst adds insecure to config so it won't check certs - temporary workaround.

./configure arguments used:

Code:
--prefix=/opt/curl.8.3.0 --with-ssl=/opt/openssl.1.1.0h
- diffutils 3.10 - to provide cmp and diff often used in makefiles / configure.

./configure arguments used:

Code:
--prefix=/opt/diffutils.3.10
- Bash 5.2.15

./configure arguments used:

Code:
--prefix=/opt/bash.5.2.15
- Viu (terminal image viewer)

Compiled using cross (Viu is written in Rust) with
Code:
armv7-unknown-linux-musleabihf
as target.

- OpenSSH 9.3p2 Compiled against OpenSSL 1.1.0h.

-------------------------------------

What I use for compiling? An old 2017 X1 Carbon running Arch Linux and QEMU User Static. I mount Harmattan SDK, bind-mount a directory in my /home to SDK so I have much space.

I use what SDK provided with Thecust repo mirror. GCC 4.4. If I need more libs, I try to compile them too - usually works.

Now the important part - how to package the program properly? For now I do it as following:

- compile with /opt/<package>.<version> prefix
- right after make install I do
Code:
tar cvzf package-ready.tgz /opt/<package>.<version>
. If there are more steps like generating ssh keys in OpenSSH - I search how they are done in Makefile and add to postinst.
- I make symlinks. I.e. everything in /opt/<package>.<version>/lib to /opt/lib, /opt/<package>.<version>/bin to /opt/bin. I made an Optified PATH package which adds them to PATH.
- package into DEB with N9-specific things like digsigsums, md5sums, etc. Using
Code:
dpkg-deb -b -Zgzip --root-owner-group
.

But I believe it's not the right way to do so. Packages should be in one /opt/<dir> directory. But how to package them, then? Checkinstall seems to be very outdated and better not to be used - but in past it was used to exactly the same thing.

Also what is the best way to edit environment variables on N9? /etc/profile doesn't seem to be always sourced by ash.

Anyway, you can grab current results here:

http://wunderwungiel.pl/MeeGo/apt-repo/pool/testing/

In addition, I packaged pfetch and neofetch for MeeGo
My next goal is to build new GCC and BusyBox.

Thanks for all tips!
__________________
My Telegram group (Maemo / MeeGo / Sailfish):
https://t.me/linuxmobile_world
Channel for Maemo/MeeGo:
https://t.me/maemomeegoapps
 

The Following 3 Users Say Thank You to dredlok706 For This Useful Post:
Posts: 263 | Thanked: 301 times | Joined on Oct 2021 @ Poland
#2
I found another method - seems to be much better.

I now have two Harmattan SDKs - let's name it SDK1 and SDK2.
A directory inside my host's home "MeeGo-workdir" is mounted as /home/user/MyDocs/workdir inside both SDK1 and SDK2.

I compile everything in SDK1 with "/opt/wunderw" prefix. Then I install it in SDK2 with make install, create .tgz archive from "/opt/wunderw" directory, uninstall program with make uninstall and finally delete "/opt/wunderw". This way contents of tgz file is only the freshly compiled program and only its files.

I will check how it behaves in real use. In short this method avoids creating multiple directories in /opt for each program and creating symlinks.
__________________
My Telegram group (Maemo / MeeGo / Sailfish):
https://t.me/linuxmobile_world
Channel for Maemo/MeeGo:
https://t.me/maemomeegoapps
 

The Following 2 Users Say Thank You to dredlok706 For This Useful Post:
Maemish's Avatar
Posts: 1,720 | Thanked: 4,765 times | Joined on Apr 2018 @ Helsinki, Finland.
#3
Nice job! Keeping meego alive.
__________________
"I don't know how but I can try!" (active)

Master of not knowing (active)

For me it is possible to get lost in any case (active)

Learning to fall from high (DONE)

Learning to code with BASIC (WIP)
 
Posts: 263 | Thanked: 301 times | Joined on Oct 2021 @ Poland
#4
I also had a unusual problem - I had to make a gcc wrapper with custom arguments, because apparently GCC 4.4 doesn't use compiler-specific variables like C_INCLUDE_PATH or CXXFLAGS and similar. sh couldn't work, because it has problem with dealing with quotation marks. In the end I just used Python, and wrote below.

GCC:

Code:
#!/usr/bin/env python3.1

import subprocess
import sys

args = ["gcc-4.4", "-D_Static_assert(a,b)=(1)", "-I/opt/wunderw/include", "-L/opt/wunderw/lib", "-lncursesw", "-lpng", "-lunistring"]

for i, arg in enumerate(sys.argv):
    if i == 0:
        continue
    else:
        args.append(arg)

result = subprocess.call(args)
sys.exit(result)
G++:

Code:
#!/usr/bin/env python3.1

import subprocess
import sys

args = ["g++-4.4", "-I/opt/wunderw/include", "-L/opt/wunderw/lib", "-lncursesw", "-lpng", "-lunistring"]

for i, arg in enumerate(sys.argv):
    if i == 0:
        continue
    args.append(arg)

result = subprocess.call(args)
sys.exit(result)
It will add some paths to library and include paths, and include some libraries. Seems to work well.
How to use? Put into /usr/bin/gcc and /usr/bin/g++ and chmod 755 both of files.
__________________
My Telegram group (Maemo / MeeGo / Sailfish):
https://t.me/linuxmobile_world
Channel for Maemo/MeeGo:
https://t.me/maemomeegoapps
 
Posts: 263 | Thanked: 301 times | Joined on Oct 2021 @ Poland
#5
Great news!

1. I compiled OpenSSL 1.1.1w (!!!) (not 1.1.0h) - with TLS 1.3 support!!!
2. I packaged full set of Mozilla certificates from Arch Linux for above OpenSSL
3. Latest curl compiled against above OpenSSL 1.1.1w gives NO errors when downloading TLS 1.3-only sites (also NO errors related to certificates!)
4. I compiled Python 3.11.3 with full SSL/TLS support and even things like SQLite3 and even Tkinter should work after my latest work!

Everything is already packaged and will be published soon!
__________________
My Telegram group (Maemo / MeeGo / Sailfish):
https://t.me/linuxmobile_world
Channel for Maemo/MeeGo:
https://t.me/maemomeegoapps
 

The Following 3 Users Say Thank You to dredlok706 For This Useful Post:
Maemish's Avatar
Posts: 1,720 | Thanked: 4,765 times | Joined on Apr 2018 @ Helsinki, Finland.
#6
Nice job again!
__________________
"I don't know how but I can try!" (active)

Master of not knowing (active)

For me it is possible to get lost in any case (active)

Learning to fall from high (DONE)

Learning to code with BASIC (WIP)
 

The Following 2 Users Say Thank You to Maemish For This Useful Post:
Posts: 1,293 | Thanked: 4,319 times | Joined on Oct 2014
#7
Originally Posted by dredlok706 View Post
Great news!

1. I compiled OpenSSL 1.1.1w (!!!) (not 1.1.0h) - with TLS 1.3 support!!!
2. I packaged full set of Mozilla certificates from Arch Linux for above OpenSSL
3. Latest curl compiled against above OpenSSL 1.1.1w gives NO errors when downloading TLS 1.3-only sites (also NO errors related to certificates!)
4. I compiled Python 3.11.3 with full SSL/TLS support and even things like SQLite3 and even Tkinter should work after my latest work!

Everything is already packaged and will be published soon!
Just curious. Does 1.1.1 Co-exist with the original version?

Great job!
 

The Following User Says Thank You to nieldk For This Useful Post:
Posts: 263 | Thanked: 301 times | Joined on Oct 2021 @ Poland
#8
Yes. When building I specify "--prefix=/opt/wunderw" with each thing to compile. This way each package lives in /opt/wunderw directory, not conflicting with system packages.
__________________
My Telegram group (Maemo / MeeGo / Sailfish):
https://t.me/linuxmobile_world
Channel for Maemo/MeeGo:
https://t.me/maemomeegoapps
 

The Following 2 Users Say Thank You to dredlok706 For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 17:52.