The officially official Devuan Forum!

You are not logged in.

#1 2025-05-22 07:27:07

igorzwx
Member
Registered: 2024-05-06
Posts: 161  

[HowTo] samurai_1.9.0-1_amd64.deb (ninja-compatible) patched with SED

samurai is a ninja-compatible build tool written in C99 with a focus on simplicity, speed, and portability.
_https://github.com/michaelforney/samurai

samurai - Arch Linux
_https://archlinux.org/packages/extra/x86_64/samurai/
_https://gitlab.archlinux.org/archlinux/packaging/packages/samurai
_https://gitlab.archlinux.org/archlinux/packaging/packages/samurai/-/blob/main/PKGBUILD?ref_type=heads

Install build-essential, etc.

sudo apt install build-essential debhelper dh_make fakeroot git sed tree quilt 

Download sourcedir:

mkdir BUILD_SAMU
cd BUILD_SAMU
git clone https://github.com/michaelforney/samurai.git --depth 1 

Install a template:

cd samurai
export DEBFULLNAME="John Frum"
dh_make --createorig -p samurai_1.9.0 -c apache -e my@mail.org -s 
$ dh_auto_build --list | grep Auto-selected
Auto-selected: makefile 

Create debian/samurai.install

echo -e 'LICENSE usr/share/licenses/samurai' >> debian/samurai.install 
$ cat debian/samurai.install
LICENSE usr/share/licenses/samurai 

Append 7 lines to debian/rules with echo command

echo -e "# For HTML docs are missing\nexport DH_ALWAYS_EXCLUDE=doc:doc-base\n# Patching Makefile with sed\noverride_dh_auto_build:\n\tsed -i -e 's/usr\/local/usr/g' Makefile\n\tdh_auto_build --\n" >> debian/rules 
$ cat -A debian/rules |grep Patching -A5 -B2
# For HTML docs are missing$
export DH_ALWAYS_EXCLUDE=doc:doc-base$
# Patching Makefile with sed$
override_dh_auto_build:$
^Ised -i -e 's/usr\/local/usr/g' Makefile$
^Idh_auto_build --$
$ 
$ tail -7 debian/rules
# For HTML docs are missing
export DH_ALWAYS_EXCLUDE=doc:doc-base
# Patching Makefile with sed
override_dh_auto_build:
	sed -i -e 's/usr\/local/usr/g' Makefile
	dh_auto_build --

Edit debian/control

nano debian/control
$ cat debian/control
Source: samurai
Section: devel
Priority: optional
Maintainer: John Frum <my@mail.org>
Rules-Requires-Root: no
Build-Depends:
 debhelper-compat (= 13),
Standards-Version: 4.6.2
Homepage: https://github.com/michaelforney/samurai
#Vcs-Browser: https://salsa.debian.org/debian/samurai
#Vcs-Git: https://salsa.debian.org/debian/samurai.git

Package: samurai
Architecture: amd64
Depends:
 ${shlibs:Depends},
 ${misc:Depends},
Description: samurai is a ninja-compatible build tool written in C99 
 • with a focus on simplicity, speed, and portability.
 • samurai implements the ninja build language through version 1.9.0 except for MSVC dependency handling (deps = msvc).
 • It uses the same format for .ninja_log and .ninja_deps as ninja, currently version 5 and 4 respectively.
 • It is feature-complete and supports most of the same options as ninja. 

Create Debian source package

dpkg-source -b . 

Build Debian binary package (deb)

dpkg-buildpackage -us -uc -b 
$ ls -1 ../*.deb
../samurai_1.9.0-1_amd64.deb
../samurai-dbgsym_1.9.0-1_amd64.deb 

Install samurai

sudo dpkg -i ../samurai_1.9.0-1_amd64.deb 
$ samu --version
1.9.0
$ man samu 

Build-Depends:

$ objdump -p /usr/bin/samu | grep NEEDED
  NEEDED               libc.so.6

$ apt-file find /usr/lib/x86_64-linux-gnu/libc.so | grep dev
libc6-dev: /usr/lib/x86_64-linux-gnu/libc.so 

Now you can build wxMaxima with the help of samurai.

A static muon is not easy to compile on Devuan, but the newest version of static muon executable with embedded samurai is already available for download.

$ ldd muon-v0.5.0-amd64-linux
	not a dynamic executable

$ file muon-v0.5.0-amd64-linux
muon-v0.5.0-amd64-linux: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=1a2a3022413581300d66c86f02329ed4aa782022, stripped 

Last edited by igorzwx (2025-05-22 07:30:35)

Offline

Board footer