Open Half-Life for *nix

Post Reply
User avatar
RoGeorge
National Metrics Strategist
Posts: 484
Joined: Sat Dec 19, 2020 4:47 am

Open Half-Life for *nix

Post by RoGeorge »

Found yesterday on the FreeBSD forum how to install Half-Life :)
No Steam, no WineHQ, no updates and no piracy required.

I've tested it on a FreeBSD + KDE Plasma and working great, both the original Half-Life and the next one, Half Life - Opposing Force. Should work on Linux, too, but I didn't try:

https://forums.freebsd.org/threads/half ... eps.80394/

Code: Select all

# pkg install xorg git sdl2 mono cmake pkgconf
$ git clone https://github.com/osen/openhl.git
$ cd openhl
$ PYTHON=python3 /bin/sh build.sh

To play Half-Life
$ export/bin/hl

To play Opposing Force
$ export/bin/opfor
The directory "export" is portable, once built it can be moved and the games are self-contained, can be run from anywhere.

https://en.wikipedia.org/wiki/Half-Life_(video_game)
https://en.wikipedia.org/wiki/Half-Life:_Opposing_Force
User avatar
RoGeorge
National Metrics Strategist
Posts: 484
Joined: Sat Dec 19, 2020 4:47 am

Re: Open Half-Life for *nix

Post by RoGeorge »

Anybody gave it a run? No nostalgic people here that played HL1? Not even a Counter-Strike multiplayer fan?

OK, but Half-Life is considered by many the best first person shooter of all times. :D

Did yesterday a compilation of the same sources, but this time in Ubuntu 20.04 LTS w ZFS and KDE Plasma on top (so I might have had already some pre-installed pieces inherited from both the Ubuntu and Kubuntu LTS, but I hope I've sorted those out from these install steps). Also, WineHQ was already installed from the Ubuntu repos. It should compile without 'wine', but I didn't try.

Some name of the packages are different in Ubuntu than in FreeBSD. Also, there might be a name conflict for 'csc' (C# compiler) which in Debian was already taken by 'chicken'. In Debian based distros, 'csc' might be known as 'mono-csc', a symlink to 'msc'. It happened that it was not yet installed any other 'csc' program on my machine, so I just symlinked 'msc' to 'csc'.

Also, the game starting scripts had to be slightly changed, so the .so names will correspond with those produced after a Linux compilation. No idea why they are different, I didn't looked into sources, just blindly compiled in a Debian Linux, here Ubuntu.

While the compilation scripts were listing some missing compiling features, the game compiles and runs in Linux, too. :)

Code: Select all

	sudo apt install xorg git libfreetype-dev libfontconfig1-dev libsdl2-dev mono-complete cmake pkgconf

        # - in Debian, csc is known as mono-csc, a symlink to /usr/bin/msc
        #   the 'csc' name might conflict with another package, 'chicken-bin'
        #   usually, 'chicken-bin' is not preinstalled
        # - create a 'csc' symlink to the '/usr/bin/msc', so to keep the same build.sh
        cd /usr/bin
        sudo cp -s /usr/bin/mcs csc
                
        cd ~
        git clone https://github.com/osen/openhl.git
        cd openhl
        
        PYTHON=python3 sh build.sh
        # if the compilation fails, fix the errors, delete the 'export' directory
        #   then run only this line again.  Do not start anew and do not git clone again,
        #   because that is not necessary and the repository is very big (~300MB)
        
        # for Linux, the .so names has to be changed from libclient/libserver to client/hl
        sed -i 's/libclient\.so/client\.so/' export/bin/hl
        sed -i 's/libserver\.so/hl\.so/' export/bin/hl

        sed -i 's/libclient\.so/client64\.so/' export/bin/opfor
        sed -i 's/libserver\.so/hl64\.so/' export/bin/opfor

        # to run the Half-Life game
        export/bin/hl
        
        # to run Half-Life: Opposing Force
        export/bin/opfor
Shta
Creator of Opportunities
Posts: 239
Joined: Wed Jan 27, 2021 9:59 pm

Re: Open Half-Life for *nix

Post by Shta »

I'll happily give it a shot after I'm done with getting my brand new life on track. A new distraction is the last thing I need right now.
Post Reply