;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014, 2015, 2016 David Thompson ;;; Copyright © 2015 Andreas Enge ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2015, 2019 Mark H Weaver ;;; Copyright © 2016, 2017, 2018, 2019 Kei Kebreau ;;; Copyright © 2019 Marius Bakke ;;; Copyright © 2019–2021 Tobias Geerinckx-Rice ;;; Copyright © 2021 Trevor Hass ;;; Copyright © 2020, 2021, 2022 Liliana Marie Prikler ;;; Copyright © 2021 Maxime Devos ;;; Copyright © 2024 Jan Wielkiewicz ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages minetest) #:use-module (gnu packages) #:use-module (gnu packages audio) #:use-module (gnu packages base) #:use-module (gnu packages compression) #:use-module (gnu packages curl) #:use-module (gnu packages fontutils) #:use-module (gnu packages gettext) #:use-module (gnu packages gl) #:use-module (gnu packages image) #:use-module (gnu packages lua) #:use-module (gnu packages multiprecision) #:use-module (gnu packages ncurses) #:use-module (gnu packages pkg-config) #:use-module (gnu packages serialization) #:use-module (gnu packages sqlite) #:use-module (gnu packages xiph) #:use-module (gnu packages xorg) #:use-module (guix packages) #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix utils) #:use-module (guix build-system cmake) #:use-module (guix build-system copy) #:use-module (guix build-system minetest) #:use-module ((guix licenses) #:prefix license:)) (define-public minetest (package (name "minetest") (version "5.9.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/minetest/minetest") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "1h4yn4k0wpjr1h24aiqcnc9xsxgxj4bq757pla2pa9zmh2xf45kk")) (modules '((guix build utils))) ;; Delete bundled libraries, keep lib/sha256 because there's no good ;; upstream, see: ;; https://github.com/openssl/openssl/blob/master/crypto/sha/sha512.c ;; "SHA512 low level APIs are deprecated for public use, ;; but still ok for internal use." Also asked MT devs on IRC for this. (snippet '(begin (with-directory-excursion "lib" (for-each (lambda (file) (if (not (string=? file "sha256")) (delete-file-recursively file))) (find-files (string-append "lib") #:directories? #t))) #t)))) (build-system cmake-build-system) (arguments (list #:configure-flags #~(list "-DENABLE_LTO=ON" "-DENABLE_UPDATE_CHECKER=FALSE" (string-append "-DCURL_INCLUDE_DIR=" (search-input-directory %build-inputs "include/curl")) (string-append "-DZSTD_INCLUDE_DIR=" (dirname (search-input-file %build-inputs "include/zstd.h"))) (string-append "-DZSTD_LIBRARY=" (search-input-file %build-inputs "lib/libzstd.so"))) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'patch-sources (lambda* (#:key inputs #:allow-other-keys) (substitute* "src/filesys.cpp" ;; Use store-path for "rm" instead of non-existing FHS path. (("\"/bin/rm\"") (format #f "~s" (search-input-file inputs "bin/rm")))) (substitute* "src/CMakeLists.txt" ;; Let minetest binary remain in build directory. 2018-11-30