Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Poll

What would be the most convenient release format for the LinuxDwarfPack?

Redhat RPM
Ubuntu SNAP
Debian DEB
Arch XZ
Docker
AppImage
Current tbz2
Other
Flatpak
Alpine

Pages: 1 [2] 3 4 ... 14

Author Topic: LinuxDwarfPack-0.47.05-r8 (with DFHack r8)  (Read 90005 times)

bradlee

  • Escaped Lunatic
    • View Profile
Re: LinuxDwarfPack / lnp-forge
« Reply #15 on: April 13, 2020, 10:13:53 pm »

I’m running manjaro gnome on a HiDPI display, and I’m having some trouble with the terminal config. I think there may be an issue with how LNP is passing through terminal options. Since I’m on a 4k screen, I want my dfhack terminal to scale up appropriately so it’s readable. From a normal terminal (gnome-terminal) I can spawn xterm and urxvt with the appropriate parameters to make it darker and use a TrueType font at a larger face size:
  • urxvt -bg gray30 -fg Grey89 -fn "xft:DejaVu Sans Mono:pixelsize=28"
  • xterm -bg gray30 -fg Grey89 -fn "xft:DejaVu Sans Mono:pixelsize=28"

I’ve tried pasting variations of that into the PyLNP terminal configurator:
  • urxvt -bg gray30 -fg Grey89 -fn 'xft:DejaVu Sans Mono:pixelsize=28' -e $

But on testing the terminal, this doesn’t spawn anything, and reports the following errors to startlnp.sh. These errors look like it’s not parsing the quote-escaped string correctly, and using the spaces as delimiters:
Code: [Select]
urxvt: "Sans": malformed option.
urxvt: "Mono:pixelsize=28'": malformed option.
urxvt: unable to load base fontset, please specify a valid one using -fn, aborting.


Further, if I remove the font name specification, it spawns the correct terminal with the specified colors, says “Test will begin in 3 seconds…” but then still fails (unknown error). With urxvt it also progresses to “Waiting for parent process to continue…” but also still fails the test (unknown error).

I don’t see a build.log to upload in my pylnp folder or any of the subfolders, but if you can tell me how to generate it or point me to the instructions I’m happy to provide it.

Thanks for all your great work packaging up the builds and mods for Linux!
Logged

McArcady

  • Bay Watcher
  • working on a mysterious construction
    • View Profile
    • LinuxDwarfPack - a ready-to-play pack for Linux
Re: LinuxDwarfPack / lnp-forge
« Reply #16 on: April 14, 2020, 05:08:09 pm »

The error that happens when running the test may have been fixed : 
try replacing this file: 
Code: [Select]
LinuxDwarfPack-0.47.04-r1/core/terminal.py 
by this one: 
https://github.com/Pidgeot/python-lnp/blob/master/core/terminal.py 
It does not the solve the quotes-escaping problem though, but there is a workaround: 
put the command in a separate script:
Code: [Select]
$ vi term.sh

#!/bin/sh
xterm -bg gray30 -fg Grey89 -fn "xft:DejaVu Sans Mono:pixelsize=28" -e "$@"

$ chmod +x term.sh
and set in the terminal configuration:
Code: [Select]
"YOUR_LNP_PATH/term.sh $"
Could you fill an issue on https://github.com/Pidgeot/python-lnp/issues so that this case can be handled properly by PyLNP ?

bradlee

  • Escaped Lunatic
    • View Profile
Re: LinuxDwarfPack / lnp-forge
« Reply #17 on: May 17, 2020, 03:12:07 pm »

Thanks for your help! Submitted LNP issue here[1].

I tried putting the commands into a custom_terminal.sh file and pointing to that. I specified the custom terminal script with relative path: ./custom_terminal.sh $


That file contains:
Code: [Select]
#!/bin/bash
xterm -bg gray30 -fg Grey89 -fn "xft:DejaVu Sans Mono:pixelsize=28" -e "$@"

