enca icon indicating copy to clipboard operation
enca copied to clipboard

Setup MSYS2 based build github actions

Open Syed-Shahrukh-OSSRevival opened this issue 7 months ago • 1 comments

Setup MSYS2 based build github actions

Have you managed to compiled Enca 1.19 for OS Windows (7 x64)? Could you be so kind as to zip the binary and drag'n'drop it here? I have the old version 1.13, and I'm ready to try the new one.

sergeevabc avatar May 29 '25 02:05 sergeevabc

@sergeevabc thank you for your interest. Presently it is possible to build enca with Windows 10 or latest and msys 2.0 using the newer UCRT64 environment.

Run the UCRT64 terminal and install packages using pacman:

pacman -S git 
pacman -S mingw-w64-ucrt-x86_64-gcc
pacman -S mingw-w64-ucrt-x86_64-libiconv
pacman -S mingw-w64-ucrt-x86_64-recode 
pacman -S make 

Checkout the sources:

git clone https://github.com/nijel/enca.git

Build instructions are:

cd enca
./configure --disable-shared
make -j$(nproc)
make install DESTDIR=/tmp/inst

Thank you for your input, Syed, but I believe that Enca could and should be accessible to the users of legacy Windows 7 as well. There is no reason to deprive them of this wonderful tool, because all the functions that are necessary for the operation of this app exist in the mentioned OS. We just need to choose the right compilation tools. In particular, the latest msys2 does not work on Windows 7, but this one works. The rest is also challenging for the average user like me. The best solution is to share the exe file.

sergeevabc avatar Jun 12 '25 01:06 sergeevabc

There is no future plan to support Windows 7 or earlier. Even main stream browsers are no longer providing binaries that install on Windows 7.

I did setup Windows 7 on VM to check if it is possible to build enca using msys2-base-x86_64-20221216.sfx.exe.

Run the binary msys64/mingw64.exe to login. Here is the build.log

Please find attached dynamically linked libiconv enca-1.9.zip binary archive.

Syed, it's amazing that you've taken the time and opportunity to help the community by releasing a fresh version of Enca, thank you! May I suggest moving the compilation log to a spoiler to spend less time scrolling the laptop screen?

I confirm that enca.exe from your archive works as expected on Windows 7 x64.

$ enca.exe --version
enca 1.20-dev

Features: -librecode-interface +iconv-interface -external-converter +language-detection +locale-alias -target-charset-auto -ENCAOPT

However, this release is not quite portable. It requires (missing by default) libiconv-2.dll to run, whereas enca 1.13 that I've been using so far has no such dependency. Probably some switch should be added to the compilation process to make that executable truly standalone, self-contained. What do you think, Syed?

There is no future plan to support Windows 7 or earlier. Even main stream browsers are no longer providing binaries that install on Windows 7.

Commercial giants such as Microsoft and Google use a vicious strategy of artificial obsolescence to make a profit, not to make people happier. And there is a community of goodwill enthusiasts with a different mission — to make apps as accessible as possible, because computers were invented to ease the burden of people, not to frustrate them with endless upgrades. For example, there are Supermium and R3dfox browsers (the latest Chromium and Firefox patched to work on Windows 7), Go7 and Python7, KeePass and OpenSSL, MPC-HC and Foobar2000, Softmaker Office and Sublime Text, 7-zip and Everything… There are a lot of tools that work and will continue to work on Windows 7.

sergeevabc avatar Jun 12 '25 21:06 sergeevabc

Yes it links with the libiconv dynamically, even though the libenca library itself is static on which the binary enca.exe depends.

Unfortunately there is no flag that makes a libiconv statically linked in the build system.

Thank you for providing useful information, for me the first obstacle was getting a reasonable browser to run on Windows 7 so i could some productive work. I wish I had asked for a startup document.

There are practical limitation like priorities, time and other considerations when supporting an older platform. There is no room for automation as platforms like github periodically out-date operating systems.

The updated statically linked enca.zip is attached.

I am documenting the build process here for future reference, so if someone is interested they can build enca on Windows 7 using msys2.

msys2 - mingw-x64 Windows 7 Download version suitable for windows 7 https://github.com/msys2/msys2-installer/releases/download/2022-12-16/msys2-base-x86_64-20221216.sfx.exe

Run msys64/mingw64.exe

Update Mirror List

echo -e "SigLevel = Required DatabaseNever\nServer = https://github.com/msys2/msys2-archive/releases/download/2022-12-16-\$repo" > /etc/pacman.d/mirrorlist.mingw
echo -e "SigLevel = Required DatabaseNever\nServer = https://github.com/msys2/msys2-archive/releases/download/2022-12-16-msys-\$arch" > /etc/pacman.d./mirrorlist.msys
pacman -Syy

Install Dependencies

pacman -S --needed base-devel mingw-w64-x86_64-toolchain
# choose 3
pacman -S git 

Sources

git clone https://github.com/nijel/enca.git

Dynamically Link Libiconv Build

cd enca
./configure --disable-shared
make -j$(nproc)
make install DESTDIR=~/inst

Statically Link Libiconv Build

cd enca
./configure --disable-shared
make -j$(nproc) LDFLAGS=/mingw64/lib/libiconv.a
make install DESTDIR=~/inst

This ticket was primarily for setting up github CI workflow for msys, so I will be closing the issue hoping all is good.

During encoding detection, Enca tries to open some file.

Source: env.txt

$ enca_v1.13.exe -L ru env.txt
IBM/MS code page 866

$ enca_v.1.20dev.exe -L ru env.txt
X:\Text\enca.exe: Cannot open file `/usr/share/locale/locale.alias' in mode r: No such file or directory
IBM/MS code page 866

sergeevabc avatar Jun 18 '25 04:06 sergeevabc

This is a known issue of missing file with enca mingw build. Please check https://github.com/nijel/enca/issues/20