forked from mirrors/nixpkgs
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
46 lines
1.5 KiB
Nix
46 lines
1.5 KiB
Nix
{ lib, stdenv, fetchurl, cmake, pkgconfig
|
|
, SDL2, libvorbis, libogg, libjpeg, libpng, freetype, glew, tinyxml, openal
|
|
, freealut, readline, gcc-unwrapped
|
|
, enableSoundtrack ? false # Enable the "Open Clonk Soundtrack - Explorers Journey" by David Oerther
|
|
}:
|
|
|
|
let
|
|
soundtrack_src = fetchurl {
|
|
url = "http://www.openclonk.org/download/Music.ocg";
|
|
sha256 = "1ckj0dlpp5zsnkbb5qxxfxpkiq76jj2fgj91fyf3ll7n0gbwcgw5";
|
|
};
|
|
in stdenv.mkDerivation rec {
|
|
version = "8.1";
|
|
pname = "openclonk";
|
|
|
|
src = fetchurl {
|
|
url = "https://www.openclonk.org/builds/release/8.1/openclonk-${version}-src.tar.bz2";
|
|
sha256 = "0imkqjp8lww5p0cnqf4k4mb2v682mnsas63qmiz17rspakr7fxik";
|
|
};
|
|
|
|
postInstall = ''
|
|
mv -v $out/games/openclonk $out/bin/
|
|
'' + stdenv.lib.optionalString enableSoundtrack ''
|
|
ln -sv ${soundtrack_src} $out/share/games/openclonk/Music.ocg
|
|
'';
|
|
|
|
nativeBuildInputs = [ cmake pkgconfig ];
|
|
|
|
buildInputs = [
|
|
SDL2 libvorbis libogg libjpeg libpng freetype glew tinyxml openal freealut
|
|
readline
|
|
];
|
|
|
|
cmakeFlags = [ "-DCMAKE_AR=${gcc-unwrapped}/bin/gcc-ar" "-DCMAKE_RANLIB=${gcc-unwrapped}/bin/gcc-ranlib" ];
|
|
|
|
cmakeBuildType = "RelWithDebInfo";
|
|
|
|
meta = with lib; {
|
|
description = "Free multiplayer action game in which you control clonks, small but witty and nimble humanoid beings";
|
|
homepage = "https://www.openclonk.org";
|
|
license = if enableSoundtrack then licenses.unfreeRedistributable else licenses.isc;
|
|
maintainers = with maintainers; [ lheckemann ];
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
|
};
|
|
}
|