This passes the LNP custom-option test, which shows the terminal window opening, starting, and finishing the test with the specified colors and fonts; however it does not actually work to run DF. When I click Play DF button, I get no GUI response, and the following in the terminal where I spawned ./startlnp.sh:
Code: [Select]
LinuxDwarfPack-0.47.04-r2]$ ./startlnp.sh
bin/DwarfTherapist (No such file or directory)
WARNING: Unknown option: PRIESTHOOD_UNIT_COUNTS
WARNING: Unknown option: TEMPLE_VALUE_LEVELS
WARNING: Unknown option: GUILD_UNIT_COUNTS
WARNING: Unknown option: GUILDHALL_VALUE_LEVELS
INFO: Read installed graphics (Spacefox) from log
Traceback (most recent call last):
  File "/home/brad/Downloads/LinuxDwarfPack-0.47.04-r2/core/launcher.py", line 112, in run_program
    lnp.running[path] = subprocess.Popen(
  File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: './custom_terminal.sh'
ERROR: Could not launch ./df_47_04_linux/dfhack
Exception in Tkinter callback
Traceback (most recent call last):
  File "./tkgui/tkgui.py", line 542, in run_df
    launcher.run_df()
  File "/home/brad/Downloads/LinuxDwarfPack-0.47.04-r2/core/launcher.py", line 55, in run_df
    raise Exception('Failed to run Dwarf Fortress.')
Exception: Failed to run Dwarf Fortress.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/tkinter/__init__.py", line 1883, in __call__
    return self.func(*args)
  File "./tkgui/tkgui.py", line 547, in run_df
    message=exc_info[1].message)
AttributeError: 'Exception' object has no attribute 'message'

Eventually I was able to work around the initial problem (specifying font size for readability on HiDPI displays) by giving up on specifying the whole font family, and falling back to xterm and -fs:
Code: [Select]
xterm -bg gray30 -fg Grey89 -fs 10 -e $
But I'm still pretty sure the LNP isn't  properly handling the relative path of the custom script when specified using the custom-terminal command. Should I open up a separate LNP issue for this inconsistency?


[1] https://github.com/Pidgeot/python-lnp/issues/165
Logged

McArcady

  • Bay Watcher
  • working on a mysterious construction
    • View Profile
    • LinuxDwarfPack - a ready-to-play pack for Linux
Re: LinuxDwarfPack / lnp-forge
« Reply #18 on: May 19, 2020, 04:24:58 pm »

Does it work with an absolute path?
Code: [Select]
/home/user/my_path/LinuxDwarfPack/custom_terminal.shIf it does, I wouldn't fill an issue for this problem, it is easy to workaround.

The real issue remains fixing PyLNP to handle the blanks characters in the '-fn' option.

forumist

  • Bay Watcher
    • View Profile
Re: LinuxDwarfPack / lnp-forge
« Reply #19 on: July 20, 2020, 08:31:26 am »

Just to report a success at generating a starting pack with lnp-forge on MX Linux 18 (a distribution based on Debian stretch).

I installed the dependencies as explained here: https://github.com/McArcady/lnp-forge/wiki/Installing-build-dependencies

I git cloned lnp-forge and followed the instructions at https://github.com/McArcady/lnp-forge.

I had to edit tool version numbers with menuconfig, especially the version for twbt. Here's the relevant section of my .config:

