From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id iPY2GHjb617eRgAA0tVLHw (envelope-from ) for ; Thu, 18 Jun 2020 21:24:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id cOePE3jb616JPwAA1q6Kng (envelope-from ) for ; Thu, 18 Jun 2020 21:24:08 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6DEFE940539 for ; Thu, 18 Jun 2020 21:24:07 +0000 (UTC) Received: from localhost ([::1]:47986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jm20z-0002pm-H3 for larch@yhetil.org; Thu, 18 Jun 2020 17:24:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jm20w-0002pe-42 for guix-patches@gnu.org; Thu, 18 Jun 2020 17:24:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42969) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jm20v-0005Ja-RM for guix-patches@gnu.org; Thu, 18 Jun 2020 17:24:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jm20v-0003QX-L7 for guix-patches@gnu.org; Thu, 18 Jun 2020 17:24:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40035] Add widelands game Resent-From: Nicolas Goaziou Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 18 Jun 2020 21:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40035 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Alberto EFG Cc: 40035@debbugs.gnu.org Received: via spool by 40035-submit@debbugs.gnu.org id=B40035.159251540013128 (code B ref 40035); Thu, 18 Jun 2020 21:24:01 +0000 Received: (at 40035) by debbugs.gnu.org; 18 Jun 2020 21:23:20 +0000 Received: from localhost ([127.0.0.1]:54515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jm20A-0003PX-AF for submit@debbugs.gnu.org; Thu, 18 Jun 2020 17:23:20 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:60649) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jm205-0003PG-AX for 40035@debbugs.gnu.org; Thu, 18 Jun 2020 17:23:13 -0400 X-Originating-IP: 185.131.40.67 Received: from localhost (40-67.ipv4.commingeshautdebit.fr [185.131.40.67]) (Authenticated sender: admin@nicolasgoaziou.fr) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 6BCACC0004; Thu, 18 Jun 2020 21:23:01 +0000 (UTC) From: Nicolas Goaziou References: <87o8t2gpqx.fsf@posteo.mx> <87imj9skzr.fsf@nicolasgoaziou.fr> <87k13pkku4.fsf@posteo.mx> <874kussm8q.fsf@nicolasgoaziou.fr> Date: Thu, 18 Jun 2020 23:22:59 +0200 In-Reply-To: <874kussm8q.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Fri, 13 Mar 2020 09:16:37 +0100") Message-ID: <87lfkk83ws.fsf@nicolasgoaziou.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.7 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: A/Wx/Bu/FnKl --=-=-= Content-Type: text/plain Hello, I integrated the previous suggestions. I am not sure about the version string. Upstream seems to use "build-20", and most distributions use "20", some use "build20" or "b20". I used "build20" because it makes it easier to build the download URL. I'm sending the updated patch for review. Regards, -- Nicolas Goaziou --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-Add-widelands.patch Content-Transfer-Encoding: quoted-printable Content-Description: Add widelands >From 186efb0ba86c431e57d535968450bdfd30c1fc43 Mon Sep 17 00:00:00 2001 From: Alberto Eleuterio Flores Guerrero Date: Wed, 17 Jun 2020 11:45:17 +0200 Subject: [PATCH] gnu: Add widelands. * gnu/local.mk (widelands): New variable. * gnu/packages/patches/widelands-system-wide_minizip.patch: New file. (dist_patch_DATA): Register file above. Co-authored-by: Nicolas Goaziou --- gnu/local.mk | 1 + gnu/packages/games.scm | 98 +++++++++++ .../widelands-system-wide_minizip.patch | 153 ++++++++++++++++++ 3 files changed, 252 insertions(+) create mode 100644 gnu/packages/patches/widelands-system-wide_minizip.patch diff --git a/gnu/local.mk b/gnu/local.mk index fd3cc88af5..b9cd455fa0 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1592,6 +1592,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/wicd-get-selected-profile-fix.patch \ %D%/packages/patches/wicd-urwid-1.3.patch \ %D%/packages/patches/wicd-wpa2-ttls.patch \ + %D%/packages/patches/widelands-system-wide_minizip.patch \ %D%/packages/patches/wmctrl-64-fix.patch \ %D%/packages/patches/wmfire-update-for-new-gdk-versions.patch \ %D%/packages/patches/wordnet-CVE-2008-2149.patch \ diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 39669ba1c9..f121d7f5c3 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -4018,6 +4018,104 @@ tactics.") license:gpl2+ license:lgpl2.1+)))) =20 +(define-public widelands + (package + (name "widelands") + (version "build20") + (source + (origin + (method url-fetch) + (uri (string-append "https://launchpad.net/widelands/" + version "/" version "/+download/" + "widelands-" version ".tar.bz2")) + (sha256 + (base32 "1cmwfwk7j6yi2pwmm4rm57s23sdzasqf53nx6567sdagqyc4sn9q")) + (modules '((guix build utils))) + (snippet + '(begin + (delete-file-recursively "src/third_party/minizip") + #t)) + (patches + ;; Use system Minizip. This is discussed updstream at + ;; . + (search-patches "widelands-system-wide_minizip.patch")))) + (build-system cmake-build-system) + (arguments + `(#:configure-flags + (let* ((out (assoc-ref %outputs "out")) + (share (string-append out "/share"))) + (list "-DCMAKE_BUILD_TYPE=3DRelease" + (string-append "-DCMAKE_INSTALL_PREFIX=3D" out "/bin") + (string-append "-DWL_INSTALL_BASEDIR=3D" share "/widelands") + (string-append "-DWL_INSTALL_DATADIR=3D" share "/widelands") + "-DOPTION_BUILD_WEBSITE_TOOLS=3DOFF")) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'install-desktop-file-and-icons + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((share (string-append (assoc-ref outputs "out") "/shar= e")) + (applications (string-append share "/applications")) + (icons (string-append share "/icons/hicolor"))) + ;; Create desktop entry. + (mkdir-p applications) + (copy-file "debian/org.widelands.widelands.desktop" + (string-append applications "/widelands.desktop"= )) + ;; Install icons. + (for-each (lambda (size) + (let* ((dim (string-append size "x" size)) + (apps (string-append icons "/" dim "/app= s"))) + (mkdir-p apps) + (copy-file (string-append "data/images/logos" + "/wl-ico-" size ".p= ng") + (string-append apps "/widelands.pn= g")))) + '("16" "32" "48" "64" "128")) + #t))) + (add-after 'unpack 'unbundle-fonts + ;; Unbundle fonts already packaged in Guix. XXX: missing fonts= are + ;; amiri, Culmus, mmrCensus, Nakula, and Sinhala. + (lambda* (#:key inputs #:allow-other-keys) + (with-directory-excursion "data/i18n/fonts" + (for-each (lambda (font) + (delete-file-recursively font) + (symlink (string-append (assoc-ref inputs font) + "/share/fonts/truetype") + font)) + '("DejaVu" "MicroHei"))) + #t))))) + (native-inputs + `(("gettext" ,gettext-minimal) + ("python" ,python-wrapper))) + (inputs + `(("boost" ,boost) + ("DejaVu" ,font-dejavu) ;case matters in name + ("glew" ,glew) + ("icu4c" ,icu4c) + ("libpng" ,libpng) + ("MicroHei" ,font-wqy-microhei) ;case matters in name + ("minizip" ,minizip) + ("sdl" ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf))) + ("zlib" ,zlib))) + (home-page "https://www.widelands.org/") + (synopsis "Fantasy real-time strategy game") + (description + "Widelands is a real-time strategy game with singleplayer campaigns a= nd +multiplayer mode, aiming for gameplay similar to Settlers II by BlueByte. + +In this game, you start out on a small piece of land with nothing more than +a few of useful resources. Using those, you can build yourself an empire = with +many thousands of inhabitants. On your way towards this goal, you will ha= ve +to build up an economic infrastructure, explore the lands around you and f= ace +enemies who are trying to rule the world just like you do.") + ;; Game is released as GPL2+. Some parts, e.g., art, are released und= er + ;; different licenses. + (license (list license:gpl2+ + license:gpl3+ + license:expat + license:zlib + license:silofl1.1 + license:asl2.0 + license:cc-by-sa3.0)))) + (define-public starfighter (package (name "starfighter") diff --git a/gnu/packages/patches/widelands-system-wide_minizip.patch b/gnu= /packages/patches/widelands-system-wide_minizip.patch new file mode 100644 index 0000000000..1fac0d5396 --- /dev/null +++ b/gnu/packages/patches/widelands-system-wide_minizip.patch @@ -0,0 +1,153 @@ +Description: use the system-wide minizip instead of the embeeded one if fo= und. +Forwarded-Upstream: It was provided by upstream: http://bazaar.launchpad.n= et/~widelands-dev/widelands/b19-debian/revision/8147 + . + Thanks to F=C3=B2ram na G=C3=A0idhlig for the patch. +=20 +I just added this line to make its use easier: + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_HOME_DIRECTORY}/Modul= es) + +=3D=3D=3D modified file 'CMakeLists.txt' +--- + CMakeLists.txt | 3 +++ + Modules/FindMinizip.cmake | 37 +++++++++++++++++++++++++++++++= ++++++ + cmake/WlFunctions.cmake | 7 +++++++ + src/io/CMakeLists.txt | 2 +- + src/third_party/CMakeLists.txt | 20 +++++++++++--------- + src/third_party/minizip/README.txt | 4 ++++ + 6 files changed, 63 insertions(+), 10 deletions(-) + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,6 +43,7 @@ + endif(POLICY CMP0074) +=20 + include("${CMAKE_SOURCE_DIR}/cmake/WlFunctions.cmake") ++set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_HOME_DIRECTORY}/Module= s) +=20 + option(OPTION_USE_GLBINDING "Use glbinding instead of GLEW" OFF) + option(OPTION_GLEW_STATIC "Use static GLEW Library" OFF) +@@ -105,6 +106,8 @@ + find_package(SDL2_ttf REQUIRED) + find_package(ZLIB REQUIRED) + find_package(ICU REQUIRED) ++find_package(Minizip) ++ + if(OPTION_USE_GLBINDING) + find_package(glbinding REQUIRED) + else() +--- /dev/null ++++ b/Modules/FindMinizip.cmake +@@ -0,0 +1,37 @@ ++# - Try to find Minizip ++# Once done this will define ++#=20=20 ++# MINIZIP_FOUND - system has MINIZIP ++# MINIZIP_INCLUDE_DIR - the MINIZIP include directory ++# MINIZIP_LIBRARY_DIR - where the libraries are ++# MINIZIP_LIBRARY - Link these to use MINIZIP ++#=20=20=20 ++ ++IF (MINIZIP_INCLUDE_DIR) ++ # Already in cache, be silent ++ SET(MINIZIP_FIND_QUIETLY TRUE) ++ENDIF (MINIZIP_INCLUDE_DIR) ++ ++FIND_PATH( MINIZIP_INCLUDE_DIR=20 ++ NAMES zip.h unzip.h ioapi.h ++ PATHS /usr/local/include /usr/include ++ PATH_SUFFIXES minizip/ ) ++SET( MINIZIP_NAMES minizip MINIZIP ) ++FIND_LIBRARY( MINIZIP_LIBRARY ++ NAMES ${MINIZIP_NAMES} ++ PATHS /usr/lib /usr/local/lib ) ++ ++GET_FILENAME_COMPONENT( MINIZIP_LIBRARY_DIR ${MINIZIP_LIBRARY} PATH ) ++ ++IF (MINIZIP_INCLUDE_DIR AND MINIZIP_LIBRARY) ++ SET(MINIZIP_FOUND TRUE) ++ SET(MINIZIP_LIBRARY_DIR ${MINIZIP_LIBRARY} ) ++ IF (NOT MINIZIP_FIND_QUIETLY) ++ MESSAGE (STATUS "Found Minizip: ${MINIZIP_LIBRARY} ${MINIZIP_INCLUDE= _DIR}") ++ ENDIF (NOT MINIZIP_FIND_QUIETLY) ++ELSE (MINIZIP_INCLUDE_DIR AND MINIZIP_LIBRARY) ++ SET( MINIZIP_FOUND FALSE ) ++ SET( MINIZIP_LIBRARY_DIR ) ++ SET( MINIZIP_EXTRA_DEFINITIONS ) ++ENDIF (MINIZIP_INCLUDE_DIR AND MINIZIP_LIBRARY) ++ +--- a/cmake/WlFunctions.cmake ++++ b/cmake/WlFunctions.cmake +@@ -81,6 +81,14 @@ + if(ARG_USES_ZLIB) + wl_include_system_directories(${NAME} ${ZLIB_INCLUDE_DIRS}) + target_link_libraries(${NAME} ${ZLIB_LIBRARY}) ++ if (MINIZIP_FOUND) ++ wl_include_system_directories(${NAME} ${MINIZIP_INCLUDE_DIR}) ++ target_link_libraries(${NAME} ${MINIZIP_LIBRARY}) ++ target_compile_definitions(${NAME} PUBLIC -DHAVE_SYSTEM_MINIZIP) ++ else(MINIZIP_FOUND) ++ target_link_libraries(${NAME} third_party_minizip) ++ message(FATAL_ERROR "You are using widelands-bundled minizip source= s. Please install your distribution's minizip dev library or urge your dist= ribution maintainer to include the minizip library in your package reposito= ry. Thank you.") ++ endif(MINIZIP_FOUND) + endif() +=20 + # OpenGL and GLEW are one thing for us. If you use the one, you also us= e the +--- a/src/third_party/CMakeLists.txt ++++ b/src/third_party/CMakeLists.txt +@@ -1,12 +1,14 @@ +-wl_library(third_party_minizip +- THIRD_PARTY +- SRCS +- minizip/ioapi.h +- minizip/unzip.cc +- minizip/unzip.h +- minizip/zip.h +- USES_ZLIB +-) ++if(NOT MINIZIP_FOUND) ++ wl_library(third_party_minizip ++ THIRD_PARTY ++ SRCS ++ ioapi.h ++ unzip.cc ++ unzip.h ++ zip.h ++ USES_ZLIB ++ ) ++endif(NOT MINIZIP_FOUND) +=20 + wl_library(third_party_eris + THIRD_PARTY +--- a/src/io/filesystem/CMakeLists.txt ++++ b/src/io/filesystem/CMakeLists.txt +@@ -12,6 +12,7 @@ + zip_exceptions.h + zip_filesystem.cc + zip_filesystem.h ++ USES_ZLIB + DEPENDS + base_exceptions + base_i18n +@@ -19,5 +20,4 @@ + base_macros + graphic_text_layout + io_stream +- third_party_minizip + ) +--- a/src/io/filesystem/zip_filesystem.h ++++ b/src/io/filesystem/zip_filesystem.h +@@ -28,8 +28,14 @@ + #include "io/filesystem/filesystem.h" + #include "io/streamread.h" + #include "io/streamwrite.h" ++ ++#ifndef HAVE_SYSTEM_MINIZIP + #include "third_party/minizip/unzip.h" + #include "third_party/minizip/zip.h" ++#else ++#include ++#include ++#endif +=20 + class ZipFilesystem : public FileSystem { + public: --=20 2.26.2 --=-=-=--