Skip to content

Commit 85439d1

Browse files
committed
Merge branch 'feature/nix-flake-without-submodules'
2 parents e00e128 + 620b6ea commit 85439d1

File tree

2 files changed

+189
-42
lines changed

2 files changed

+189
-42
lines changed

flake.lock

Lines changed: 141 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 48 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -20,46 +20,49 @@
2020
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
2121
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2222

23-
# Due to the use of submodules this has to be build with:
24-
#
25-
# nix build "git+file://$(pwd)?submodules=1"
26-
#
27-
# See: https://github.com/NixOS/nix/pull/5434
2823
{
2924
description = "A 2D platform game featuring Tux the penguin";
3025

31-
inputs = rec {
26+
inputs = {
3227
nixpkgs.url = "github:NixOS/nixpkgs/nixos-21.11";
3328
flake-utils.url = "github:numtide/flake-utils";
29+
30+
tinycmmc.url = "gitlab:grumbel/cmake-modules";
31+
tinycmmc.inputs.nixpkgs.follows = "nixpkgs";
32+
tinycmmc.inputs.flake-utils.follows = "flake-utils";
33+
34+
sexpcpp.url = "gitlab:lispparser/sexp-cpp";
35+
sexpcpp.inputs.nixpkgs.follows = "nixpkgs";
36+
sexpcpp.inputs.flake-utils.follows = "flake-utils";
37+
sexpcpp.inputs.tinycmmc.follows = "tinycmmc";
38+
39+
tinygettext.url = "github:tinygettext/tinygettext";
40+
tinygettext.inputs.nixpkgs.follows = "nixpkgs";
41+
tinygettext.inputs.flake-utils.follows = "flake-utils";
42+
tinygettext.inputs.tinycmmc.follows = "tinycmmc";
43+
44+
SDL2_ttf.url = "github:SuperTux/SDL_ttf";
45+
SDL2_ttf.inputs.nixpkgs.follows = "nixpkgs";
46+
SDL2_ttf.inputs.flake-utils.follows = "flake-utils";
47+
48+
squirrel_src.url = "github:albertodemichelis/squirrel";
49+
squirrel_src.flake = false;
3450
};
3551

36-
outputs = { self, nixpkgs, flake-utils }:
52+
outputs = { self, nixpkgs, flake-utils,
53+
tinycmmc, sexpcpp, tinygettext, SDL2_ttf,
54+
squirrel_src }:
3755
flake-utils.lib.eachDefaultSystem (system:
3856
let
3957
pkgs = nixpkgs.legacyPackages.${system};
4058
in rec {
4159
packages = flake-utils.lib.flattenTree rec {
42-
raqm = pkgs.stdenv.mkDerivation rec {
43-
pname = "libraqm";
44-
version = "0.7.2";
45-
src = fetchTarball {
46-
url = "https://github.com/HOST-Oman/libraqm/releases/download/v${version}/raqm-${version}.tar.xz";
47-
sha256 = "1shcs5l27l7380dvacvhl8wrdq3lix0wnhzvfdh7vx2pkzjs3zk6";
48-
};
60+
squirrel = pkgs.stdenv.mkDerivation {
61+
pname = "squirrel";
62+
version = "3.2";
63+
src = squirrel_src;
4964
nativeBuildInputs = [
50-
pkgs.meson
51-
pkgs.ninja
52-
pkgs.pkgconfig
53-
pkgs.python3
54-
];
55-
buildInputs = [
56-
pkgs.freetype
57-
pkgs.harfbuzz
58-
pkgs.fribidi
59-
];
60-
propagatedBuildInputs = [
61-
pkgs.glib
62-
pkgs.pcre
65+
pkgs.cmake
6366
];
6467
};
6568

@@ -70,23 +73,28 @@
7073
# isn't included in the Nix store.
7174
version = "0.6.3-unknown-" + (if (self ? shortRev) then self.shortRev else "dirty");
7275
src = nixpkgs.lib.cleanSource ./.;
73-
postPatch = let
76+
patchPhase = let
7477
ver = builtins.splitVersion version;
75-
in ''cat > version.cmake <<EOF
78+
in ''
79+
substituteInPlace config.h.cmake \
80+
--replace "#define _SQ64" ""
81+
82+
cat > version.cmake <<EOF
7683
SET(SUPERTUX_VERSION_MAJOR ${builtins.elemAt ver 0})
7784
SET(SUPERTUX_VERSION_MINOR ${builtins.elemAt ver 1})
7885
SET(SUPERTUX_VERSION_PATCH ${builtins.elemAt ver 2})
7986
SET(SUPERTUX_VERSION_TWEAK )
8087
SET(SUPERTUX_VERSION_STRING "v${version}")
8188
SET(SUPERTUX_VERSION_BUILD "${builtins.elemAt ver 4}")
8289
EOF
83-
'';
84-
cmakeFlags = [ "-DINSTALL_SUBDIR_BIN=bin" ];
90+
'';
91+
cmakeFlags = [
92+
"-DINSTALL_SUBDIR_BIN=bin"
93+
"-DUSE_SYSTEM_SDL2_TTF=ON"
94+
];
8595
enableParallelBuilding = true;
8696
nativeBuildInputs = [
8797
pkgs.cmake
88-
pkgs.ninja
89-
pkgs.gcc
9098
pkgs.pkgconfig
9199
pkgs.makeWrapper
92100
pkgs.git
@@ -97,14 +105,16 @@ EOF
97105
--prefix LD_LIBRARY_PATH ":" "${pkgs.mesa.drivers}/lib"
98106
'';
99107
buildInputs = [
100-
raqm
108+
squirrel
109+
sexpcpp.defaultPackage.${system}
110+
tinygettext.defaultPackage.${system}
111+
SDL2_ttf.defaultPackage.${system}
101112

113+
pkgs.physfs
114+
pkgs.libpng
102115
pkgs.boost
103116
pkgs.curl
104-
pkgs.fmt
105-
pkgs.fribidi
106-
pkgs.harfbuzz
107-
pkgs.freetype
117+
pkgs.fmt_8
108118
pkgs.libGL
109119
pkgs.libGLU
110120
pkgs.glew

0 commit comments

Comments
 (0)