Code: [Select]
#
# Misc options
#
# CT_TOOLCHAIN_ENABLE_NLS is not set
CT_DF=y
CT_DF_VERSION="47_04_linux"
CT_LNP=y
CT_LNP_VERSION="0.14a"
CT_EMBARK=y
CT_EMBARK_VERSION="2014-v3"
CT_KEYBINDS=y
CT_KEYBINDS_REV="master"
CT_DFHACK=y
CT_DFHACK_VERSION="0.47.04-r1"
CT_TWBT=y
CT_TWBT_VERSION="04704"
CT_GRAPHICS=y
CT_GRAPHICS_VERSION="47.04"
CT_THERAPIST=y
CT_THERAPIST_VERSION="v41.1.7"
CT_THERAPIST_EXPERIMENTAL_LAYOUT=""
# CT_SOUNDSENSE is not set
CT_LEGENDS=y
CT_LEGENDS_VERSION="1.19.0"
CT_ANNOUNCEMENT=y
CT_ANNOUNCEMENT_VERSION="v1.3.0"

When starting the pack, it failed with the default detected "terminal". I installed xterm (
Code: [Select]
sudo apt install xterm) and set
Code: [Select]
xterm as custom terminal command.

Play-wise, I apparently had a crash at my first worldgen attempt (a long history was running, and when I came back DF was closed, and no world was available after re-starting), and I experienced weird text overlapping in adventure mode (I constantly had to go to the help menu and back in order to be able to see text properly). The other things I tested were fine.

Thanks for this tool!
Logged
Don't quote me on that.
Cacame channels aquifers into submission by staring at them. Cacame is so badass, kobolds give him their children to leave them alone. If Hidden Fun Stuff digs too far down, they hit Cacame. Cacame once took a Tantrum Spiral and impaled four enemies on it.

McArcady

  • Bay Watcher
  • working on a mysterious construction
    • View Profile
    • LinuxDwarfPack - a ready-to-play pack for Linux
Re: LinuxDwarfPack / lnp-forge
« Reply #20 on: July 20, 2020, 02:49:44 pm »

Thanks for the feedback @forumist

McArcady

  • Bay Watcher
  • working on a mysterious construction
    • View Profile
    • LinuxDwarfPack - a ready-to-play pack for Linux
AppImage format
« Reply #21 on: July 20, 2020, 03:13:07 pm »

lnp-forge now generates an AppImage version of the LinuxDwarfPack:
It shares some features with containers:
- code and data are automagically separated by a unionfs overlay: code is read-only in the AppImage package, all modified files (notably configuration and game saves) appear in the ~/.lnp of the user. It may ease future upgrades (remains to be tested thoroughly)
- this package format is also supposed to allow embarking dependencies

A nightly build of the AppImage artifact is available here.
Feedback from testing on your favorite distro would be much appreciated!

rmblr

  • Bay Watcher
    • View Profile
Re: LinuxDwarfPack / lnp-forge
« Reply #22 on: July 23, 2020, 01:45:45 pm »

Report from building on Fedora Silverblue 32 inside a toolbox container.


Code: [Select]
# On host system
toolbox create -c df
toolbox enter -c df     # everything after this is inside the toolbox container

# this is where my df lives
cd ~/src/df

dnf -y groupinstall "Development Tools"

git clone https://github.com/McArcady/lnp-forge

cd lnp-forge

# deps from fedora spec file BuildRequires
sudo dnf install gperf qt5-qtbase-devel ninja-build qt5-qtdeclarative-devel perl-IO-Compress perl perl-XML-LibXML perl-XML-LibXSLT mercurial git cmake gcc-c++ zlib-devel mesa-libGL-devel ncurses-devel dos2unix texinfo help2man


# deps from fedora spec file Requires
sudo dnf install SDL SDL_image SDL_ttf gtk2-devel openal-soft alsa-lib alsa-plugins-pulseaudio mesa-dri-drivers python gnome-terminal java-1.8.0-openjdk python3-tkinter qt5-qttools

# deps from https://github.com/McArcady/lnp-forge/wiki/Installing-build-dependencies
sudo dnf install perl perl-XML-LibXML perl-XML-LibXSLT mercurial help2man git java-1.8.0-openjdk python3-tkinter ninja-build ncurses-devel zlib-devel mesa-libGL-devel gcc-c++ qt5-qttools cmake dos2unix texinfo

# builds deps not referenced in documentation
sudo dnf install bison libtool  SDL-devel libpng-devel

# install your terminal
sudo dnf install xterm

./configure --prefix=$PWD && make install
./bin/lnp-forge menuconfig
./bin/lnp-forge build


Config file (defaults, except changed max parallel jobs and enabled soundsense)
Spoiler (click to show/hide)

Build was successful after 5:56.22.

Booted LNP with ./.build/src/lnp-0.14a/startlnp.sh

My only feedback would be the addition of the addition of the build deps listed above that weren't in the docs.
Logged

rmblr

  • Bay Watcher
    • View Profile
Re: LinuxDwarfPack / lnp-forge
« Reply #23 on: July 23, 2020, 01:59:56 pm »

Now, attemping to build the RPM failed:

Code: [Select]
$ fedpkg --release f32 local(

... snip...

[INFO ]  Finishing installation (may take a few seconds)...
[00:07] / ++ source .config
++ echo
/var/tmp/rpm-tmp.RpVpFj: line 33: source: .config: file not found
+ LNP_VERSION=
+ cat
/var/tmp/rpm-tmp.RpVpFj: line 34: ./.build/src/lnp-/PyLNP.user: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.RpVpFj (%build)
Logged

McArcady

  • Bay Watcher
  • working on a mysterious construction
    • View Profile
    • LinuxDwarfPack - a ready-to-play pack for Linux
Re: LinuxDwarfPack / lnp-forge
« Reply #24 on: July 23, 2020, 06:06:11 pm »

Report from building on Fedora Silverblue 32 inside a toolbox container.
My only feedback would be the addition of the addition of the build deps listed above that weren't in the docs.

Thanks for the feedback! I updated the list of dependencies for RedHat systems in the wiki.
Not sure what happened during the RPM build, did you run it from the root of the lnp-forge directory?
Did you try the AppImage package? I would recommend it rather than any distro-specific package, but it has not been tested yet on many systems.
« Last Edit: July 23, 2020, 06:20:33 pm by McArcady »
Logged

forumist

  • Bay Watcher
    • View Profile
Re: LinuxDwarfPack / lnp-forge
« Reply #25 on: July 24, 2020, 03:41:26 pm »

I haven't found out how to download the AppImage. Did I miss some information?
Logged
Don't quote me on that.
Cacame channels aquifers into submission by staring at them. Cacame is so badass, kobolds give him their children to leave them alone. If Hidden Fun Stuff digs too far down, they hit Cacame. Cacame once took a Tantrum Spiral and impaled four enemies on it.

McArcady

  • Bay Watcher
  • working on a mysterious construction
    • View Profile
    • LinuxDwarfPack - a ready-to-play pack for Linux
Re: LinuxDwarfPack / lnp-forge
« Reply #26 on: July 24, 2020, 05:13:14 pm »

I haven't found out how to download the AppImage. Did I miss some information?

From github/lnp-forge/actions, select the most recent build (current name: "Fix build.xml"), then download the 'AppImage' artifact.
After extraction from the .zip, the 'execute' permission must be manually set on the .AppImage file:
Code: [Select]
chmod +x ~/Downloads/LinuxDwarfPack-0.47.04-r3-x86_64.AppImage
It is an executable package that can then be started like any other program.

rmblr

  • Bay Watcher
    • View Profile
Re: LinuxDwarfPack / lnp-forge
« Reply #27 on: July 30, 2020, 04:22:52 am »

FYI you have to be logged in to download files from github actions (unlike releases).

I haven't tried the AppImage version yet, I like to have multiple installs of DF going. So building one lnp dir and then copying it to get multiple installs works great.

---

The community colors pack is something I use quite a bit. Would you consider adding it to the config?

Also, the LinuxLNP and Windows starter pack have a behavior under Graphics > Customize that the FONT and GRAPHICS_FONT chooser dialogs show ALL tileset pngs, wherease the LNP built with lnp-force only seems to show the tileset of the chosen graphics pack (chosen under Graphics > Choose). The former behavior is very useful to select graphics pack A but use the tileset for text from pack B.

---

Another question, would it be possible to use lnp-forge to build LNPs using a different DF base.

I like to play the Dark Ages Mode (http://www.bay12forums.com/smf/index.php?topic=143540.0) which is only distributed as a windows package. I'd like to be able use lnp-forge to help automate building a linux LNP for that mod.

I see in the scripts it is possible to provide a custom DF tarball, but I can't seem to make it work.

I added the following to my .config

Code: [Select]
CT_DF_CUSTOM=y
CT_DF_CUSTOM_LOCATION=/home/ramblurr/src/df/da
CT_DF_VERSION="47_04_linux"

In /home/ramblurr/src/df/da exists a file 'df_47_04_linux.tar.bz2' which contains the DarkAges df folder extracted, renamed to df_47_04_linux and re-archived with tar. But when i run the build step it errors with "[WARN ]    'df_47_04_linux' not found in '/home/ramblurr/src/df/lnp-forge-da/.build/tarballs".

If I manually copy the tarball into .build/tarballs, it will build.

Am I missing something, or is this how it should work?

Finally, because the DA build is for windows, I have to manually copy the linux binaries in place with a script like this (executed from the lnp-forge dir)

Code: [Select]
#!/bin/bash
DF=/home/ramblurr/src/df/vanilla/df_47_04_linux
DA=./.build/src/lnp-0.14a/df_47_04_linux

cd $DA

find . -iname "*.exe" -delete
find . -iname "*.dll" -delete

mkdir -p ./libs
cp  $DF/df .
cp $DF/libs/* ./libs/

Would be nice to integrate this into the build process somehow, are there any post-build hooks?
« Last Edit: July 30, 2020, 05:25:33 am by rmblr »
Logged

McArcady

  • Bay Watcher
  • working on a mysterious construction
    • View Profile
    • LinuxDwarfPack - a ready-to-play pack for Linux
Re: LinuxDwarfPack / lnp-forge
« Reply #28 on: August 05, 2020, 03:58:01 pm »

Sorry for that. The AppImage is still under test (it still fails on some major distros), so it's not available yet outside of github.
--
I'm working on including more LNP shared components to the pack, and colors are part of it!
[EDIT] Done.
--
[EDIT] The following instructions were added to https://github.com/McArcady/lnp-forge/wiki/Add-support-for-a-new-tool-or-mod

Regarding the Dark Ages mod, you could try writing an installation script for the mod in a new file like this:
Code: [Select]
scripts/build/dark.sh
Taking example on df.sh (installation script for the DF archive), the main parts would be:
do_dark_get: download the tarball (the windows one)
do_dark_extract: extract the tarball
do_dark_build: copy the necessary file for the mod from the archive to the DF directory.
For the last part you need to know exactly which files to replace in the original DF tree so that the mod
 will run correctly...

To activate this script you will have to add 'dark' in CT_STEPS in:
Code: [Select]
steps.mk[EDIT] (preferably at the end, right before 'appimage')
and add a config option in:
Code: [Select]
config/config.inand a new file:
Code: [Select]
config/dark.in(take example on config/df.in)
« Last Edit: September 12, 2020, 06:27:00 am by McArcady »
Logged

rmblr

  • Bay Watcher
    • View Profile
Re: LinuxDwarfPack / lnp-forge
« Reply #29 on: August 06, 2020, 04:17:09 am »

Superb instructions, many thanks.

Here's a branch that will install the Dark Ages mod optionally: https://github.com/Ramblurr/lnp-forge/commit/3d152d1e4bc3f26cc08f3d537f4cd55e5f5a3531
Logged
Pages: 1 [2] 3 4 ... 14